Date: Sat, 14 Jun 2008 22:13:58 +0100 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: Wojciech Puchar <wojtek@wojtek.tensor.gdynia.pl> Cc: freebsd-questions@freebsd.org Subject: Re: sendmail's outgoing IPs Message-ID: <48543496.4040405@infracaninophile.co.uk> In-Reply-To: <20080614205751.D35816@wojtek.tensor.gdynia.pl> References: <20080614205751.D35816@wojtek.tensor.gdynia.pl>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7CFCC4AD8F5D579F28790F3E Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Wojciech Puchar wrote: > is it possible to make sendmail choose it's outgoing IP when sending=20 > mail from list of four in random or round-robin way? Not easily. sendmail(8) defaults to binding to all IPs on the machine (INADDR_ANY) and the IP it will use to send with will just be whatever would be the default from the routing table to reach the destination. You can control what interfaces sendmail will listen on by using the DAEMON_OPTIONS() macro in /etc/mail/$(hostname).mc and you can set what IP number the machine will use as the origin address using the CLIENT_OPTIONS() macro. However, CLIENT_OPTIONS() doesn't give you any method of cycling through multiple IP numbers. What could you do? Run four instances of sendmail in different jails as outgoing mail relays, each bound to a different IP. Supposing your server is called 'smtp.your.dom.ain' then you can make that an A record which returns those 4 different IP numbers. Clients looking the server up in the DNS will get a randomised list of IPs (or round-robin, depending on the configuration of the DNS servers you're using). Alternatively you can use one instance of sendmail and do NAT tricks to rewrite the packets on the way out of the firewall. See http://www.op= enbsd.org/faq/pf/nat.html and the 'NAT LOAD BALANCE' example in pf.conf(5). Note however that you should take care to ensure that the hostname your MTA helos as matches whatever IP or IPs are ultimately used in the connection to the other MTA, or your message may well be refused as likely to be spam. There are also recipes I've seen on the comp.mail.sendmail newsgroup for running sendmail with multiple virtual identities depending on the sender address of the e-mail, which isn't exactly what you asked for but might be good enough. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW --------------enig7CFCC4AD8F5D579F28790F3E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREIAAYFAkhUNJ4ACgkQ8Mjk52CukIw9+gCcCwREI97Suvejqzk4RMq6QdSV q80AmwSz1DZf4g7UOhZxU/wYDkCmJe5p =V5lj -----END PGP SIGNATURE----- --------------enig7CFCC4AD8F5D579F28790F3E--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48543496.4040405>