]> diplodocus.org Git - minc/commitdiff
(filter_mail): Stop popping items from header lists and just read the
authorepg <>
Fri, 2 Sep 2005 22:51:13 +0000 (22:51 +0000)
committerepg <>
Fri, 2 Sep 2005 22:51:13 +0000 (22:51 +0000)
last header value.  Also get rid of control characters in the subject
(stupid spam!).

minc

diff --git a/minc b/minc
index f9457810e20126f316eb34172b8b3380a13ab2dc..ae72ed59896ac192a5c86e0efa2101a2196d65c3 100755 (executable)
--- a/minc
+++ b/minc
@@ -582,14 +582,17 @@ sub filter_mail {
             $spam++;
         } else {
             $saved++;
+            my $from = [@{$headers{'from'}}]->[-1];
+            my $subject = [@{$headers{'subject'}}]->[-1];
+            $from =~ s/[[:cntrl:]]/?/g;
             print("\r");
             print(' ' x $COLUMNS);
             printf("\r\%-${nf}s \%${nm}d \%-${nF}s \%s\n",
                    substr($mhfolder, 0, $nf), substr($msgnum, 0, $nm),
                    # XXX shouldn't pop, as these are about to be
                    # passed to post_store_hooks
-                   substr(pop(@{$headers{'from'}}), 0, $nF),
-                   substr(pop(@{$headers{'subject'}}), 0, $ns))
+                   substr($from, 0, $nF),
+                   substr($subject, 0, $ns));
         }
 
         for my $hook (@post_store_hooks) {