Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question
Which MTA do you have installed? What's the configuration? –  mgorven Feb 21 '13 at 19:38
updated with info –  Residual Envy Feb 21 '13 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. –  Tim Haegele Feb 21 '13 at 20:10
I never said that Tim, if I try to mail -s "Test" test@test.com it goes locally as well. –  Residual Envy Feb 21 '13 at 20:51
See serverfault.com/questions/344105/… –  adamo Feb 22 '13 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.

share|improve this answer
Commented out and restarted sendmail to no effect. –  Residual Envy Feb 22 '13 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?

share|improve this answer
haha I love it. The problem is Michael that I still want outgoing mail to come from test.com and renaming the computer something else appears to break that. –  Residual Envy Feb 22 '13 at 20:51
So, place your desired address in the From: field, like you do everywhere else. –  Michael Hampton Feb 23 '13 at 2:17

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.