Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

How to configure Qmail such that for outgoing mails it will automatically set the source IP depending on the domain rather than using the default IP of the server.

I think there is configuration in Exim to send outgoing mail from the ip that matches the domain name in /etc/mailips.

Is there something similar present in Qmail ?

Warm Regards


share|improve this question

It doesn't look like that functionality is supported directly, but there is a patch that sounds like it will do what you want:

share|improve this answer

There's also another qmail patch which uses a control file instead of DNS lookups:

Beware! Both patches not only select the outgoing IP address, but also change the hostname used in the HELO command that qmail-remote uses when connecting to the target server. This can be problematic if you don't use dedicated IPs for every domain because your server is then telling "HELO domain1.tld" as well as "HELO domain2.tld" for connections originating from the same IP address. A couple of providers don't like this "multiple personality" behaviour and will block the IP in question as soon as a couple of HELO hostname changes are observed.

The correct way would be to set the HELO string to PTR record of the outgoing IP; however I'm not aware of any patch which does this.

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.