We have a web app that sends email. Right now, if we send an email, and it is bounced (for whatever reason), no one knows since it comes from a no-reply address, which is never checked for bounces.
Some of these emails are very important, and we'd like to show the failed email attempt in the interface.
My thought is to do this:
- Inject an X-Header: guid-goes-here into the email to uniquely identify it.
- Create a milter in Postfix that will run the email through a script to parse out that header and (hopefully) at the same time capture the queue ID.
- Parse mail.log for that queue ID and get its disposition (250 OK).
For #2, when I create a milter, does postfix inject the queue ID when it pipes the mail to the script? I am in the early stages of this, and haven't gotten it to work yet. Also, I have chosen to use SMTP content filter in post-queue (http://www.postfix.org/FILTER_README.html). Is this the correct choice?