[Infrastructures] email to root?
Will Lowe
harpo@thebackrow.net
Mon, 21 Mar 2005 11:56:50 -0800
> Finally, we do fix any tendencies of "spamming" from our cron jobs,
This is important -- it's considered a bug in our environment for a
cron job to produce output other than in a dire emergency.
But if you have any sizeable number of hosts you've got to have some
sort of configurable, automated way to filter this stuff -- a cron job
running every 5 minutes will render your inbox unuseable if it's
running on 1000 machines.
We do it by aliasing root to a dedicated account on our corporate mail
server and having a Perl script that pulls it out via POP3 (Exchange,
<sigh>), discards anything stupid (e.g. Debian's "sysstat" package
produces spam every time it rolls logs) and mails the rest on to
someone who can do something about it. A key part of this setup is
that someone is tasked with teaching the Perl script to ignore new
useless messages when they start to show up.
(As a side note, it'd be intersting to see if running it all through
spamassasin and training the bayesian filters would be faster than
writing new cases in Perl).
If you've got a lot of servers you should discuss this approach with
whoever runs your corporate mail server -- when something's broke, our
cron email is easily the largest consumer of resources on the mail
server. Or set up your own mail server for this, in which case you
can use something other than Exchange and can use something like
procmail to do the filtering.
--
Will