Reloading MS service via email?

Julian Field mailscanner at ecs.soton.ac.uk
Tue Mar 23 20:30:27 GMT 2004


At 20:11 23/03/2004, you wrote:
>I've got my scripts pretty much ironed out so that a user can simply
>forward a spam message to an email address, have the spam email added to
>the blacklist and then sent a confirmation. What I'd like to also do is
>have the script reload the MailScanner service. Since this is being done
>via the user 'mail', can anyone give me some tips on the best way to
>accomplish this. So far I'm thinking of using SUDO to allow 'mail' to run
>'kill' and /etc/init.d/MailScanner? Is there a better and/or more secure way?

All you need to do in this case is kill -HUP the process group headed by
the main MailScanner process.
Something along the lines of
kill -HUP -`cat /var/run/MailScanner.pid`
so you don't need to kill it then wait then restart it.
--
Julian Field
www.MailScanner.info
Professional Support Services at www.MailScanner.biz
MailScanner thanks transtec Computers for their support
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654



More information about the MailScanner mailing list