cron no longer sending emails

Dear members,

I have a quick question - cron used to send emails when any cron tasks/script was executed but just noticed that since a few days emails are not coming when cron runs. I can still send mailx emails from shell scripts though. But cron run per se isnt sending mails anymore. The mails used to come from "Cron Daemon root@.members.linode.com".

Any pointers please?

Thanks and regards,

Anshuman

3 Replies

Did you change the entries in your crontab just before the emails stop coming through? How about your mail server settings?

I dont remember changing, but I noticed its been not sending emails since mid Sept, so not sure if I did do any upgrades.

I have some scripts which use mailx, if I run them manually they do send the email. So the mail system must be okay. However the emails which use to auto generate on cron runs have stopped. MAILTO variable is set properly too.

cat /etc/crontab

SHELL=/bin/bash

PATH=/sbin:/bin:/usr/sbin:/usr/bin

MAILTO=admin@mydomain.com

HOME=/

run-parts

01 * * * * root run-parts /etc/cron.hourly

02 4 * * * root run-parts /etc/cron.daily

22 4 * * 0 root run-parts /etc/cron.weekly

42 4 1 * * root run-parts /etc/cron.monthly

Any pointers will be much appreciated.

Updates can occassionally break things. Some package managers will replace existing configuration files with a default one, and will rename the original configuration before hand. Sometimes it's even a mistake in the code that was missed when they release.

Make sure everything is up-to-date, then search through the config files for your mail server to make sure it didn't rename/replace your config files. If you know the name of the config files you need to look at, the following command can speed things up:

updatedb && locate something.conf | grep etc

You'll need either mlocate or slocate installed to do that, though most systems have one of those installed by default.

Replace something.conf with the name of the config file. The "| grep" ([pipe character] grep) part will act as a filter for locate, and will only let the results show that have etc in them, which is useful for config files since most of them are in /etc.

Only look at the stuff for your mail server and cron. It's unlikely anything else will have broken cron's ability to send emails.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct