--- qmail-scanner-queue.template.original Wed Jul 2 22:47:38 2003 +++ qmail-scanner-queue.template Wed Jul 2 23:34:10 2003 @@ -340,6 +340,7 @@ my ($alarm_status,$elapsed_time,$msg_size,$file_desc); my ($description,$quarantine_description,$illegal_mime); +my $startqmailscanner=1; &working_copy; @@ -371,8 +372,20 @@ $headers{'RCPTTO'}=$recips; $headers{'TCPREMOTEIP'}=$remote_smtp_ip; + # Get the list of domains we want to enable Q-S + my $qmailscannerdomainsfile = "/var/qmail/control/qmailscannerdomains"; + if( -e $qmailscannerdomainsfile ) { + $startqmailscanner = 0; + open (DC, $qmailscannerdomainsfile); + while () { + chomp; + if( $recips =~ /\@$_$/ ) { $startqmailscanner=1; last } + } + close (DC); + } + #Now, start the scanners! - if (!$quarantine_event) { + if (!$quarantine_event && $startqmailscanner) { &init_scanners; } if ($quarantine_event) { @@ -850,11 +863,13 @@ $elapsed_time = tv_interval ($start_time, [gettimeofday]); $findate = POSIX::strftime( "%d %b ",$sec,$min,$hour,$mday,$mon,$year); $findate .= sprintf "%02d %02d:%02d:%02d -0000", $year+1900, $hour, $min, $sec; - print QMQ "Received: from $returnpath by $hostname by uid $uid with qmail-scanner-$VERSION \n"; - print QMQ " ($SCANINFO Clear:$tag_score. \n"; - print QMQ " Processed in $elapsed_time secs); $findate\n"; - print QMQ "X-Spam-Status: $sa_comment\n" if ($sa_comment ne ""); - if ( $descriptive_hdrs ) { + if( $startqmailscanner ) { + print QMQ "Received: from $returnpath by $hostname by uid $uid with qmail-scanner-$VERSION \n"; + print QMQ " ($SCANINFO Clear:$tag_score. \n"; + print QMQ " Processed in $elapsed_time secs); $findate\n"; + print QMQ "X-Spam-Status: $sa_comment\n" if ($sa_comment ne ""); + } + if ( $descriptive_hdrs && $startqmailscanner ) { print QMQ "${V_HEADER}-Mail-From: $returnpath via $hostname\n"; print QMQ "${V_HEADER}-Rcpt-To: $recips\n" if ($descriptive_hdrs eq "2"); print QMQ "$V_HEADER: $VERSION (Clear:$tag_score. Processed in $elapsed_time secs)\n";