Search code examples
c#emailemail-bounces

Header-variables in bounced emails: what points could have an effect if they are deleted or not?


We use BounceStudio in order to analyze the bounced emails for a newsletter-system. The headers are added like this:

// Namespace System.Net.Mail
MailMessage mail = new MailMessage();
mail.Headers.Add("X-BPS1", UserId);
// etc.
smptClient.Send(mail);

So far so good. The interesting thing is that a lot of the bounced emails don't include the headers we added. I couldn't figure out on what that could depend if the headers are preserved or not? One interesting observation I made is the fact that it seems to depend on which from-address is used (they are sent with the same smtp though). From newsletter A with from-address A I receive most header variables (about 90%, which is good I guess), from newsletter B with from-address B (and other receivers of course) I only receive about 20% of the header variables, the other 80% of the bounced mails don't include the header-information. All mails are html-mails and technically the same.

Leaves the question what could influence the headers within the bounced mails? Does somebody know details or good sources about that subject? Or how could I design the system better?

Am I right that the best way might still be hiding the information within the from- or return-path email-adress and then parse it out from there? But this would include configuring the smtp with wildcards or similar, don't have much knowledge there.

Thx for any tipps sl3dg3


Solution

  • If the remote MTA generates the bounce, you are at its mercy. Unsurprisingly, Windows MTAs seem to be particularly tacky in this regard. The standard solution is VERP, i.e. a unique envelope sender address (and hence Return-Path:) for each recipient.