cron doesn't send mail
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ecryptfs-utils |
New
|
Undecided
|
Unassigned | ||
postfix (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: cron
I have this as a test script called test_cron
_______________
#! /bin/bash
#
#if ! type promptYesNo > /dev/null 2>&1 ; then . /home/woodnt/
FILE=/tmp/cron.log
TIME=`date -d now "+%m-%d-%y@%H%M%S"`
if [ ! -f $FILE ] ; then
touch $FILE
fi
echo "Hello at $TIME from test_cron" |tee -a $FILE
_______________
From the last line, one can see that that there is output.
It is trying to send mail as can be seen here:
_______________
root 29138 0.0 0.0 18708 988 ? Ss 23:00 0:00 cron
root 29166 0.0 0.0 91236 2192 ? S 23:01 0:00 \_ CRON
root 29167 0.0 0.0 91244 1300 ? S 23:01 0:00 | \_ CRON
woodnt 29168 0.0 0.0 0 0 ? Zs 23:01 0:00 | \_ [sh] <defunct>
woodnt 29193 0.0 0.0 37000 2100 ? S 23:01 0:00 | \_ /usr/sbin/sendmail -i -FCronDaemon -oem woodnt
woodnt 29194 0.0 0.0 36988 2096 ? S 23:01 0:00 | \_ /usr/sbin/postdrop -r
_______________
$ mail
No mail for woodnt
woodnt@
I have looked in /var/mail and it shows bupkis
woodnt@
[sudo] password for woodnt:
woodnt@
checking out /var/log/mail.log shows nothing being sent from cron. mail.err is empty. No evidence of cron sending anything in mail.info either.
This works:
woodnt@
woodnt@
Mail version 8.1.2 01/15/2001. Type ? for help.
"/var/mail/woodnt": 1 message 1 new
>N 1 woodnt@toshiba-la Wed Feb 10 23:10 13/437
&
So somewhere between cron sending the mail and it going through postfix something is going wrong.
I have bsd-mailx installed which of course also installs postfix as a depends.
I can't duplicate this problem on other systems.
Of note, I had installed ssmtp first for another reason, but uninstalled thinking it might have been the problem. A purge uninstall then reinstall of bsd-mailx didn't fix this. I am not sure if the culprit is ssmtp configuring something and not undoing it on purge or if the fault is in cron.
Thanks,
Narnie
Changed in postfix (Ubuntu): | |
status: | Incomplete → Invalid |
sorry. Forgot to show my crontab
woodnt@ toshiba- laptop /var/log $ crontab -l
MAILTO="woodnt" bin/test_ cron
#m h dom mon dow command
*/1 * * * * /home/woodnt/