--- spamcop.php	2003-03-27 05:02:12.000000000 +0100
+++ spamcop.php.olo	2003-12-25 16:55:42.000000000 +0100
@@ -34,7 +34,34 @@
         $subject = encodeHeader($message->rfc822_header->subject);
         array_shift($body_a);
         $body = implode('', $body_a) . "\r\n";
-                
+
+        # Begin removing any SpamAssassin headers so spammers don't get any hints:
+        $descriptorspec = array(
+                0 => array('pipe', 'r'),  // stdin is a pipe that the child will read from
+                1 => array('pipe', 'w'),  // stdout is a pipe that the child will write to
+                2 => array('file', '/dev/null', 'a') // stderr is a file to write to
+                );
+        # We need a special Perl script for this:
+        $process = proc_open('/usr/local/bin/remove_spamassassin_headers.pl', $descriptorspec, $pipes);
+        if (is_resource($process)) {
+            // $pipes now looks like this:
+            // 0 => writeable handle connected to child stdin
+            // 1 => readable handle connected to child stdout
+
+            fwrite($pipes[0], $body);
+            fclose($pipes[0]);
+            // Dispose of the old body and read the processed body with SpamAssassin headers removed:
+            $body = '';
+            while(!feof($pipes[1])) {
+                $body .= fgets($pipes[1], 1024);
+            }
+        }
+        fclose($pipes[1]);
+        // It is important that you close any pipes before calling
+        // proc_close in order to avoid a deadlock
+        $return_value = proc_close($process);
+        # That's all, SpamAssassin headers were removed (if present, of course)
+
         $localfilename = GenerateRandomString(32, 'FILE', 7);
         $full_localfilename = "$hashed_attachment_dir/$localfilename";
         $fp = fopen( $full_localfilename, 'w');
