[Pkg-exim4-users] exim4 in etch - save all mails

Maarten Bezemer mcbexim at robuust.nl
Sun Nov 30 22:47:50 UTC 2008


I'm having a little trouble getting exim to do what I want, and I'm hoping 
someone here could tell me what I'm missing...

Previously in exim3, I could configure an "unseen save" in the system 
filter to save all mails passing the server. An extra X-Envelope-to: 
header was added to the saved mail, so one could see both the 
envelope-from and the envelope-to (i.e., up to 100 addresses) of all 

Now, with exim4, the X-Envelope-to: headers appears to be abolished (see 
Exim4.upgrade). When setting 'envelope_to_add' in the systemfilter file 
transport, it nicely adds 'Envelope-to: system-filter' which of course 
doesn't help me.

The only place where I have access to the $recipients variable containing 
all recipients, is INSIDE the system-filter file. So something like 
headers_add = "X-Envelope-to: $recipients"
in the systemfilter_file transport results in a panic.

On the other hand, adding an extra header in the system-filter file before 
doing the unseen save does give me an x-envelope-to header in the saved 
mail, but this header also appears on all copies delivered to end-users or 
remote addresses.
That's highly unwanted...

So, I tried the next setup in the system filter file:
headers add "X-Envelope-to: $recipients"
unseen save "/tmp/allmail"
headers remove "X-Envelope-to"

But now the X-Envelope-to headers don't even appear in /tmp/allmail.
It seems that they are being removed before the "unseen save" is started.

So, even though exim4 really is a lot more clean than exim3, I can't save 
all mail including envelope to. For outbound mail with Bcc addresses, I 
really need a record of those addresses in something like an envelope-to 

Oh, and something else I tried: create a new router (also unseen) to just 
send every mail through a copy-transport. This also doesn't do what I 
want: every recipient address is passed though this router individually, 
so messages are saved one time for each recipient. The first_time 
condition can help reducing the number of times a message is saved, BUT 
then only the first recipient is recorded.
Also tried fiddling around with batch_max stuff. At this customer's site 
outbound mail is being held and pushed out every 5 minutes as long as the 
DSL line is up. Otherwise it is pushed out every 30 minutes over fallback 
ISDN. Problem here: addresses for held domains are not even routed until 
actual delivery is attempted. So still multiple copies if a locally 
originated message has both local and remote recipients.

I'm at a dead end here. Could someone help me out? Many thanks in advance!


More information about the Pkg-exim4-users mailing list