clmilter_watch -q && /etc/init.d/clamav-milter condrestart
The script works by emulating the sendmail side of the milter connection. It submits an Eicar sample and interprets the response from clamav-milter. If the message is dropped/rejected/quarantined, then we have high confidence that the milter is working properly. On the other hand, if the message is accepted or there's a timeout (no reponse from the milter) then a return code can be used to automagically restart clamav-milter.
clmilter_watch is released under the University of Illinois/NCSA Open Source License, which is a BSD variant compatible with the GPL. You can download it at
http://www.itg.uiuc.edu/itg_software/clmilter_watch/
I've been using an early version of this script in production on two RedHat servers for the past month without any problems. However, I wrote the script by reverse-engineering the milter protocol, so it's possible that there could be issues if your setup is different from mine (thanks to Stephen Gran for Debian testing and patches). As such, please send any bug reports or feature requests (preferably with patches) to me at [EMAIL PROTECTED]
Damian Menscher -- -=#| Physics Grad Student & SysAdmin @ U Illinois Urbana-Champaign |#=- -=#| 488 LLP, 1110 W. Green St, Urbana, IL 61801 Ofc:(217)333-0038 |#=- -=#| 4602 Beckman, VMIL/MS, Imaging Technology Group:(217)244-3074 |#=- -=#| <[EMAIL PROTECTED]> www.uiuc.edu/~menscher/ Fax:(217)333-9819 |#=- -=#| The above opinions are not necessarily those of my employers. |#=- _______________________________________________ http://lurker.clamav.net/list/clamav-users.html