2

My server is Ubuntu 12.04.3 Cron jobs are working fine. I can send emails through command line, either using mail, ssmtp or sendmail. I have set the correct email address on top of the crontab -e

MAILTO=myemail@gmail.com

* * * * *  echo blaaah

But what I get in mail.log is

sSMTP[4267]: 550 5.7.1 Client does not have permissions to send as this sender

Which is strange as I am able to send email through command line. Any ideas?

  • cron does run as root, right? You can try adding root to the mail group, but it shouldn't be required. usermod -a -G mail root – Aurelia Nov 25 '13 at 16:55
7

I had a similar problem. The answer for me was actually quite simple.

The user/environment under which cron executes could not find the ssmtp binary. Simply by adding the full path to it achieved success.

# m     h       dom     mon     dow     command
0       9       *       *       *       /usr/sbin/ssmtp a@hotmail.com < /home/a/a-msg.txt
  • I am aware of this solution. But it is only a workaround. I preferred a solution that applied to the whole crontab – akarapatis Dec 3 '14 at 13:16
  • 1
    Been looking all over for this solution. – meanbunny Oct 24 '15 at 22:35
  • Hmm this didn't do anything for me. I assume the /usr/sbin/ssmtp a@hotmail.com < xyz xyz refers to the stdout of your command. I get a 550 error this way. Am I missing some steps? – E.S. Jul 4 '18 at 1:55
0

Maybe this helps: http://community.webfaction.com/questions/11800/how-do-i-set-the-sender-address-for-mail-sent-from-my-cron-jobs

Else more debug output or the exact circumstances would help. "crontab -e" edits the crontab of the current user. Are you sure this user is configured for sending mails?

http://linux.die.net/man/8/ssmtp

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.