Suppose I have a VPS with multiple dedicated IP addresses and multiple domains:
126.96.36.199, mx is
188.8.131.52, mx is
184.108.40.206, mx is
domain-a.com is the primary domain and the server's hostname is
Everything seems to be fine until I find that SMTP emails sent using Exim 4.72 are bouncing, failing or being flagged as spam to many domains. After some digging, I discover that there are mismatches: for emails from every domain, the
HELO is from
For example, I see this in headers on emails I send to gmail:
Received: from server.domain-a.com (mail.domain-c.com. [220.127.116.11])
And a mail testing service like https://www.mail-tester.com/ tells me:
Your reverse DNS does not match with your sending domain.
Your IP address 18.104.22.168 is associated with the domain mail.domain-c.com.
Nevertheless your message appears to be sent from server.domain-a.com.
You may want to change your pointer (PTR type) DNS record and the host name of your server to the same value.
Here are the tested values for this check:
IP: 22.214.171.124 HELO: server.domain-a.com rDNS: mail.domain-c.com
But obviously I can't point
server.domain-a.com at domains a, b and c at once, and anyway, I don't necessarily want domain-c.com to be sending via domain-a.com - let's assume they're independent businesses that just happen to be hosted on the same server.
How can I configure exim to send each email from its own domain, and to
HELO from the mail server domain, not the server's primary hostname?
So that the headers look like this:
Received: from mail.domain-c.com (mail.domain-c.com. [126.96.36.199])
And the testing results report this:
IP: 188.8.131.52 HELO: mail.domain-c.com rDNS: mail.domain-c.com
I found a solution to this same question for IP addresses, which is how I'm sending mail from different IPs, so I'm sure there must be a similar solution for domains.
In my research all I could find was this solution but it depends on cP***l and W*M and a file
/etc/mailhelo that only exists in cP***l. It's clearly possible, but that solution depends on some behind the scenes gubbins baked into cP***l, which I don't use.
Operating system is CentOS if that's relevant.