Not receiving cron job emails after updating to Fedora 42

Since I have upgraded to Fedora 42, i haven’t been receiving any of my cron job emails.

I’m not entirely sure what may be causing it, but I suspect it may have something to do with sendmail not working like it used to.

I base this on a recent fix I did with Logwatch, where I had to change it from sendmail to sendmail.postfix in order to start receiving those messages again.

Is there a way I can update how cron sends email like I did with Logwatch?

2 Likes

In man 8 cron it lists the -m option to set the mail program.
As you can see from systemctl cat crond.service you can configure crond command line using the /etc/sysconfig/crond file.

Put something like this in /etc/sysconfig/crond

CRONDARGS="-m sendmail.postfix

then restart crond service should work.

When I added the line, I got the following error message when cron ran:

fatal: root(0): Recipient addresses must be specified on the command line or via the -t option

When I added the -t flag, restarting the service failed because it didn’t recognize it.

Check out this bug report:

Probably due to the elimination of /usr/sbin and they missed a link involving sendmail.

Also, here is what I wrote to the old fedora users mailing list:

Upgraded my home server/desktop machine yesterday and all seemed ok. When I checked this morning I discovered that output from overnight cron jobs had gone to the journal log rather than being emailed to me. Also logwatch had failed to run.

I quickly checked logwatch first by manually running the logwatch service and it complained that /usr/sbin/sendmail did not exist. In fact, sendmail was not even installed. The system uses postfix. Honestly, I don’t recall if it was installed previously or not. I got new hardware last summer and did a fresh install of Fedora 39 then and upgraded to 40, 41 and now 42.

In the following → indicates a symlink.

Checking my Fedora 41 backups, I see the following chain

/usr/sbin/sendmail → /etc/alternatives/mta →
/usr/sbin/sendmail.postfix (which is an executable file)

I do not know what package owns /usr/sbin/sendmail.postfix unless someone can tell me how to tell rpm to use a different rpm database than the default one.

Under Fedora 42/ there was no /usr/sbin/sendmail. However, there was a /usr/sbin/sendmail.postfix that was a symlink to
/usr/bin/sendmail.postfix.

I then installed sendmail. I tested logwatch again and it failed with the same error about a missing /usr/sbin/sendmail. I uninstalledd sendmail. This time logwatch worked because /usr/sbin/sendmail existed. The removal of sendmail left behind the following chain of symlinks:

/usr/sbin/sendmail → /etc/alternatives/mta →
/usr/sbin/sendmail.postfix → /usr/bin/sendmail.postfix

Apparently, removing sendmail left behind /usr/sbin/sendmail pointing to (eventually) /usr/bin/sendmail.postfix. /usr/bin/sendmail.postfix is owned by the postfix package. /usr/sbin/sendmail.postfix is not owned by any package. Probably created by the install/remove script for sendmail.

After all this in order to get cron to email output I just had to restart the crond service so it could see that /usr/sbin/sendmail now existed.

2 Likes

I am really upset that that worked, but it did!

Thank you so much!

Well maybe I misunderstood solution exactly, though had same problem as all my cron jobs stopped sending email, and all I had to do is

cd /usr/sbin
ln -s /etc/alternatives/mta  sendmail

no extra installations just create new link named sendmail to mta.

There is a special command to deal with the alternatives

alternatives --config mta
2 Likes

Thanks @vekruse ,but I didn’t see how could I make /usr/sbin/sendmail with alternatives command, just to switch between existing ones. Mail calls /usr/sbin/sendmail so new link is needed.

You are correct. The postfix package is not yet compatible with the /usr/bin and /usr/sbin merge.