[exim] Filter question - getting "envelope-to" header via pi…

Pàgina inicial
Delete this message
Reply to this message
Autor: Kirk Friggstad
Data:  
A: exim-users
Assumpte: [exim] Filter question - getting "envelope-to" header via pipe?
Hi all - I'm a bit of a newbie when it comes to Exim, so please let me know if I'm doing this the completely wrong way...

I'm running Exim 4.69 on Ubuntu Server 8.04, with virtual hosts configured as per http://www.debian-administration.org/articles/140 - for one of my domains, I have a catch-all address that delivers to a local user. In that local user's home directory, there is this .forward file:
# Exim filter
save $home/mailattachments/
pipe "$home/myperlscript"

Everything works pretty much as expected - incoming mail gets saved in the mailattachments directory, and the perl script fires and gets the entire message on STDIN with no problems. However, I haven't been able to find how to find out the original address the message is sent to. In the saved copy, there is an additional header called "Envelope-to" that contains the original address, but this header doesn't appear to exist in the message as delivered to STDIN. I haven't been able to find the original address in any of the environment variables, and none of the string expansions that I've tried seems to have it either. I can't rely on the "To:" field either, as most of the messages are being forwarded from another account on another mail server.

First question - is there a simple string expansion or some other place that I can pass the envelope-to information to the pipe script (as a command-line argument, etc.)?

Second question - is there a better way to get all mail for a particular domain to feed through a custom script (that will also be able to pass along the envelope-to information) besides what I'm doing (catch-all to local account, .forward with pipe)?

Thanks in advance for any pointers, suggestions, or outright solutions.