[Mimedefang] Adding support for learning our addresses

Philip Prindeville philipp_subx at redfish-solutions.com
Sat Jan 28 03:39:49 EST 2006


This is what I came up with.  It's been tested on both 32-bit and 64-bit
Linux (amd64).

If you call IfAddrs::get() and you only get a single interface name/address
pair, test it via isunroutable().  If the address ISN'T unroutable, then you
shouldn't be seeing anyone connecting to you with this address as the
helo (i.e. it's yours and unique).

On the other hand, if, like me, your local address *is* unroutable, then it
means that you're behind a firewall, and need to do a gethostbyname() on
your own name to figure out what your outside address is (i.e. what the
address of your firewall is that proxies for you).

-Philip

-------------- next part --------------
A non-text attachment was scrubbed...
Name: myips.pm
Type: application/x-perl
Size: 1191 bytes
Desc: not available
URL: <https://lists.mimedefang.org/pipermail/mimedefang_lists.mimedefang.org/attachments/20060128/68d884e7/attachment.pl>


More information about the MIMEDefang mailing list