Not receiving certain admin e-mails

I don’t know how the e-mails were originally setup to send, it always worked as part of the original install.

I’m wondering if there is a config I could restore from backup or should I just do a full on backup and reload?

There is no real config on that: cron generates an email for any output on stderr and stdout.

Ok, so now I’m curious what happened that I am not getting those emails any more.

1 Like

Is it possible to repair or reinstall cron to see if the e-mails start generating?

Actually /etc/crontab is empty as far as jobs go. But that hasn’t changed since June 9th 2014

You can disable cron mailing in /etc/sysconfig/crond, see this link.
To compare, my /etc/sysconfig/crond:

# Settings for the CRON daemon.
# CRONDARGS= :  any extra command-line startup arguments for crond
CRONDARGS=

I don’t think it’s about the cron package but you may try:

yum reinstall cronie

I will check that thanks.

So, I checked that config and CRONDARGS is empty I’m going to try and reinstall cronie.

I reinstalled cronie and still not getting those e-mails. Any other suggestions?

Are the cronjobs being processed? Do you see current ones in /var/log/cron?

Found a cron troubleshooting guide:

https://cronitor.io/docs/cron-troubleshooting-guide

1 Like

I know the cron jobs are processing, because backups are happening and a couple. Below is the most recent cron entries.

Jan 30 17:47:01 sektor CROND[26020]: (sogo) CMD (/usr/sbin/sogo-ealarms-notify > /dev/null 2>&1)
Jan 30 17:48:01 sektor CROND[26037]: (sogo) CMD (/usr/sbin/sogo-ealarms-notify > /dev/null 2>&1)
Jan 30 17:49:01 sektor CROND[26087]: (sogo) CMD (/usr/sbin/sogo-ealarms-notify > /dev/null 2>&1)
Jan 30 17:50:01 sektor CROND[26169]: (sogo) CMD (/usr/sbin/sogo-ealarms-notify > /dev/null 2>&1)

Your log example shows a cronjob where mailing is disabled, see here.
Please post a cron job from the log where you expect to get a mail but don’t get one.

As regards the backup mail, let’s check the config:

config show backup-data

For missing “Yum: Updates installed on” mails please post the yum-cron config:

config show yum-cron

2 Likes

here is backup-data

backup-data=configuration
BackupTime=02:00
CleanupOlderThan=364D
FullDay=0
IncludeLogs=enabled
NFSHost=
NFSShare=/mnt/usb-backup
Notify=always
NotifyFrom=
NotifyTo=root@localhost
Program=duplicity
SMBHost=
SMBLogin=
SMBPassword=
SMBShare=
Type=incremental
USBLabel=
VFSType=nfs
VolSize=250
WebDAVLogin=
WebDAVPassword=
WebDAVUrl=
status=enabled

yum-cron
yum-cron=service
applyUpdate=no
customMail=
download=yes
messages=yes
randomWait=360
status=enabled

Here is an entry that says e-mail

