Hi, happy scanners,

This is a little trick I use on my servers
to avoid process overload on
qmail-scanner-queue.pl/spamassassin/clamd :

in qmail-scanner-queue.pl ,I put a patch that
  count the number of processes of qscand user
and decide to avoid antivirus antispam processing
if there are already too many processes.
It is yours to decide how many is too many.

Ok, this is bad : it can let go some spams and virus through.
But it avoids freezing the system by process overloading.
I use this patch since one year.

You have been warned enough, here is the "thing" :

in qmail-scanner-queue.pl , around line 320 ,
(quarantine_DOS is an existing variable made for that)

if (! -d "$scandir/tmp") {
   mkdir("$scandir/tmp",0700) || &error_condition("cannot create
$scandir/tmp - $!");
}
my ($quarantine_event,$quarantine_event_tmp,$quarantine_DOS)=0;

# Guy Kastenbaum , 2005
if (`ps -u qscand|wc -l`>20)
{
   $quarantine_DOS="Process Overload DOS escape";
   &debug($quarantine_DOS);
}

my $file_id = &uniq_id();
#For security reasons, tighten the follow vars...


(TODO: my purpose is also to avoid it if the IP address is
 already authentified in tcp.smtp* ; this is another story)

Enjoy , Comment & FeedBack, Please

Guy



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Qmail-scanner-general mailing list
Qmail-scanner-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general

Reply via email to