I would like to configure qmail to send email for certain domains using specific IPs for the outbound traffic. All other domains could continue to use the system's primary IP as usual. Is this possible? If so, how would I configure it?
I would like to configure qmail to send email for certain domains using specific IPs for the outbound traffic. All other domains could continue to use the system's primary IP as usual. Is this possible? If so, how would I configure it?
If your qmail include the bindroutes patch, and if you know the IP address if the MX you want to connect to, then you could do it, using
/var/qmail/control/bindroutes
(1.2.3.4
is the IP of the distant MX,5.6.7.8
is the IP you want to bind,5.6.7.88
is your "normal" IP):From my experience and what I searched in the manual, this doesn't seem possible with the unpatched version of qmail.
But, if you use patches from this page (which I use and would recommend anyway because it supports so much sane and interesting features), you can search in that page for the string 'newbind.patch'. The second match will probably give you a good solution to your problem. The main difference from the bindroutes patch is that you can configure IP address binding according to the recipent domain name instead of its IP address (which I find more convenient).
Anyway, I find that the site http://qmail.jms1.net is really useful. It had become my main source of documentation/script/patch in regard to qmail. It definitely deserve a not-so-short visit.