Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Identify bounced EmailMessage (EWS)

Is there a way to accurately identity bounced back email notifications in a mailbox using EWS? So far I`ve looked at the message headers and nothing seems to indicate that the message is an email bounce notification.

I also looked at the Item and the EmailMessage members and haven't found anything useful (I may have missed something).

I could always parse the sender which always says 'Email Delivery System' or the subject line or even the message body, but I'm looking for a cleaner way to do that.

like image 699
plalx Avatar asked Oct 08 '15 19:10

plalx


1 Answers

Try the ItemClass property.

This corresponds to PR_MESSAGE_CLASS MAPI property. This link provides some values for this property. You can find there a list of message classes for different types of messages. Some of them are for Non-Delivery reports, which I think is what you want.

It seems that if this property value starts with "REPORT.IPM" and ends with ".NDR" then its a Non-delivery report.

like image 136
Yacoub Massad Avatar answered Oct 25 '22 08:10

Yacoub Massad