diff -uar qmail-scanner-1.15.orig/configure qmail-scanner-1.15/configure
--- qmail-scanner-1.15.orig/configure	Wed Oct 30 00:44:37 2002
+++ qmail-scanner-1.15/configure	Fri Nov 15 10:22:50 2002
@@ -107,6 +107,7 @@
         --fix-mime) FIX_MIME=1 ; if [ "$2" != "" -a "`echo $2|grep '\-'`" = "" ] ; then  shift ; if [ "`echo $1|egrep -i '^1|^yes'`" = "" ]; then FIX_MIME="1" ; fi ;  if [ "`echo $1|egrep -i '^0|^no'`" != "" ]; then FIX_MIME="0" ; fi ; fi ;;
 	--no-QQ-check) MANUAL_INSTALL="1";;
 	--qmail-queue-binary) if [ "$2" != "" ] ; then  shift ; fi ; QMAILQUEUE_BIN="$1" ;;
+        --mime-unpacker) if [ "$2" != "" ] ; then  shift ; fi ; MIME_UNPACKER="$1" ;;
 	--install) INSTALLIT="1" ; if [ "$2" != "" -a "`echo $2|grep '\-'`" = "" ] ; then  shift ; fi ;;
         *) cat <<EOF >&2
  invalid option: $1
@@ -189,6 +190,7 @@
                           by default to help perlscanner.
   --install               Create directory paths, install perl script,
                           and change ownerships to match.
+  --mime-unpacker "reformime|ripmime"        Defaults to reformime. Allow ripmime.
 
        ****************
          Rarely Used
@@ -297,6 +299,28 @@
 
 PATH="$PATH:$QMAILDIR/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/etc/iscan:/usr/local/uvscan:/usr/lib/AntiVir:/usr/lib/uvscan:/usr/local/av:/opt/AV:/opt/AVP:/usr/local/f-prot:/usr/local/rav8/bin" export PATH
 
+if [ "$MIME_UNPACKER" != "" ]; then
+	if [ "`echo $MIME_UNPACKER |egrep -v '^(reformime|ripmime)$'`" != "" ]; then
+	    cat<<EOF
+
+
+                *************************
+
+Sorry, but your "--mime-unpacker" definition contains invalid options. 
+
+The only valid options are:
+
+reformime
+ripmime
+
+               **************************
+EOF
+	    exit
+	fi
+else
+	MIME_UNPACKER="reformime"
+fi
+
 NOTIFY_ADDRESSES="`echo $NOTIFY_ADDRESSES|sed -e 's/\"//g'  -e 's/ //g'`"
 
 if [ "$NOTIFY_ADDRESSES" = "all" ]; then
@@ -411,14 +435,15 @@
 	STRINGS="${STRINGS:-$dir/strings}"
     fi
 
+if [ "$MIME_UNPACKER" = "reformime" ]; then
     if test -x $dir/reformime
     then
-	REFORMIME_BINARY="${REFORMIME_BINARY:-$dir/reformime}"
+	UNMIME_BINARY="${UNMIME_BINARY:-$dir/reformime}"
         DD=`reformime -s1.2 -xTEST- < ./contrib/reformime-test.eml`
 	if [ "`grep hello TEST-hello.txt`" = "" ]; then
 	   echo "** FATAL ERROR ***"
 	   echo ""
-	   echo "$REFORMIME_BINARY contains bugs. Please upgrade to a release"
+	   echo "$UNMIME_BINARY contains bugs. Please upgrade to a release"
 	   echo "that post-dates Mar 22 2002 (e.g. 1.3.8)"
 	   echo ""
 	   rm -f TEST-hello.txt
@@ -430,19 +455,6 @@
     then
 	MAILDROP_BINARY="${MAILDROP_BINARY:-$dir/maildrop}"
     fi    
-    if test -x $dir/unzip
-    then
-	UNZIP_BINARY="${UNZIP_BINARY:-$dir/unzip}"
-	#Now check for password support
-	touch file.zip
-	DD=`unzip -Pxxxxx file.zip 2>&1|grep '^Archive:'`
-	if [ "$DD" != "" ]; then
-	 UNZIP_OPTIONS="-Pxxxxx"
-	else
-	 UNZIP_OPTIONS=""
-	fi
-	rm -f file.zip
-    fi    
     if test -x $dir/tnef
     then
 	TNEF_BINARY="${TNEF_BINARY:-$dir/tnef}"
@@ -462,7 +474,38 @@
 	    exit 1
 	fi
 	LANG=$OLD_LANG export LANG
+    fi
+fi
+if [ "$MIME_UNPACKER" = "ripmime" ]; then
+    if test -x $dir/ripmime
+    then
+	UNMIME_BINARY="${UNMIME_BINARY:-$dir/ripmime}"
+        DD=`ripmime -i - < ./contrib/reformime-test.eml`
+	if [ "`grep hello hello.txt`" = "" ]; then
+	   echo "** FATAL ERROR ***"
+	   echo ""
+	   echo "$UNMIME_BINARY contains bugs. Please upgrade to a newer release."
+	   echo ""
+	   rm -f hello.txt textfile*
+	   exit 1
+	fi
+	rm -f hello.txt textfile*
+    fi
+fi
+    if test -x $dir/unzip
+    then
+	UNZIP_BINARY="${UNZIP_BINARY:-$dir/unzip}"
+	#Now check for password support
+	touch file.zip
+	DD=`unzip -Pxxx file.zip 2>&1|grep '^Archive:'`
+	if [ "$DD" != "" ]; then
+	 UNZIP_OPTIONS="-Pxxxxx"
+	else
+	 UNZIP_OPTIONS=""
+	fi
+	rm -f file.zip
     fi    
