I have my crontab configured to mail to a specific address, for example purposes lets say "test@test.com". test.com is also the host name of my box, however I have my mx email records configured externally to point at gmail domain. All emails work fine going to test.com and I log into there no problem.

However with crontab and I'm assuming other processes it sends the email locally, again assuming it thinks it should be accepting all emails going to test.com .

Suggestions on how to fix this without breaking outgoing emails sending from the test.com address?

Updated, the mail server is sendmail here is the config file: http://pastebin.com/4sSApB1y

  • Which MTA do you have installed? What's the configuration?
    – mgorven
    Feb 21, 2013 at 19:38
  • updated with info Feb 21, 2013 at 19:45
  • try to monitor /var/log/mail.log and verify that cron is sending to test@test.com. It is hard to believe that you local smtp forwards all mails to the right destination but not the messages from cron. Feb 21, 2013 at 20:10
  • I never said that Tim, if I try to mail -s "Test" test@test.com it goes locally as well. Feb 21, 2013 at 20:51
  • See serverfault.com/questions/344105/…
    – adamo
    Feb 22, 2013 at 7:35

2 Answers 2


If you don't want mail send to test.com not to be delivered locally, then remove the domain from the sendmail config file. It is usually under /etc/mail/sendmail.mc with the option name LOCAL_DOMAIN(test.com). Comment that out with dnl at the beginning of the line. If you can't find test.com in that file, search it using grep in /etc/mail and remove it if is there to set local delivery of that domain.

  • Commented out and restarted sendmail to no effect. Feb 22, 2013 at 20:51

Rename the computer. Anything that's not test.com would be sufficient. After all, this computer almost certainly isn't. Perhaps chief.test.com or cortana.test.com?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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