]> diplodocus.org Git - minc/commitdiff
Er, put in the rest of the @SPAM changes. Also make store_message
authorepg <>
Sat, 3 Apr 2004 05:12:44 +0000 (05:12 +0000)
committerepg <>
Sat, 3 Apr 2004 05:12:44 +0000 (05:12 +0000)
return the new message number.

minc

diff --git a/minc b/minc
index 8d8b6a35ac69d2a57c3d91223d5b71a6752649c9..2ef6a826d6c8e6fa395bce7c639a5aa0f2306a3e 100755 (executable)
--- a/minc
+++ b/minc
@@ -44,6 +44,10 @@ STDOUT->autoflush(1);
 my $MAGIC_TO_REGEX = '^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope |Apparently(-Resent)?)-To)';
 my $MAGIC_TO_TOKEN = ' TO';
 
 my $MAGIC_TO_REGEX = '^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope |Apparently(-Resent)?)-To)';
 my $MAGIC_TO_TOKEN = ' TO';
 
+# List of SPAM message numbers, scanned at the end so the user can
+# check for false positives.
+my @SPAM;
+
 =head1 OPTIONS
 
 =over 4
 =head1 OPTIONS
 
 =over 4
@@ -463,7 +467,9 @@ sub store_message {
         # fails.  While it is slow, it is not safe to store multiple
         # messages and then have a failure before marking some (or
         # all).
         # fails.  While it is slow, it is not safe to store multiple
         # messages and then have a failure before marking some (or
         # all).
-        if ($mhfolder ne 'SPAM') {
+        if ($mhfolder eq 'SPAM') {
+            push(@SPAM, $msgnum);
+        } else {
             $status = system('mark', "+$mhfolder", "$msgnum", '-sequence',
                              'unseen', '-add');
             if (not WIFEXITED($status)) {
             $status = system('mark', "+$mhfolder", "$msgnum", '-sequence',
                              'unseen', '-add');
             if (not WIFEXITED($status)) {
@@ -473,6 +479,8 @@ sub store_message {
             }
         }
     }
             }
         }
     }
+
+    return $msgnum;
 }
 
 # Parse a message file into a structure describing the headers.  The
 }
 
 # Parse a message file into a structure describing the headers.  The