+1 vote

Actually the problem does not seem to be in the way we retrieve the attachments, I noticed the original mail content is just not in the "delivery failed" message returned (using Outlook to verify), it only contains the headers of the original message.

For some messages we get the original content, and for some others we don't, do you know what can cause this ?

It seems it is always the same kind of messages (same subject and similar content) that is not returned with the delivery error.

Maybe some kind of anti-spam or similar thing, but how to know and fix it ?

Thanks a lot

by

1 Answer

0 votes

Bounces are created by SMTP servers. Although there are bounce standards (multipart/report) many servers don't follow them. They use custom bounce formats (e.g. qmail). Even standard reports are not required to contain original message - they can contain message headers only.

The bottom line is: this is how it is, you have no influence on what kind of bounce you'll receive.

Mail.dll's Bounce can help you in parsing bounce messages, however you'll not get access to original message (reasons above):

IMail email = ...;

Bounce bounce = new Bounce();
BounceResult result = bounce.Examine(email);

if (result.IsDeliveryFailure)
{
    string receipient = result.Recipient);

    bool isDeliveryFailure = result.IsDeliveryFailure;

    DSNAction action = result.Action;    
         // DSNAction.Failed or DSNAction.Delayed

    string reason = result.Reason;
    string status = result.Status;
}
by (297k points)
...