Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

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 ( is the IP of the distant MX, is the IP you want to bind, is your "normal" IP):
share|improve this answer

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 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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.