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 my crontab configured to mail to a specific address, for example purposes lets say "". 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 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 .

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

Updated, the mail server is sendmail here is the config file:

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 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" it goes locally as well. – Residual Envy Feb 21 '13 at 20:51
See… – adamo Feb 22 '13 at 7:35

If you don't want mail send to not to be delivered locally, then remove the domain from the sendmail config file. It is usually under /etc/mail/ with the option name LOCAL_DOMAIN( Comment that out with dnl at the beginning of the line. If you can't find 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 would be sufficient. After all, this computer almost certainly isn't. Perhaps or

share|improve this answer
haha I love it. The problem is Michael that I still want outgoing mail to come from 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.