Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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

Once upon a time there was a server. Lets call it zzz.com, running Ubuntu LTS 10. Then, domain owner decided to create his corporate mail via Google Apps, and created account username@zzz.com.

Everything looks to be fine with username@zzz.com. Mail is sent / received.

But there is one mysterious problem. When PHP script at zzz.com is trying to send some mail to [ANYNAME]@zzz.com, mail is not delivered. Sendmail works fine when trying to send mail anywhere else.

There is a non-delivery notification in this case in the mail log.

What could this be? How can this be fixed?

share|improve this question
up vote 2 down vote accepted

This sounds to be almost exactly the same issue than on ServerFault question titled Disable local delivery in sendmail.

The solution is to disable the local delivery of mail with the following steps:

  1. Open one of the sendmail's configuration files, /etc/mail/sendmail.mc, using any editor you want (I use vim as an example):

    vim /etc/mail/sendmail.mc
  2. Add the following lines to the end of the file:

    define(`MAIL_HUB', `zzz.com.')dnl
    define(`LOCAL_RELAY', `zzz.com.')dnl
  3. Configure sendmail:

    sudo sendmailconfig
  4. Restart the sendmail service:

    sudo /etc/init.d/sendmail restart


    service sendmail restart


share|improve this answer

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.