I recently performed a MailScanner upgrade on a mail server that I maintain, and I noticed that afterwards I was receiving tons of messages from the MailScanner cron jobs that were running.
The messages didn't indicate any problems, just that things were running smoothly. While this is great information, I really only need to know when there is a problem so I can correct it. Anything else will just clutter my inbox or be filtered to the trash.
My initial thought was to just pipe the output to /dev/null and forget about it. However if I did this I would no longer receive emails alerting me of problems, which I need to get.
The three scripts that were causing a problem are check_mailscanner, update_phishing_sites, and update_bad_phishing_sites.
The check_mailscanner has an easy fix, and that is to just add a -q parameter to the cron entry that calls the script. This will suppress the positive output.
The other two scripts I had to manually edit. I commented out the line calling wget and modified the command to call curl to have the --silent and --show-error options.
Not sure this was the best way to fix the problem, but it has seemed to do the trick. Other suggestions are welcome.
update_phishing_sites
#wget http://www.mailscanner.info/phishing.safe.sites.conf.master || \
curl --silent --show-error -O http://www.mailscanner.info/phishing.safe.sites.conf.master || \
( logger -p mail.warn -t update.phishing.sites Cannot find wget or curl, update failed. ; echo Cannot find wget or curl to do phishing sites update. ; exit 1 )
update_bad_phishing_sites
#wget http://www.mailscanner.eu/phishing.bad.sites.conf.master || \
curl --silent --show-error -O http://www.mailscanner.eu/phishing.bad.sites.conf.master || \
( logger -p mail.warn -t update.phishing.sites Cannot find wget or curl, update failed. ; echo Cannot find wget or curl to do phishing bad sites update. ; exit 1 )
2 comments:
What operating system, distribution and version are you running?
Would a "-q" or similar help for the other scripts too?
--
Jules
MailScanner author
I'm running Ubuntu 6.06.2 LTS with MailScanner (4.68.8-1) from tar.gz.
Should have mentioned that in my post! D'oh!
IMHO it'd be great if all of the scripts had an option to suppress positive feedback. -q would have my vote.
Post a Comment