Writing a job that can access office 365 email and migrate them elsewhere - email

I need a little help understanding a task I have been given.
I started work on a 'SharePoint focused' team and we are trying to create a SharePoint portal that would house/manage all incoming mail to a specific company email address.
We have had a couple of issues setting up SharePoint to accept incoming mail, so have begun looking at other possible options.
1 option that was suggested was to 'write a job' that would read our mailbox server (on Office 365), and then find, pull and migrate/copy selected emails onto the sharepoint site.
(something else we are also interested in doing is seeing what info we can grab from these emails at this stage which we can use to create various mail objects in sharepoint with the mail metadata. Not sure what limitations there are to what can be accessed, if anything)
Is somebody able to explain a little more the type of process or work that is required to do this (access Office 365 mail via some API which we can create a timed job for), and any experience or advice around it? Where would I start looking or how would I start implementing it, etc.
Thanks!

You combine couple of things together. SP can read incoming emails through locally installed and configured SMTP server. You can then setup document library or list to store them or create event listener to handle incoming emails completely by your own.
But both cases (OOTB functionality or event receiver) rely on local SMTP. If you want process emails from other server like Exchange Online you must either forward these emails to local SMTP server installed beside SP or you must create your own code. It can be SP job or any other type like windows service or console application executed by windows schedule, ... calling Exchange online API (designed specially for Exchange online) or MAPI or POP3 (generic using libraries) to get emails and calling SP API (CSOM, REST API) to store emails.

Related

Email succesfully sent but not appear in Sent Items (Microsoft 365)