+    
     if test -x $dir/uvscan 
     then
 	if [ "`echo $FIND_SCANNERS|grep ' uvscan '`" != "" ]; then
@@ -867,7 +910,7 @@
     exit
 fi
 
-
+if [ "$MIME_UNPACKER" = "reformime" ]; then
 #Check version of maildrop to ensure it's not the buggy version
 
 DD="`$MAILDROP_BINARY -v 2>&1|grep '^maildrop'|grep '1\.0'`"
@@ -888,6 +931,7 @@
 EOF
     exit
 fi
+fi
 
 #Find out if their uudecoder is supported
 if [ "$UUDECODE_BINARY" != "" ]; then
@@ -974,7 +1018,8 @@
      LOCAL_DOMAINS_ARRAY="`echo $LDA|sed 's/^,//g'`"
 fi
 
-if [ "$REFORMIME_BINARY" = "" ]
+if [ "$MIME_UNPACKER" = "reformime" ]; then
+if [ "$UNMIME_BINARY" = "" ]
 then
     cat<<EOF
 
@@ -991,7 +1036,7 @@
 EOF
     exit
 fi
-
+fi
 if [ "$UNZIP_BINARY" = "" ]; then
     cat<<EOF
 
@@ -1022,10 +1067,10 @@
 echo "
 The following binaries and scanners were found on your system:
 "
-if [ "$REFORMIME_BINARY" != "" ]
+if [ "$UNMIME_BINARY" != "" ]
 then 
-    echo "reformime=$REFORMIME_BINARY"
-    MIMEUNPACKER="$REFORMIME_BINARY "
+    echo "mimeunpacker=$UNMIME_BINARY"
+    MIMEUNPACKER="$UNMIME_BINARY "
 fi
 if [ "$UUDECODE_BINARY" != "" ] 
 then
@@ -1251,7 +1296,7 @@
  
 . ./.locale_vars
 
-perl -p -e "s?REFORMIME_BINARY?$REFORMIME_BINARY?g;
+perl -p -e "s?UNMIME_BINARY?$UNMIME_BINARY?g;
 s?PERLRELEASE_DETAILS?$PERLRELEASE_DETAILS?g;
 s?HOST_OS?$HOST_OS?g;
 s?HOST_RELEASE?$HOST_RELEASE?g;
diff -uar qmail-scanner-1.15.orig/qmail-scanner-queue.template qmail-scanner-1.15/qmail-scanner-queue.template
--- qmail-scanner-1.15.orig/qmail-scanner-queue.template	Tue Oct 15 13:34:04 2002
+++ qmail-scanner-1.15/qmail-scanner-queue.template	Fri Nov 15 10:24:21 2002
@@ -290,6 +290,8 @@
 
 if ($mimeunpacker_binary =~ /reformime/) {
   $mimeunpacker_binary .= " -x$scandir/$file_id/";
+} elsif ($mimeunpacker_binary =~ /ripmime/) {
+   $mimeunpacker_binary .= " --syslog_on --stderr_off -i - -d $scandir/$file_id/";
 }
 
   
@@ -566,12 +568,12 @@
   my ($new_filename,$MAYBETNEF,$tnef_status);
 
   &debug("d_m: starting $mimeunpacker_binary <$scandir/$wmaildir/new/$file_id [",&deltatime,"]");
-  open(MIME,"$mimeunpacker_binary  <$scandir/$wmaildir/new/$file_id|")||&tempfail("cannot call mimeunpacker - $!");
+  open(MIME,"$mimeunpacker_binary  <$scandir/$wmaildir/new/$file_id|")||&tempfail("cannot call $mimeunpacker_binary - $!");
   while (<MIME>) {
     next if (/exists\./);
-    &tempfail("d_m: output spotted from reformime - that shouldn't happen!");
+    &tempfail("d_m: output spotted from $mimeunpacker_binary - that shouldn't happen!");
   }
-  close(MIME)||&tempfail("cannot close mimeunpacker - $!");
+  close(MIME)||&tempfail("cannot close $mimeunpacker_binary - $!");
   my $unpacker='';
   
   opendir(DIR,"$scandir/$file_id/")||&tempfail("cannot open dir $scandir/$file_id/ - $!"); 
@@ -712,12 +714,14 @@
   #append any ORIGINAL uuencoded filenames to this directory array
   #so that perlscanner can match on uuencoded filenames
   foreach $file (@allfiles,@uufile_list,@zipfile_list) {
-    #skip files that reformime generates.
+    #skip files that reformime/ripmime generates.
     #This will potentially allow baddies to smuggle files through
     #by using filenames like this... Nothing can be done about that:-(
     #Reformime generates filenames of the form:
     # 967067231.24320-X.host.name (where X is a number)
-    if ($file =~ /^[0-9]+\.[0-9]+\-[0-9]+\.|^$file_id/) {
+    #Ripmime generates filenames of the form:
+    # textfileX (where X is a number)
+    if ($file =~ /^[0-9]+\.[0-9]+\-[0-9]+\.|^$file_id|^textfile[0-9]+/) {
       &debug("p_s: skipping auto-generated file $file");
       $ps_skipfile=1;
     } else {
