[You have mail in /var/spool/mail/root] Over 23K messages in 16 Days

When in telnet or ssh into one of my FreePBX servers, I see the following message “You have mail in /var/spool/mail/root”.

Checking my mail reveals that I have over 12,000 new messages.

Heirloom Mail version 12.4 7/29/08. Type ? for help.
/var/spool/mail/root": 12800 messages 12800 new
N 1 Cron Daemon Fri Apr 17 17:56 30/1054 “Cron root@BedfordPBX /usr/sbin/s”
N 2 Cron Daemon Fri Apr 17 17:57 30/1054 “Cron root@BedfordPBX /usr/sbin/s”
N 3 Cron Daemon Fri Apr 17 18:00 30/1054 “Cron root@BedfordPBX /usr/sbin/s”

The messages are being sent every minute and have the following body:

To: [email protected]
Subject: Cron root@BedfordPBX /usr/sbin/sysadmin_update_system -a
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <LANG=en_US.UTF-8>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
Date: Fri, 17 Apr 2015 17:56:13 -0400 (EDT)
Status: R

Array
(
[status] => error
[data] => SimpleXMLElement Object
(
[0] => This system is up to date.
)

)

I assume there’s a cron job running to check for updates every minute. Is this normal? I also assume sending an email every minute probably isn’t normal. What’s the best way to handle this?

Thanks – Steve

A week later and I’m up to over 23,000 messages. Anyone have any ideas?

I don’t see this on my systems, make sure all of your modules are up to date.

It would be interesting to hear how you installed your system.

I was mostly up to date–just updated all modules and the problem persists. There’s a new email every minute.

Installed using the 64 bit FreePBX Distro approx. 6-7 weeks ago.

Do you have sysadmin Pro licensed. It appears you do and that you have auto updates set for every minute so it keeps checking for updates.

I do have Sysadmin Pro. Updates are set for Monthly and I have never touched the setting.

Just for kicks I decided to change to weekly update. So far, no emails in 10 minutes. VERY strange. I’ll let it run like this until tomorrow and switch it back to monthly.

Thanks – Steve

They underlying situation is that if a cron job generates ANY output, then that output will be sent to the email address as set by the MAILTO variable in your crontab setup.

Be that once a minute or once a week. It will presumably re-appear every week or month until the cron job runs quietly, if it is not running quietly for whatever reason, that needs to be fixed unless there is in fact an error running the job or a reason to notify you . That’s just the way it has always worked.

To debug, Identify your cron job exactly as cron runs it, and run it in the cron shell, which is by default /bin/sh, by the user that owns the cron job, if it generates an output, then that is exactly what will be sent to the MAILTO variable whenever it runs.

Yep, the problem persists. It’s just not as bad now that it’s not running every minute.

Here’s what happens when I run it manually:

[root@BedfordPBX ~]# /usr/sbin/sysadmin_update_system -a
Array
(
    [status] => error
    [data] => SimpleXMLElement Object
        (
            [0] => This system is up to date.
        )

)
[root@BedfordPBX ~]#

I had this exact problem … Cron messages in the same format every minute. Fresh install from a distribution that had been updated to 10.13.66-16.

My auto update was disabled but I still received the messages. When I changed auto update to YES and monthly, the messaged stopped. Then I turned auto update back OFF and still no messages.

Just for clarity, there is no option to check for updates every minute.

I’m guessing that turning it off then back on updated the database to allow the auto update service to function as expected.