Hi Good day to everyone here.
My first questions, here we go but i'll try to explain it the best way I could.
I develop auto sending email features using javaxmail in my application for my customer.
Previously when using setting smtp.office365.com I able to send email and the copies of sent email are display in Sent Items folder.
Recently when there are hiccup with smtp office (time out frequently), the IT department at my customer change the setting to use local server instead for smtp (with ip address 172.162.etc.etc). However since the start using this new setting, the email no longer appear in Sent Items but the email still able to sent out ( I test sending email to myself and able to received it ).
Since Im not really familiar and have very limited knowledge on server side for mail server, is there anything I can suggest to the IT department to check for? I only can login the email account on web (https://outlook.office.com/mail/) but when using outlook it required authentication. With web mail i already go thru all settings available and didn't see anything related.
Thanks in advance. Sorry if the question confusing and misleading.
Well, of course - your local SMTP server knows absolutely nothing about your remote Exchange mailbox. It cannot possibly place anything in your Sent Items folder.
You need to send using your Exchange Server - its SMTP server does place sent messages in the Sent Items folder owned by the authenticated user. Keep in mind that MS has recently disabled basic auth in M365. You need to re-enable it for your tenant and the particular mailbox used to send messages.

How to migrate Notes mail agents to Microsoft Exchange (i.c. Office365)?

A client insists on moving from Notes/Domino to Office365 (no further comments on that please). There are some mail agents that provide automated functionality. In one case, it is an agent in a mail database that, when it receives a mail, it responds with a mail that contains a unique reference for the mail just received. It's their way to generate unique mail references.
How to create an alternative solution, in Office 365? Can one develop an agent in Office365?
If it must be an equivalent solution, does it have to be an Outlook client that's always on?
Or are there other ways to generate reply mails from a special mail account?
Can one send a mail to an SQL server, for instance?
I'm open to all your suggestions! Thanks.
I'd do some research into what's currently available for Office365 users via Exchange Web Services - or better yet, the Exchange Web Services Managed API.
Assuming that you Office365 gives you full access through Exchange Web Services, you can write code to use the subscription/notification services for the mailboxes that you want to monitor, and then have your code send the emails.
There may also be better ways.

Automatically moving all mails belonging to same conversation thread to external folder

Hi I have Exchange Server 2007 setup with some users with their own inbox. Since this is all related to office conversations I want to move all the incoming and outgoing mails belonging to same conversation thread to disk folder (any folder on his machine say D:\Conversation1).
I am able to let user create separate disk folder for each conversation and let him move first mail in conversation to this folder. So that is not the problem now.
Also I have written a web app which when provided the conversation ID returns the corresponding disk folder path.
However now what I want is to process all incoming & outgoing mails and auto move them to the disk folder corresponding to their conversation thread. I found two possible ways:
Write Outlook plugin which when user logs in will intercept all incoming mails and outgoing mails find their conversation id, send it to web app I written and move them to the disk folder path returned by my web app.
Using EWS: I could write a service for client machines which will ask for user login and based on that login cred it will connect to Exchange server using Exchange Server Webservices (EWS) and will then do the same thing as above. However here it will require to periodically poll / ask Exchange Server to check if their are any new mails sent / received through by the user who provided the login credentials. In outlook plugin I need not do such periodic requests - I could just write code on new incoming / outgoing mail handlers.
Q. Is there any better approach to achieve this through EWS than as explained above.
Main Q. What I find wrong with both above approaches is that - my functionality is same for all mails accounts / users. So why need user to log in just for movement of mails. Can I write something like Exchange Server Tasks ( - a server side code instead of client side code as it was the case with both above approaches) which will continuously process all mails (from all mail accounts configured on Exchange Server) find their conversation IDs and with the help of my web app move them to the corresponding disk folder.
Details that you may ignore
I have Outlook 2010 configured for users.
I have a repository setup that will manage storage of mails in folder. Yes this repository will be own its own machine - not on the exchange server. But eventually it will be on hard disk, so referring them as "disk folder" is still no wrong.
Also you can think of that web app as a part of repository handling. So it runs on repository machine. Just didn't mentioned above to reduce details and focus on which approaches available and preferable - simple and clean.

What email server or online email service allows for creating unlimited email alias for an inbox (via API)

Here is the reason for my peculiar question:
I am working on a mortgage application for a mortgage broker where each mortgage application is a record. Now this broker will take each of the applications he has received and enter this application (in an up line lender's system) and during the life of this mortgage application, he receives notification emails about updates from the up line lender.
It is required that in this application, all emails pertaining to a particular mortgage application are visible under that record.
My plan is to have all emails collect in a single inbox, and give that inbox an alias corresponding to the record id of the mortgage record. The alias remains active as long as the mortgage application is active and the broker cares for receiving these updates. Once the mortgage application record is dead, that alias is removed.
When displaying the particular mortgage record, I can query the mail server for the emails where the to address is the alias of that particular record.
My key requirements are:
The email server or email service should allow for about 400-500 aliases at a time.
Should have an API interface for creating and deleting an alias.
As far as the creating/deleting API is concerned, Google Apps (https://developers.google.com/admin-sdk/directory/v1/guides/manage-user-aliases) really fits the requirement, but has a 30 alias limit.
Does Microsoft Outlook online mail support this kind of API and ability to create mailbox alias?
If we went in the direction of having a Microsoft Exchange Server 2010/2013, would it allow programmatic access to create aliases? What would be the license cost?
Thanks in advance for looking this up.
With update from #mti2935, I am considering a catch-all solution rather then deal with creating aliases.
So, now I think all I need is to be able to process the emails. What's the best means of processing emails (in my case, I will simply have to look at the "to" field and put the emails in different buckets).
I have found a third party service that can help me parse emails. Definitely going to try that out and provide an update here.
Service: https://postmarkapp.com/inbound
Referenced by a post on: How to setup a mail server?
One option to consider is to setup a mail server using qmail, configured as a catch-all for your domain, such that all mail to *#yourdomain.tld forwards to a script which parses each incoming message, scrapes the to, from, subject, etc. logs the messages in your database, etc. It's easier than it sounds to setup. See How to setup a mail server?. This can be done fairly inexpensively on a Rackspace or AWS cloud server.

Is there a way to backup emails from OWA?

I am using OWA on IE8 and am do not have any email client like outlook installed. We just access email in the browser using OWA.
Is there a script (maybe a scraper) that backs up the emails?
How do I go about writing such a script, is there a OWA API?
I googled a lot but every solution first syncs OWA to exchange or outlook or some other email client and then backs it up. I do not have that luxury.
I have python installed, so a simple email client script written in python can be helpful too, if it can somehow be configured to logina nd read emails from OWA.
Thanks !
http://davmail.sourceforge.net/ can be used as a proxy to expose OWA folders via IMAP and POP3.
The main goal of DavMail is to provide standard compliant protocols in front of proprietary Exchange. This means .. IMAP to browse messages on the server in any folder, POP to retrieve inbox messages only, .. Thus any standard compliant client can be used with Microsoft Exchange.
Then question becomes how to make backup of IMAP or POP3 server.
It's not possible to export mails in bulk from OWA, as far as I know.
As you suggested the only way would be using Outlook..