Meanwhile, one issue that came up was a client with a server that had multiple domains on it. While sending mails with php’s mail function, the Received and other headers were not being set correctly, because of which mails to hotmail and live.com were ending up in the junk folder.
Return-Path: &lt;firstname.lastname@example.org&gt; Received: from noc.wrong.com ([18.104.22.168]) by mx.google.com with ESMTP id 42si3780510ywh.71.2009.; Wed, 11 Nov 2009 22:59:31 -0800 (PST) Received-SPF: neutral (google.com: .......; Authentication-Results: mx.google.com; ....... Received: from wronguser by noc.wrong.com with local(Exim 4.69) (envelope-from &lt;email@example.com&gt;)ntid 1N8TeT-0007On-F6ntfor firstname.lastname@example.org ; Thu, 12 Nov 2009 01:59:29 -0500
See the envelope-from? That was not being set properly event by using the 5th parameter in php mail as ‘-email@example.com’
The fix for that was easy, set
The trusted_users variable is a colon delimited list of user accounts whose domains should be allowed to send mail as themselves.
Now for the actual code fixes, which can be found here.
The problem with the first method was that $interface_address was not set at all for outgoing mail. Since we do not receive incoming mail for our domains, I didn’t get to check how the incoming mails were working out. If you are using WHM, however, you just need to create the files /etc/mailhelo and /etc/mailips and you are good to go after restarting exim. (test with exim -bV first)
I get these headers after the edit.
Received: from correct.com ([22.214.171.124])
by mx.google.com with ESMTP id 42si3780510ywh.71.2009.;
Wed, 11 Nov 2009 22:59:31 -0800 (PST)
Received-SPF: neutral (google.com: …….;
Authentication-Results: mx.google.com; …….
Received: from correctuser by noc.wrong.com with local(Exim 4.69)
(envelope-from &lt;firstname.lastname@example.org&gt;)ntid 1N8TeT-0007On-F6ntfor email@example.com ; Thu, 12 Nov 2009 01:59:29 -0500</pre>
Couldn’t figure out how to set the smtp_active_hostname in exim.conf since $interface_address wasn’t being set. Still, the mails no longer end up in the junk mail folder on gmail, yahoo, aol and hotmail, so I think I am golden.
Took ages to get the above links. Just hope it helps someone else too.