0

When sending an email, is there a way I can control what the subject of the bounced email will be (in the event that it bounces and is not deliverable).

Basically, I can control where the bounced email will go using the Return-Path header, and I'm wondering if there's a way to set the subject line of that bounced email.

So if I sent an email with the subject:

There's an update to account #123456

In the event it bounces, I'd like the bounced email that is returned to the mail server to have the subject:

"There was a bounce for account #123456"

Possible?

Nightwolf
  • 4,495
  • 2
  • 21
  • 29

1 Answers1

0

Not possible. Different servers will do different things with their bounce formatting. Some might send the subject intact, some might completely overwrite it -- there's no standard. The only piece of information you can guarantee is (as you've already discovered) the return path address.

Edit: If you're trying to determine who the bounce was for, you can encode it in the return path. For example:

Return-Path: bounce+123456@mydomain.com

Then configure your email server to accept all bounce+ addresses and send them to your processing script. Better, encode the address:

Return-Path: bounce-<some obfuscated string>@mydomain.com

This would allow you to extract the string, lookup the associated account number, and then mark the account invalid. (Or whatever you do.) Ideally, you don't want to include the raw guessable id in the address, or anybody can disable an account just by sending an email to that easily guessable address.

Alex Howansky
  • 50,515
  • 8
  • 78
  • 98