Exchange 2007 API for reading log files that contain bounced emails? - email

Ive been trying to figure out how this situation is handled easily.
I have a website that sends out some emails. I want to be able to somehow get the bounce backs and so I can store the information in a DB table.
The main confusion comes in how is this done? I assume I create a email address that will be the FROM:. But when the email doesnt go through I assume Exchange Server would get that bounce back... does it log it somewhere? in a file? In a database? How can I read this info ?

I have built a couple of applications that process Exchange bounce backs. Generally the bounce back messages will get returned to the inbox of the FROM address on the message that you send out. So, in order to store that information in a database table, I built a windows service that would periodically read that bounce back inbox, and then log that information into a database.
I assume your using exchange; So, in order to read the bounce back information from exchange I used the Exchange Web Services, that allow you to connect to exchange and read the message contents within an inbox (in addition to a bunch of other exchange functions). From there I could process the messages and insert data into my application's database.
One thing to note, is that Exchange Web Services are only available for Exchange 2007 or later. If you're using an earlier version, then you would have to investigate other options.

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.

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

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.

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.

How to receive emails of the same inbox from multiple server instances

I have an application running on WebLogic Server with 6 instances. Many requests for the application come from Email. We already set up an email account that will be used by all clients to send email to. But the problem is that the email account inbox can only be opened for reading by a single connection, unlike a typical database.
Currently I can only deploy the email reading service on a single server instance, this will effectively create a single point of failure and unbalanced load. What's the best way to read from the same inbox from multiple servers? I am thinking developing something using a database table, sort of leasing, whoever locked the table own the lease and can connect to the email server, but this is pretty hard to implement correctly in all circumstances.
I am not sure why you say that only one client can access the inbox as POP certainly can handle multiple connections to the same inbox and this can be configured in the mail server. You might need to talk to your mail server admin.
I haven't worked with Weblogic to give you a specific answer, but you should also be able to have a service written that checks the incoming mail and process incoming mails into a database as you wanted. Once the information is in a database, you can use it via multiple hosts. This is a better approach as this can be setup to prevent multiple clients responding to the same email.