Score:0

Why does Cron Daemon send sendmail test messages on Ubuntu?

in flag

Since this morning I am receiving every 20 minutes a message from my Ubuntu Server that look like this:

Subject:

Cron <smmsp@fx> test -x /etc/init.d/sendmail && test -x /usr/share/sendmail/sendmail && test -x /usr/lib/sm.bin/sendmail 

The sender of the message is Cron Daemon <root@domain..>

The message contains 4 entries like this:

timeout writing message to [127.0.0.1]

The cronjob /etc/cron.d/sendmail contains this entry:

# Every so often, give sendmail a chance to run the MSP queues.
#
*/20 *    *    *    *           smmsp   test -x /etc/init.d/sendmail && test -x /usr/share/sendmail/sendmail && test -x /usr/lib/sm.bin/sendmail && /usr/share/sendmail/sendmail cron-msp

This came out of nowhere as the server is unchanged for a long time now. What could be the reason for this?

Score:1
mp flag

Cron executes scheduled commands at given intervals. It's configured via crontab (e.g. crontab -e to edit the current users scheduled commands).

By default cron will automatically email the output of any cron jobs - any results of STDERR (standard errors) or STDOUT (standard output) will be emailed unless those outputs are redirected.

So it looks like you have a cron job scheduled every 20 minutes which is failing with the error timeout writing message to [127.0.0.1].

You need to either edit your cron and remove the job or if it's still required then diagnose why it's giving the error and remedy it. Your email subject is showing the cron command that is failing but it's truncated so I can't see what it's doing or why it is failing.

merlin avatar
in flag
there seems not to be a cronjob owned by this user: sudo crontab -e -u smmsp no crontab for smmsp - using an empty one. I will update the subject line
merlin avatar
in flag
I found the cronjob and edited the question. Now I am wondering if I should simply outcomment this line, but I fear that there is a reason why this mail is sent and that something is wrong.
codlord avatar
mp flag
I don't think you have posted the full line of the cron job? As it ends `&& /usr/share/sen$` so we still can't see the entire line. But given the comment in the crontab `...give sendmail a chance to run the MSP queues.` I am guessing it's some sort of job to flush mail queues. The `test -x` elements of the command are just checking for the existence of executable files. So the command is saying: `IF /etc/init.d/sendmail exists AND /usr/share/sendmail/sendmail exists AND /usr/lib/sm.bin/sendmail exists THEN execute /usr/share/sen...`
codlord avatar
mp flag
o.k. so I now see the full command and it seems this is something some versions of sendmail automatically add to cron under some circumstances. I would have a read here as well as the other ubuntuforums link on the thread: https://stackoverflow.com/questions/5056940/strange-emails-from-cronjob-no-such-file-or-directory
merlin avatar
in flag
Thank you for the help and hints. I was able to fix this by removing old mails from the client-mqueue folder: rm /var/spool/mqueue-client/*
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.