MailScanner stopping
Kevin Miller
Kevin_Miller at ci.juneau.ak.us
Tue Sep 12 23:12:09 IST 2006
Last week there was a thread about MailScanner ceasing to work. I was
seeing that behavior - it was running, but was all balled up. Turned
out that when 'MailScanner restart' was called that some sendmail
processes persisted past the $RESTART_DELAY time. This only appears to
happen on later MS servers. Not sure what changes to the init script
make the difference - my 4.48 server doesn't have a problem.
The pids that MailScanner creates all evaporate almost immediately; the
persistent sendmail processes are generally (as nearly as I can tell)
connections that smf-sav initiates. (smf-sav is sorta like
milter-sender and milter-ahead rolled into one.) I wasn't seeing the
problem until I installed it, but it's too nifty to get rid of even if
it's not as robust as the milters from Snertsoft.
It can take up to a minute or two for all the connections to expire.
I'm guessing the remote hosts are maybe doing greet-pause or graylisting
when I do the sender verification, which causes them to sit around for a
bit.
Anyway, my workaround was to introduce the following bit of code in
/etc/init.d/MailScanner so that the all the orphaned sendmail processes
are gone before trying to restart MailScanner.
restart)
$0 stop
# Initialize the test variable
Pidval=sendmail
;;
# Loop as long as there's a sendmail process
while [ "$Pidval" != "" ];
do
# Look for sendmail but ignore the grep
Pidval=`ps aux | grep sendmail | grep -v grep`
echo
echo $Pidval
sleep $RESTART_DELAY
done
$0 start
rc_status
;;
FWIW, I'm running on SUSE. Not sure if this will affect Postfix/Exim,
etc. I assume no responsibility if it breaks your server and all that.
<g>
Hope this helps others. Julian, et al., is free to use it in future
releases at their discretion...
...Kevin
--
Kevin Miller Registered Linux User No: 307357
CBJ MIS Dept. Network Systems Admin., Mail Admin.
155 South Seward Street ph: (907) 586-0242
Juneau, Alaska 99801 fax: (907 586-4500
More information about the MailScanner
mailing list