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.

I already have a line in main.cf for header checks:

header_checks = regexp:/etc/postfix/header_checks_regex

so I started from the assumption that I ought to be able to simply add a line to that which matches everything and use that to add the header:

/./ PREPEND X-Test-Header: yes

Now, that works OK. But what I want to do is to be able to replace the header value in each mail with a custom value derived from the mail itself, using some kind of lookup or replacement method - something like

/./ PREPEND X-Test-Header: ${user}

So my question is: is there any way to do this? If so, how? Or am I barking up completely the wrong tree here?

Mark
--
 Sent from my Babbage Difference Engine
 http://mark.goodge.co.uk
 http://www.ratemysupermarket.com

Reply via email to