*** qmail-scanner-1.01/qmail-scanner-queue.template     Thu Sep  6 23:12:20 2001
--- qmail-scanner-1.01-pattched/qmail-scanner-queue.template_with_spam  Wed Nov 21 15:58:32 2001
***************
*** 155,160 ****
--- 155,168 ----
  my $uudecode_binary='UUDECODE_BINARY';
  my $uudecode_pipe='UUDECODE_PIPE';

+ #Kobe SpamAssasin Hack - if $spamcheck is 1 then spamcheck is done
+ my $spamcheck = 1; #Enabled
+ #my $spamcheck = 0; #Disabled
+ my $spamc='/var/qmail/tools/spamc -f ';
+ #These strings will be regexpd against the recieps var
+ my $spam_rec = 'kobe@immovision.be, info@immovision.be, publinet.be, moerman.com';
+ #End of part 1 of 2 of the SpamAssasin hack
+
  #my ($uvscan_binary,$sweep_binary=$iscan_binary=$hbedv_binary=$avpdaemon_binary) ='';
  #my ($avp_binary=$fsecure_binary=$inocucmd_binary)='';

***************
*** 325,331 ****
      &email_quarantine_report;
    } else {
      &qmail_smtpd_check;
!  &qmail_requeue($env_returnpath,$env_recips,"$scandir/$wmaildir/new/$file_id");
    }
    alarm 0;
  };
--- 333,364 ----
      &email_quarantine_report;
    } else {
      &qmail_smtpd_check;
!     #Mail passed all virus check, now do a spam check
!     if ($spamcheck == 1) {
!         my @spamusers = split(',',$spam_rec);
!         my $spam_var;
!         my $spam_flag = 0;
!         foreach $spam_var (@spamusers) {
!                 $spam_var =~ s/ //mgi;
!                 debug("Spamuser: -".$spam_var."-");
!                 my $spamaddr = ($recips =~ /.*($spam_var).*/mi);
!                 debug("Find?: $spamaddr");
!                 if ($spamaddr == 1) {
!                         $spam_flag = 1;
!                         last;
!                 }
!         }
!         &debug("Recieps: $recips");
!         if ($spam_flag == 1) {
!                 &debug("Now checking message for spam");
!                 &debug("Executing: $spamc < $scandir/$wmaildir/new/$file_id > $scandir/$wmaildir/tmp/$file_id");
!                 system ("$spamc < $scandir/$wmaildir/new/$file_id > $scandir/$wmaildir/tmp/$file_id");
!                 rename ("$scandir/$wmaildir/tmp/$file_id","$scandir/$wmaildir/new/$file_id");
!         } else {
!                 &debug("Message NOT scanned for spam");
!         }
!      }
!
&qmail_requeue($env_returnpath,$env_recips,"$scandir/$wmaildir/new/$file_id");
    }
    alarm 0;
  };



