Question

We are in the process of converting a batch job that processes our bounced emails that we send. We are switching from Redemption to EWS (just upgraded to Exchange 2010 from Exchange 2003). As you know bounced emails come in different forms. I have been able to work through all the test case emails i've got except for the ones that come in the form of:

Your message did not reach some or all of the intended recipients.


      Subject: Hello
      Sent: 4/01/2012 8:16 AM

The following recipient(s) cannot be reached:

      hi@foo.com on 4/01/2012 8:19 AM
            The e-mail system was unable to deliver the message, but did not report a specific reason.  Check the address and try again.  If it still fails, contact your system administrator.
             smtp.mydomain.com #5.0.0 smtp; 5.3.0 - Other mail system problem 554-"delivery error: dd This user doesn't have a foo.com account (hi@foo.com) [-5] - mail.foo.com" (delivery attempts: 0)>

This is what is displayed in outlook. When i read the email with EWS the Body is empty. I need to look at the information above when i get the email with EWS. The emails have an attachment (which is the original email) though it doesn't look that way in outlook. I've tried to look at almost all the properties that comes back from EWS and have yet been able to find the text above. Redemption allow you to look at this info using ReportText. What we are specifically looking for is the email error delivery code. We do different things based on this code.

Edit: To be clearer the Body Property on my other test cases isn't empty. I'm loading the emails like:

            Dim emailPset = New PropertySet(BasePropertySet.FirstClassProperties)
            emailPset.RequestedBodyType = BodyType.Text
            Dim f = EmailMessage.Bind(email.Service, email.Id, emailPset)

Update1: After some research it looks like i need to be able to read the Recipients table of the message in the PR_NDR_STATUS_CODE & PR_REPORT_TEXT fields. Still searching if there is a way to do this in EWS.

Was it helpful?

Solution

We were able to get enough info the

smtp.mydomain.com #5.0.0 smtp; 5.3.0 - Other mail system problem 554-"delivery error: dd This user doesn't have a foo.com account (hi@foo.com) [-5] - mail.foo.com" (delivery attempts: 0)>

part which is what we needed by telling the object to load the MIME content.

Definitely not the most straight forward API to use but hopefully we don't hit any more hickups.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top