diff -ur 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	Mon Jul 29 19:41:36 2002
@@ -101,6 +101,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
@@ -180,6 +181,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
@@ -285,6 +287,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
@@ -399,14 +423,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
@@ -414,23 +439,12 @@
 	fi
 	rm -f TEST-hello.txt
     fi    
+
     if test -x $dir/maildrop
     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 -Pxxx file.zip 2>&1|grep '^Archive:'`
-	if [ "$DD" != "" ]; then
-	 UNZIP_OPTIONS="-Pxxxxx"
-	else
-	 UNZIP_OPTIONS=""
-	fi
-	rm -f file.zip
-    fi    
+    fi
+
     if test -x $dir/tnef
     then
 	TNEF_BINARY="${TNEF_BINARY:-$dir/tnef}"
@@ -450,7 +464,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
@@ -836,7 +881,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'`"
@@ -857,6 +902,7 @@
 EOF
     exit
 fi
+fi
 
 #Find out if their uudecoder is supported
 if [ "$UUDECODE_BINARY" != "" ]; then
@@ -942,7 +988,8 @@
      LOCAL_DOMAINS_ARRAY="`echo $LDA|sed 's/^,//g'`"
 fi
 
-if [ "$REFORMIME_BINARY" = "" ]
+if [ "$MIME_UNPACKER" = "reformime" ]; then
+if [ "$UNMIME_BINARY" = "" ]
 then
     cat<<EOF
 
@@ -959,7 +1006,7 @@
 EOF
     exit
 fi
-
+fi
 if [ "$UNZIP_BINARY" = "" ]; then
     cat<<EOF
 
@@ -990,10 +1037,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
@@ -1215,7 +1262,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 -ur 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	Mon Jul 29 19:41:37 2002
@@ -289,6 +289,8 @@
 
 if ($mimeunpacker_binary =~ /reformime/) {
   $mimeunpacker_binary .= " -x$scandir/$file_id/";
+} elsif ($mimeunpacker_binary =~ /ripmime/) {
+   $mimeunpacker_binary .= " -i - -d $scandir/$file_id/";
 }
 
   
@@ -709,12 +711,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 {
