bin/125753: Cron Not Mailing Output

Schiz0 Schiz0phrenic21 at gmail.com
Fri Jul 18 15:50:01 UTC 2008


>Number:         125753
>Category:       bin
>Synopsis:       Cron Not Mailing Output
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 18 15:50:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Schiz0
>Release:        7.0-RELEASE-p2
>Organization:
>Environment:
FreeBSD youcant.tastetherainbow.ws 7.0-RELEASE-p2 FreeBSD 7.0-RELEASE-p2 #0: Wed Jun 25 16:14:45 EDT 2008     root at youcant.tastetherainbow.ws:/usr/obj/usr/src/sys/TTR  i386
>Description:
Cron is not emailing the output from commands, both in /etc/crontab and users crontabs. When a cronjob is run and output SHOULD be emailed, I get the following message in my /var/log/maillog:

Jul 18 15:35:00 youcant sendmail[48850]: m6IFZ0wX048850: from=User, size=0, class=0, nrcpts=0, msgid=<200807181535.m6IFZ0wX048850 at youcant.tastetherainbow.ws>, relay=User at localhost

So, for some reason, sendmail thinks the size=0 and that there are no recipients. I have no idea why this is happening.

This also happens when I run a shell script from cron (As opposed to the command in the crontab itself). The output from the script itself is not mailed, and I get the same message in maillog.

I am running sendmail from the base system, not from ports.

In my /etc/make.conf, I have:
CFLAGS=-O -pipe
>How-To-Repeat:
Put the following lines in /etc/crontab:

MAILTO="root"
*/5     *       *       *       *       root  echo "Hello!"
>Fix:
This isn't really a fix, but a work around. Pipe everything to /usr/bin/mail, such as the following:

*/5 * * * * root echo "Hello!" | /usr/bin/mail -s "Cron Output" email at address.tld

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list