Cron on qmail not sending me logs

Bob Hall rjhjr at cox.net
Tue Sep 2 12:51:59 PDT 2003


On Tue, Sep 02, 2003 at 02:27:16PM -0400, Ralph Dratman wrote:
> Gary,
> 
> Thank you for your reply. Your comments are informative but I still 
> don't know what to do!
> 
> For some reason, I am not receiving mail sent from cron to root. 
> Therefore, I cannot see any of my (rather important) daily cron logs.
> 
> I can send mail to root from anyplace else, either inside or outside 
> the box, and it arrives at the forwarded location (ralph at maxsoft.com, 
> an external domain).
> 
> Can you think what might be going wrong?

I didn't see your original post, so I don't know what info 
you gave about this. I can send mail to root from any crontab 
without problem. If you haven't done this already, try 
a couple of things:

Check the contents of /var/mail/root, to see if the mail is 
being sent there. If so, then cron is somehow bypassing the 
system that sends root mail to the external address.

Is the problem cron, or just this job? Try a second cron job that 
just sends mail to root. Something like
	MAILTO=root
	* * * * * "Test"
The MAILTO will cause every job in the crontab to send its output 
to root, so you probably don't want to leave it in there very long.
root should get an e-mail that says something like 
	Test: not found
If not, then the problem is proably in the mail delivery. In that 
case, I don't know the specifics of your mail delivery, but it works 
in all other cases, so cron apparently can't access it. Cron's PATH 
contains only "/bin:/usr/bin", or something similar. The shells you 
successfully email from have longer PATHs. Take the PATH value from 
a shell, and put it into your cron tab.
        MAILTO=root
	PATH=<shell PATH>
        * * * * * "Test"
If that works, then you need to figure out which part of the PATH you 
need to add to cron's PATH. For security reasons, you don't want to 
leave a crontab configured like that. It's best to put the expanded 
PATH and the job in a shell script, and have cron call the script.
Ordinarily, if cron lacks a path, you get a "permission denied" 
e-mail, but in this case you're not getting e-mails.

If the first test (no PATH) does work, then examine the output from 
the app cron is trying to run and see if there is any output for 
cron to send you.

Remember that I'm speculating about the cause of your problem. I 
have no idea if this will get you anywhere.

Bob Hall


More information about the freebsd-questions mailing list