From: epg <> Date: Fri, 2 Sep 2005 22:51:13 +0000 (+0000) Subject: (filter_mail): Stop popping items from header lists and just read the X-Git-Url: https://diplodocus.org/git/minc/commitdiff_plain/8f8233983028c468814a8d64d2811c192d3582b0?ds=inline;hp=f53c8c7e8dd23a6ac4c23c6c190d9435f135e0db (filter_mail): Stop popping items from header lists and just read the last header value. Also get rid of control characters in the subject (stupid spam!). --- diff --git a/minc b/minc index f945781..ae72ed5 100755 --- 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) {