Mark Goodge: > I am suffering from AOL numpties who click "this is spam" on > notification emails they get (by their request!) from a forum and > mailing list hosted on my server. In order to trap these, I've set up a > feedback loop with AOL so that I'm notified when anybody does that. > > However, AOL's feedback system removes the recipient email address, so I > can't identify the complainer from the report. So what I need to do is > add a custom header to every outbound mail from my server which > identifies the recipient address. > > Of course, one way to do this would be to set the header in the software > which generates the mail. But this is impractical for several reasons: > Firstly, there is more than one package on the server which sends mail, > so all of them would need to be changed, and, secondly, I didn't write > any of them so it not only means editing someone else's code but also > re-applying the edit any time I upgrade. > > What I'd like to do, therefore, is set a header via Postfix. But I am > having difficulty working out how to do that, or even if it's possible.
First, you must send one recipient per message, otherwise you still won't know who the recipient was when you get feedback from AOL. Once you have one recipient per message, prepend the recipient with check_recipient_access: /etc/postfix/main.cf: smtpd_XXX_restrictions = check_recipient_access pcre:/etc/postfix/prepend.pcre /etc/postfix/rcpt_prepend.pcre: /(.+)/ prepend X-YYY: $1 For suitable values of XXX and YYY. Or use VERP, as others have suggested. Wietse