I've written a script that emails me some information using ssmtp
from an Ubuntu server. It works fine when I run it as root, but it fails when it's run with root's crontab.
I can see this error in the logs: Unable to set From="me@example.com"
This is my ssmtp.conf:
UseSTARTTLS=YES
root=me@example.com
mailhub=smtp.example.com:587
From=me@example.com
FromLineOverride=NO
rewriteDomain=example.com
AuthUser=me@example.com
AuthPass=xxxxxxxxxxx
AuthMethod=LOGIN
And revaliases:
root:me@example.com
Can someone help me understand what's different when I run it myself and when it's run by crontab, and how I can fix this problem?
Thanks in advance for the help!