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

Possible Duplicate:
Outgoing mail from linux not being delivered

As someone marked this a a duplicate I cannot post the actual answer that worked for me and that can be found here: (and not in the duplicate link).

Our website email system based on the CakePHP (1.3) email component has been working perfectly fine for a year and suddently it's not sending emails since yesterday to certain domains anymore, and sometimes even randomly.
I use the mail() php function to send emails via the website (account modifications, project updates, ...), and we retrieve our emails via gmail (we are using google apps). When I try to send an email to a user in our own domain, I get the followin error in /var/log/mail.log:

Mar 9 10:12:29 newserverxxxx sm-mta[27999]: q29ACTlt027999: < >... User unknown

We also have issues with dsn=4.0.0, stat=Deferred on certain users from other domains receiving randomly their emails or not.

We are running a Debian (lenny) + sendmail, with everything up to date.

EDIT: here's the dig mx output:

newserverxxxx:/# dig mx

; <<>> DiG 9.6-ESV-R4 <<>> mx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45980
;; flags: qr rd ra; QUERY: 1, ANSWER: 7, AUTHORITY: 3, ADDITIONAL: 10


;; ANSWER SECTION: 86400 IN MX 30 86400 IN MX 1 86400 IN MX 5 86400 IN MX 5 86400 IN MX 10 86400 IN MX 10 86400 IN MX 30

;; AUTHORITY SECTION: 80089 IN NS 80089 IN NS 80089 IN NS

;; ADDITIONAL SECTION: 99 IN A 97 IN A 99 IN A 399 IN A 399 IN A 536 IN A 536 IN A 658 IN A 658 IN A 658 IN A

;; Query time: 7 msec
;; WHEN: Fri Mar 9 11:37:08 2012
;; MSG SIZE rcvd: 438

share|improve this question

marked as duplicate by Chris S Mar 9 '12 at 13:30

This question was marked as an exact duplicate of an existing question.

What does dig mx say? Is it pointing to correct server? Is this server local? Can you send emails to this address from external source? – Dmitry Alexeyev Mar 9 '12 at 10:54
dig output above. Yes I can; everything's working fine for sending/receiving emails on It's just up to the emails sent from the website. – Nicolas Mar 9 '12 at 11:42
is php configured to send mail using an smtp relay, or calls /usr/sbin/sendmail -t -i directly? You can test that unknown user message my trying to replicate the session using telnet – Tom H Mar 9 '12 at 11:51
No smtp relay used (if would've been simple but google has a very restricted emails quota per hour/day). – Nicolas Mar 9 '12 at 14:27

Your mail server configured to receive mail for locally, that's why it rejects emails for users who are on the server you forwarding emails to. Check /etc/mail/local-host-names file and remove if it's here.

share|improve this answer
Unfortunately it is not here. – Nicolas Mar 9 '12 at 14:36

This is a question that frequently appears in SF. This happens because your machine thinks it should deliver mail locally instead of delivering it to Gmail. For a solution to this see for example this answer in a previous similar question at SF.

share|improve this answer
As Jason said in his comment, I do not have any of the sections you're talking about; are you sure your code is applicable as it is in – Nicolas Mar 9 '12 at 14:29
Yes I am sure. If you are afraid, backup and just add them to the bottom of the file. Then see if something breaks. If it does (it won't) copy back the previous! – adamo Mar 9 '12 at 18:24
I tried and this is not working, here are several messages from my mail.log: SYSERR(root): buildaddr: no user || mailer=relay, pri=34062, relay=[] [], dsn=5.3.5, stat=Service unavailable || DSN: Service unavailable. I don't know if any of this would help... – Nicolas Mar 12 '12 at 9:39
It means that you have not properly and entirely copied the rule to your file. As the "bat book" says If a triple is missing the address part (the $:), the following error is produced: 554 5.3.5 buildaddr: no user (page 697). – adamo Mar 12 '12 at 11:42

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