From: John <fet...@je...> - 2006-07-29 00:59:05
|
>If your inbound server writes X-Original-To: headers, why is a script needed? >-- >Matthias Andree Hi Matthias, X-Original-To isn't always there. If I get a mail directed at a mailing list or sent as a bcc then it isn't always obvious what the sender was. I'm using fetchmail to receive the mail and drop it to a user on my server. When my Postfix gets that mail it can add an X-Original-To but this will be the name of the account specified in the "here" clause in fetchmail conf. This is not of much use so I don't do that. I did do this originally but soon realised there was little point. When the message hits procmail, I run a little script and this extracts a likely original destination address, irrespective if it was sent Bcc or via a list, by extracting the "Received:" header containing a "for" nearest the mail's origin. Procmail then delivers the mail into a user folder based on the address that was extracted: if the mail was destined for "ad...@do..." it hits a folder called domain.com/address. This is great as it sorts all my incoming mail from various services I subscribe to (I subscribe with a unique address to each one so I can track where my address is leaked from as I get spam). I was originally trying to use Fetchmail's multidrop mode to do what I wanted but I didn't fully understand the anatomy of an email so I read the RFC and re-thought what I was doing. I don't know if I am doing this the best way, but what I've got works for me - it's just a prototype but it seems to be ok. Thanks for your interest, John |