I have a Debian server running PHP and Exim4 (among other things of course). The PHP application is sending 1000s of emails every day all of which work fine, however I now have a new customer and my PHP/Exim4 has trouble sending to this account.
PS I added the --at-- to stop crawlers finding the addresses.
- I checked the exim4 logs and found this:
2014-04-02 08:48:10 1WV7TW-0001Em-Od <= support --at-- sobs.com.au H=localhost [127.0.0.1] P=esmtp S=1215 2014-04-02 08:48:11 1WV7TW-0001Em-Od ** az --at-- mentonegrammmar: Unrouteable address 2014-04-02 08:48:11 1WV7TW-0001Em-Od Completed
- I then checked the routing in exim4 using:
# exim -bt az --at-- mentonegrammar R: dnslookup for az --at-- mentonegrammar az --at-- mentonegrammar router = dnslookup, transport = remote_smtp host mail.mentonegrammar [126.96.36.199] MX=5
This looks as though the routing is working perfectly. I tried the application email again and still get the Unrouteable address error.
Then I tried a command line email from the same server.
echo "Test message" | mail -s "Test message" az --at-- mentonegrammar
This email worked and arrived as required, but the email from my PHP application still fails.
- I checked the application:
$mime = new Mail_mime(); $mime->setHTMLBody($body); $content = $mime->get(array('html_charset' => 'utf-8')); $formattedHeaders = $mime->headers($headers); $smtp = Mail::factory("smtp", array()); $result = $smtp->send($headers["To"], $formattedHeaders, $content);
As mentioned there are 1000s of emails being successfully sent by this server and application.
The IT at Mentone Grammar haven't indicated any problems receiving any other emails.
In summary, I keep coming back to the 'Unrouteable address' error in the exim4 log, and the debug output indicating that the address is routable. I can't help thinking there is some problem with the Exim4 config, yet only when getting the mail request from a PHP application, is it a security thing - I just don't know.
Can anybody point me in the right direction please?