Super User is a question and answer site for computer enthusiasts and power users. 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

As a normal user I can send email, either from the commandline or from PHP. But when a cron job has error output, sending of that email fails (I have a at the top of the crontab). The same happens for sending from the commandline as root (*).

I've tracked this down to: when the emails work the From and Return Path headers are set to That domain is the one set in /etc/mail/, i.e. I have these three lines:

FEATURE(`allmasquerade') dnl

For the emails that fail, the From and Return Path headers are set to exists, but machinename has no DNS entry. Therefore the email gets refused with a 550. is the first entry in /etc/hosts for

I suspect changing /etc/hosts with might work but this is a production web server and I don't want to break anything else. It also feels like the wrong place to solve an email problem. So I'm hoping it is a sendmail or cron setting I need. (On another machine, ubuntu/postfix, I seem to have created /etc/postfix/sender_canonical to do this.)

OS: Centos 5.6

Mail Server: sendmail 8.13.8

*: but in that case the error correctly gets sent to, as I have set the alias for root in /etc/aliases. This doesn't happen with the cron emails though; those bounce emails get put in my local unix mailbox.

share|improve this question

You must log in to answer this question.

Browse other questions tagged .