RHEL8 system here. Outputs from /etc/cron.daily... produce the expected email output, but my user's own crontab doesn't. Here's a test that sums up my problem:
~$ crontab -l
MAILTO=dh
* * * * * echo "HERE"
~$ sudo tail /var/log/cron
[sudo] password for dh:
Nov 6 08:33:42 deham01lx013 crond[2177]: (dh) RELOAD (/var/spool/cron/dh)
Nov 6 08:34:01 deham01lx013 CROND[3503836]: (dh) CMDOUT (HERE)
Nov 6 08:34:13 deham01lx013 crontab[3503855]: (dh) LIST (dh)
FWIW, the mails from the root cron jobs are correctly mailed to "dh" via an alias in /etc/aliases. Also when I do ~$ echo "HELLO" | mail dh
, I get the mail. The cron daemon isn't running with any weird options, either:
~$ ps afx | grep cron
2177 ? Ss 0:12 /usr/sbin/crond -n
Any hints?
MAILTO=dh
make things better? The default is to mail any output to the owner of the schedule, so you should not need to specify an explicitMAILTO
address. I'm wondering if doing so is confusing something.MAILTO=root
work better? I guess you have a local sendmail (or any other MTA/MDA), what do its logs say?echo "HERE" 1>&2
instead of sdout. The cron log shows correct execution of the command, see original post.