Server Fault is a question and answer site for system and network administrators. 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

I was using the following mail command in my crontab to which worked flawlessly until we re installed our mail server last Friday:

echo "Testing 123" | mail -s "ECS PostDate Processed" "" -- -r "" -F "ServerCronJobs"

previously the "--" would rout the command line parameters to sendmail to send from a name and add a reply-to address. Now it seems the -- is being ignored and all of the extra parameters are being treated as email addresses. so the email is going to:

from root <>
to me, chrish, -r, noreply, -F, ServerCronJobs

What is missing now?

share|improve this question
What's the new and old version of the OS? You probably simply aren't running the same 'mail' command. Check man mail for the options. – freiheit May 14 '13 at 22:01

You probably got a different version of the "mail" command with the OS upgrade, and it doesn't have the same options.

Why not just use sendmail directly, instead? That's a standardized command that unix MTAs always emulate, and is designed well for scripted usage:

  echo "Subject: ECS PostDate Processed"
  echo "To:,"
  echo "Reply-To:"
  echo "From: ServerCronJobs <>"
  echo "Testing 123"
) | /usr/sbin/sendmail -oi -t

That can be done ( echo ; echo ; echo ) | sendmail style instead to fit on one line.

Or, if it is all just echo instead of a command somewhere in that pipe, replace with a 'here document':

/usr/sbin/sendmail -oi -t <<EOT
Subject: ECS PostDate Processed
From: ServerCronJobs <>

Testing 123

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.