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

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.

  1. I checked the exim4 logs and found this:
2014-04-02 08:48:10 1WV7TW-0001Em-Od <= support --at-- H=localhost [] 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
  1. 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 [] MX=5

This looks as though the routing is working perfectly. I tried the application email again and still get the Unrouteable address error.

  1. 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.

  1. I checked the application:
$mime = new Mail_mime();
$content = $mime->get(array('html_charset' => 'utf-8'));
$formattedHeaders = $mime->headers($headers);
$smtp = Mail::factory("smtp", array());
$result = $smtp->send($headers["To"], $formattedHeaders, $content);
  1. As mentioned there are 1000s of emails being successfully sent by this server and application.

  2. 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?

share|improve this question
up vote 2 down vote accepted

I am not sure, maybe a typo, but in one case you have three mmm (see exim4 logs) and in the other you have two mm (see your routing test and your echo test) in the domain name : (does not exist) (exists)

Double-check for the correct domain name within your PHP application.

share|improve this answer
Thank you so much! This was exactly the problem... and my browser kept remembering the incorrect entry and auto-filling the field without me noticing. – muz the axe Apr 2 '14 at 12:52

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.