[exim] Conditionally removing/rewriting received header base…

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: David North
Data:  
Para: exim-users
Asunto: [exim] Conditionally removing/rewriting received header based on destination MX hostname
I ran into a problem earlier today sending mail from my phone via Exim 4
on my server.

My phone has a randomly chosen IPv6 address (within my /64) thanks to
IPv6's privacy features. The phone's IP has no reverse DNS. It relays
mail up to my server, which has a static IPv6 address with reverse DNS.

Unfortunately, it seems Google bounce all mail received by their servers
with *any* IPv6 address in the Received: headers which does not have
reverse DNS.

Leaving aside how broken this behaviour is, I'm trying to work round it
in my Exim configuration.

Disabling IPv6 for Exim altogether would be an effective if rather
brutal and backward-looking option. Disabling IPv6 per target domain is
also possible and less brutal, but the trouble is the number of them -
plenty of people use Google Apps for their own domains, so a simple
regex match on gmail won't cut it.

So what I would like is to have exim do this:

IF message is to be delivered to *.google.com via the remote_smtp transport

THEN delete Received: headers containing IPv6 addresses matching my /64

AND possibly add an X-Received header with the deleted content and some
pithy remark about Google being idiots.

Is this possible within Exim? Having spent some time with the
documentation, it looks like the remote_smtp transport has access to the
target MX hostname in $host, but I can't see a way to conditionally
drive some header removal/addition from this if $host matches *.google.com.

I could do it in a programming language of my choice invoked via
transport_filter, but I'd rather not involve a separate process in this
stage of delivery.

Thanks,
David


--
David North | http://www.dnorth.net