Dec 31 02:00:01 sektor CROND[7242]: (root) CMD (/sbin/e-smith/backup-data-wrapp$

Any other thoughts on what might have happened? I’m wondering if it would be worth my time to do a backup and reload of the whole os?

a possible test could be:

# dummy cronjob
echo '* * * * * root /usr/bin/echo "tuxy"' >> /etc/crontab

# (optional) monitor cron jobs, cancel once cronjob executed
tail -f /var/log/cron

# after cronjob ran (a minute), search for e-mail
grep -r tuxy /var/lib/nethserver/vmail/root/Maildir/ /var/spool/mail/root

After the test, remove the dummy cronjob from crontab.

1 Like

I have tested now on my server applying my settings like your configuration and email are delivered correctly.
Could you check if email are in your queue or not?

And in your /var/log/maillog you should see something like this (my emails to root@ are stored in admin@ and it is the only difference)

Feb 11 00:44:58 mail postfix/pickup[29588]: 221372011925F: uid=0 from=<root>

Feb 11 00:44:58 mail postfix/cleanup[1326]: 221372011925F: message-id=<20190210234458.221372011925F@mail.domain.it>

Feb 11 00:44:58 mail opendkim[4336]: 221372011925F: no signing table match for 'root@mail.domain.it'

Feb 11 00:44:58 mail postfix/qmgr[4989]: 221372011925F: from=<root@mail.domain.it>, size=1481, nrcpt=1 (queue active)

Feb 11 00:44:58 mail postfix/cleanup[1326]: 33B4B2015D5BC: message-id=<20190210234458.221372011925F@mail.domain.it>

Feb 11 00:44:58 mail postfix/local[1330]: 221372011925F: to=<root@localhost.domain.it>, orig_to=<root@localhost>, relay=local, delay=0.25, delays=0.21/0.01/0/0.04, dsn=2.0.0, status=sent (forwarded as 33B4B2015D5BC)

Feb 11 00:44:58 mail postfix/qmgr[4989]: 33B4B2015D5BC: from=<root@mail.domain.it>, size=1628, nrcpt=1 (queue active)

Feb 11 00:44:58 mail postfix/qmgr[4989]: 221372011925F: removed

Feb 11 00:44:58 mail dovecot: lmtp(1332): Connect from local

Feb 11 00:44:58 mail dovecot: lmtp(admin@domain.it): iCF0D3q3YFw0BQAAD+y26w: sieve: msgid=<20190210234458.221372011925F@mail.domain.it>: stored mail into mailbox 'INBOX'

Feb 11 00:44:58 mail postfix/lmtp[1331]: 33B4B2015D5BC: to=<admin@domain.it>, orig_to=<root@localhost>, relay=mail.domain.it[/var/run/dovecot/lmtp], delay=0.15, delays=0.04/0.01/0.01/0.1, dsn=2.0.0, status=sent (250 2.0.0 <admin@domain.it> iCF0D3q3YFw0BQAAD+y26w Saved)

Feb 11 00:44:58 mail dovecot: lmtp(1332): Disconnect from local: Successful quit

Feb 11 00:44:58 mail postfix/qmgr[4989]: 33B4B2015D5BC: removed
1 Like

I have checked that, but I can’t find anything unusual, nothing stuck in the queue.

I will double check a little later.

I will try that.

Ok here is what I am seeing

Feb 11 13:19:01 sektor crond[18247]: (system) RELOAD (/etc/crontab)
Feb 11 13:19:01 sektor CROND[20529]: (root) CMD (/usr/bin/echo “tuxy”)
Feb 11 13:19:01 sektor CROND[20528]: (sogo) CMD (/usr/sbin/sogo-ealarms-notify > /dev/null 2>&1)
Feb 11 13:20:01 sektor CROND[20563]: (root) CMD (/usr/bin/echo “tuxy”)
Feb 11 13:20:01 sektor CROND[20565]: (sogo) CMD (/usr/sbin/sogo-ealarms-notify > /dev/null 2>&1)

E-mail
[root@sektor ~]# grep -r tuxy /var/lib/nethserver/vmail/root/Maildir /var/spool/mail/root
/var/lib/nethserver/vmail/root/Maildir/cur/1549909201.M391971P20540.sektor.pbfamily.net,S=971,W=997:2,:Subject: Cron root@sektor /usr/bin/echo “tuxy”
/var/lib/nethserver/vmail/root/Maildir/cur/1549909201.M391971P20540.sektor.pbfamily.net,S=971,W=997:2,:tuxy
/var/lib/nethserver/vmail/root/Maildir/cur/1549909142.M118740P20540.sektor.pbfamily.net,S=971,W=997:2,:Subject: Cron root@sektor /usr/bin/echo “tuxy”
/var/lib/nethserver/vmail/root/Maildir/cur/1549909142.M118740P20540.sektor.pbfamily.net,S=971,W=997:2,:tuxy
/var/lib/nethserver/vmail/root/Maildir/cur/1549909261.M451385P20540.sektor.pbfamily.net,S=971,W=997:2,:Subject: Cron root@sektor /usr/bin/echo “tuxy”
/var/lib/nethserver/vmail/root/Maildir/cur/1549909261.M451385P20540.sektor.pbfamily.net,S=971,W=997:2,:tuxy
/var/lib/nethserver/vmail/root/Maildir/new/1549909321.M676877P20540.sektor.pbfamily.net,S=971,W=997:Subject: Cron root@sektor /usr/bin/echo “tuxy”
/var/lib/nethserver/vmail/root/Maildir/new/1549909321.M676877P20540.sektor.pbfamily.net,S=971,W=997:tuxy
Binary file /var/lib/nethserver/vmail/root/Maildir/dovecot.index.cache matches
grep: /var/spool/mail/root: No such file or directory

And I am seeing those e-mails, so what happened with the rest of my cron jobs?