How to add custom headers to NDR mails?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to add custom headers to NDR mails?

Abhijith Sethuraj
Hello,

We get bounce-back emails from mailer-daemon when one or more of the recipient addresses are invalid. But, this information is conveyed only in the body of the email and not inside any of the headers.

I'm aware of the bounce daemon along with setting custom bounce messages using a template file but I'm unable to figure out a way to extract the failed recipients and then append that onto the template file as a custom header, say "X-Failed-Recipients". Are they present inside a special variable of some sort that I'm missing out on?


Thanks,
Abhijith
Reply | Threaded
Open this post in threaded view
|

Re: How to add custom headers to NDR mails?

Wietse Venema
Abhijith Sethuraj:
> I'm aware of the bounce daemon along with setting custom bounce messages
> using a template file but I'm unable to figure out a way to extract the
> failed recipients and then append that onto the template file as a custom
> header, say "X-Failed-Recipients". Are they present inside a special
> variable of some sort that I'm missing out on?

If the feature that you want is not documented in Postfix, then it
does not exist in Postfix.

Of course it is all software, so it can be changed.

But what we have is this, based on the bounce(5) manpage:

- There is no variable for failed recipients.

- There is no support for adding headers to a template other than
  the documented ones. Postfix will log a warning for unexpected
  headers.

- Template message headers do not support $parameter expansions
  (many headers have specific syntax requirements such as From: and
  To:).

Changing any of this requires care, so as not to break existing
configurations.

        Wietse