E-mail notifications granularity
-
Is there a way to control what things are being sent by e-mail notification?
I'd like to get things like VPN being down, or package or OS updates being available, but don't want my inbox cluttered by the output of every single cron run…Ideas? Did I miss something somewhere?
-
I'm pretty much getting swamped by cron reports, so I had to disable e-mail notifications again.
What, besides cron, is sending out SMTP/e-mail notifications?
Anyway to get cron to shut up?Unfortunately, at this point, this whole thing is so verbose as to be useless.
-
Getting exactly zero cron emails. If you are getting swamped, you usually have a broken cron entry.
-
Redirect your cron jobs into a black hole. eg: "x * * * * /path/to/my/script > /dev/null 2>&1". That will prevent your cron jobs from issuing emails.
If anything else is sending out emails other than cron, you'll have to provide more information before anyone can help much with that.
-
I think maybe the bigger issue I have is this: I don't seem to find documented what I should even expect to result in an e-mail notification.
e.g. will the availability of a package update result in an e-mail?
will a suspected DDoS attack trigger an email notification?Obviously, I can modify my cron entries to dump to /dev/null but my expectation would have been that only non-routine events would trigger a notification, and a cron script running on schedule hardly qualifies as non-routine.
In essence what I would ideally picture is a settings page sort of like the one for XMLRPC sync, where one can tick checkmarks indicating what sort of things one wants to be notified of by means of e-mail notifications.
-
Also, I forgot to say that, there seems to be a bug: even after I checked the "Disable SMTP Notifications" box on the System:Advanced:Notifications page, I still get the cron e-mail reports.
I seems that as soon as valid configuration data is present, the reports are being sent, regardless of the "Disable SMTP Notification" setting.
-
Also, I forgot to say that, there seems to be a bug: even after I checked the "Disable SMTP Notifications" box on the System:Advanced:Notifications page, I still get the cron e-mail reports.
I seems that as soon as valid configuration data is present, the reports are being sent, regardless of the "Disable SMTP Notification" setting.
The only place I can see in the code where it sends a notification while notifications are disabled, is the "Test SMTP" button - which is supposed to ignore the disabled state.
Can you give examples of the "cron" notifications you are getting?
Maybe it is a particular package that is calling notify_via_smtp() with the $force=true ? -
Getting exactly zero cron emails. If you are getting swamped, you usually have a broken cron entry.
well, one's a script to periodically delete a specific file should it be present, one that vhosts had a bad habit of creating (index.php). That cron entry I made myself, well before I set up SMTP notifications, so no /dev/null redirection
But another which is not my doing: an expiretable script from sshlockout…
...so chances are that package updates will reverse any changes i make to the script -
The issue with cron emails is a know one.
I wrote about it before - this is cron's default functionality to send email if any job produces stderr output.
The reason why not too many people are complaining is because default pfSense install does NOT have sendmail executable, so no emails are going out.
But the moment you install package like arpwatch - it will add sendmail link to special php script used by pfSense - cron will start spamming you (if there are jobs with output).
The best solution for this I found is to add this line to crontab file:MAILTO=""
Or you can redirect output of most annoying jobs to /dev/null if you are interested in output of some of them… up to you.
-
Also, I forgot to say that, there seems to be a bug: even after I checked the "Disable SMTP Notifications" box on the System:Advanced:Notifications page, I still get the cron e-mail reports.
I seems that as soon as valid configuration data is present, the reports are being sent, regardless of the "Disable SMTP Notification" setting.
The only place I can see in the code where it sends a notification while notifications are disabled, is the "Test SMTP" button - which is supposed to ignore the disabled state.
Can you give examples of the "cron" notifications you are getting?
Maybe it is a particular package that is calling notify_via_smtp() with the $force=true ?Just had a simple cron entry like /bin/rm somefile, so no package involved, other than the cron entry editor package, with which I created that cron entry.
The other script is exipring sshlockout tables, but I didn't make that script. -
The issue with cron emails is a know one.
I wrote about it before - this is cron's default functionality to send email if any job produces stderr output.
The reason why not too many people are complaining is because default pfSense install does NOT have sendmail executable, so no emails are going out.
But the moment you install package like arpwatch - it will add sendmail link to special php script used by pfSense - cron will start spamming you (if there are jobs with output).
The best solution for this I found is to add this line to crontab file:MAILTO=""
Or you can redirect output of most annoying jobs to /dev/null if you are interested in output of some of them… up to you.
I'll try that, hope editing cron with the cron editor package won't bounce it out of the file…