Re: [exim] NATted exim on receive

Top Page
Delete this message
Reply to this message
Author: Tom Kistner
Date:  
To: Alun
CC: exim-users
Subject: Re: [exim] NATted exim on receive
Alun wrote:

> The firewall is a Linux box and I've told it to redirect port 25
> traffic to port 25 on the local host. This works and I can connect in.
> What I'm after is a way of determining which IP address the connecting
> machine was trying to talk to. $interface_address returns the address
> of the interface the request came in on, but that's different from the
> address that was being contacted.


You need to patch Exim to do this. If you use the netfilter (aka
iptables) REDIRECT target, the original destination address can be
fetched from the socket using getsockopt(...SO_ORIGINAL_DST...).

This needs to be done inside Exim. If you want to reject anything anyway
you could just hack up a small SMTP responder instead. You can also use
Perl for that, IO::Socket seems to have a getsockopt method.

/tom