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



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



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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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