diff -urP qmail-scanner-1.13.orig/configure qmail-scanner-1.13/configure
--- qmail-scanner-1.13.orig/configure	Sun Jun 30 23:57:21 2002
+++ qmail-scanner-1.13/configure	Tue Jul 30 19:07:02 2002
@@ -28,7 +28,7 @@
 VERSION=`grep '^# Version: ' qmail-scanner-queue.template`
 VERSION=`echo $VERSION|awk '{print $NF}'`
 
-SUPPORTED_SCANNERS="sweep,sophie,vscan,trophie,uvscan,csav,antivir,kavscanner,AvpLinux,kavdaemon,AvpDaemonClient,fsav,fprot,inocucmd,ravlin,clamscan,verbose_spamassassin,fast_spamassassin"
+SUPPORTED_SCANNERS="bdc,sweep,sophie,vscan,trophie,uvscan,csav,antivir,kavscanner,AvpLinux,kavdaemon,AvpDaemonClient,fsav,fprot,inocucmd,ravlin,clamscan,verbose_spamassassin,fast_spamassassin"
 
 SILENT_VIRUSES="klez"
 
@@ -656,6 +656,16 @@
 	   fi
 	fi
     fi
+    if test -x $dir/bdc
+    then
+	if [ "`echo $FIND_SCANNERS|grep ' bdc '`" != "" ]; then
+	   if [ "`$dir/bdc  --tempdir=$PWD --arc --mail --nowarn $TMP_DIR 2>&1|grep -i test`" != "" ]; then
+	      BDC_BINARY="${BDC:-$dir/bdc}"
+	      INSTALLED_SCANNERS="$INSTALLED_SCANNERS
+bdc"
+	   fi
+	fi
+    fi
     if [ "`echo $FIND_SCANNERS|grep spamassassin`" != "" ]; then
     if test -x $dir/spamassassin
     then
@@ -1077,6 +1087,11 @@
     SCANNER_ARRAY="$SCANNER_ARRAY,\"clamscan_scanner\""
 fi
 
+if [ "$BDC_BINARY" != "" ]; then
+    echo "bdc=$BDC_BINARY";
+    SCANNER_ARRAY="$SCANNER_ARRAY,\"bdc_scanner\""
+fi
+
 
 if [ "$SPAMC_BINARY" != "" ]; then
     if [ "$SPAMASSASSIN_VERSION" = "fast_spamassassin" ]; then
@@ -1251,6 +1266,7 @@
 s?INOCUCMD?$INOCUCMD?g;
 s?RAVLIN?$RAVLIN?g;
 s?CLAMSCAN?$CLAMSCAN?g;
+s?BDC_BINARY?$BDC_BINARY?g;
 s?SPAMASSASSIN_BINARY?$SPAMASSASSIN_BINARY?g;
 s?SPAMC_BINARY?$SPAMC_BINARY?g;
 s?SPAMC_OPTIONS?$SPAMC_OPTIONS?g;
diff -urP qmail-scanner-1.13.orig/qmail-scanner-queue.template qmail-scanner-1.13/qmail-scanner-queue.template
--- qmail-scanner-1.13.orig/qmail-scanner-queue.template	Mon Jul 22 00:34:22 2002
+++ qmail-scanner-1.13/qmail-scanner-queue.template	Tue Jul 30 19:07:02 2002
@@ -187,6 +187,7 @@
 my $inocucmd_binary='INOCUCMD';
 my $ravlin_binary='RAVLIN';
 my $clamscan_binary='CLAMSCAN';
+my $bdc_binary='BDC_BINARY';
 my $spamc_binary='SPAMC_BINARY';
 my $spamc_options='SPAMC_OPTIONS';
 my $spamc_subject='SPAMC_SUBJECT';
@@ -968,7 +969,7 @@
 sub scan_queue {
   my ($scanner,$SCANINFO,$files,$sweep_eng,$sweep_product,$dir);
   my $start_scan_time =time;
-  my ($inocucmd_eng,$inocucmd_product,$spamassassin_eng);
+  my ($inocucmd_eng,$inocucmd_product,$bdc_ver,$bdc_core,$spamassassin_eng);
   
   chdir($scandir);
   &debug("s_q: re-create the quarantine version file");
@@ -1122,6 +1123,18 @@
 	}
       }
       close(CLAMS);
+    } elsif ($scanner eq "bdc") {
+      open(BDCOP,"$bdc_binary --info|")||die "failed to call $bdc_binary --info - $!";
+      while (<BDCOP>) {
+	chomp;
+        if (/BDC(.*)v([0-9\.]+)/) {
+          $bdc_ver=$2;
+        } elsif (/CORE v([0-9\.]+)/) {
+          $bdc_core=$1;
+        }
+      }
+      $SCANINFO .= "bdc: $bdc_ver/$bdc_core. ";
+      close(BDCOP);
     } elsif ($scanner eq "spamassassin") {
       #X-Spam-Checker-Version: SpamAssassin 2.01
       open(SPAS,"$spamassassin_binary  -V |")||die "failed to call $spamassassin_binary -V - $!";
diff -urP qmail-scanner-1.13.orig/sub-bdc.pl qmail-scanner-1.13/sub-bdc.pl
--- qmail-scanner-1.13.orig/sub-bdc.pl	Thu Jan  1 01:00:00 1970
+++ qmail-scanner-1.13/sub-bdc.pl	Tue Jul 30 18:58:58 2002
@@ -0,0 +1,29 @@
+sub bdc_scanner {
+  #Bitdefender scanner
+    my($start_bdc_time)=[gettimeofday];
+    my ($DD,$bdc_status,$bdc_time,$stop_bdc_time);
+    my $OK_CHARS='-a-zA-Z0-9_.@\n\s\/\:';
+
+    &debug("bdc: starting scan of directory \"$scandir/$file_id\"...");
+    &debug("run  $bdc_binary --arc --mail --nowarn  $scandir/$file_id  2>&1");
+    $DD=`$bdc_binary  --arc --mail --nowarn  $scandir/$file_id   2>&1`;
+    $bdc_status=($? >> 8);
+    $DD =~ s/\[\d(\;\d+)+m//go;
+    $DD =~ s/[^$OK_CHARS]//go;
+    &debug("--output of Bitdefender bdc was:\n$DD--");
+    if ($DD =~ /infected: (.*)/s) {
+	$quarantine_description=$1;
+	my @quar_desc=split(/\n/, $quarantine_description);
+	$quarantine_description=$quar_desc[0];
+	&debug("bdc_scanner: There be a virus! ($quarantine_description)");
+	($quarantine_event=$quarantine_description)=~s/\s/_/g;
+	$quarantine_event="BDC:".substr($quarantine_event,0,$QE_LEN);
+	$description .= "\n---BDC results ---\n$DD";
+    } elsif ($bdc_status > 0) {
+	&debug("bdc_scanner: Whoops! Something went wrong - requeue");
+	&tempfail("corrupt or unknown Bdc scanner/resource problems - exit status $bdc_status");
+    }
+    $stop_bdc_time=[gettimeofday];
+    $bdc_time = tv_interval ($start_bdc_time, $stop_bdc_time);
+    &debug("bdc: finished scan of dir \"$scandir/$file_id\" in $bdc_time secs");
+}
