How can I make crontab email me with the output of its jobs? I have MAILTO=redacted@yahoo.com.au
above the jobs, but it doesn't work.
I know I need to use something like Postfix or Sendmail but for the life of me I cannot find out how to achieve this. I've searched and searched for a simple guide on setting up Postfix but they're all insanely complicated and expect you to be setting up a whole server to send and receive email and to know all the terms (like, what is a domain name for outgoing emails?).
All I want to do is have crontab email me. Why is this so difficult??
Additional Info:
My crontab file looks like this:
MAILTO=redacted@yahoo.com.au
1 0 * * * ~/Desktop/toskymesh.sh
59 6 * * * ~/Desktop/tooptus.sh
0 3 * * * snapraid sync
More Additional Info:
The output of ps -ef | grep '[s]endmail'
root 6840 1370 0 10:26 ? 00:00:00 sendmail: MTA: accepting connections
I know for sure cron is working, but I'm testing the mail command with echo Test | mail -s Test redacted@yahoo.com.au
anyway.
hostname
as currently shown). This answer suggests that you can use default server certificates, but I found I did not need aTLS_CA_File=
line for sending via GMail. – Mark Berry May 11 '17 at 19:25sSMTP
says it's deprecated. UsemSMTP
instead – Mattwmaster58 May 19 '18 at 15:21FromLineOverride
toNO
in/etc/ssmtp/ssmtp.conf
. During debugging, it was also helpful to addDebug=YES
tossmtp.conf
- it resulted in more detailed information being logged to/var/log/mail.log
. – Jakub Kukul Jul 19 '20 at 15:33