This one time, at band camp, Ralph Seberry wrote:
>I don't like the way spamassassin rewrites messages (with false positives)
>so I turn it off, and use (instead of the snippet above):

INteresting... I just bound a key to unspam a message in mutt,

macro index U <pipe-message>~/bin/add_whitelist.pl<enter><delete-message>
"Unspam this message"

that pipes it through add_whitelist.pl:

#!/usr/bin/perl

# this script adds the from address to the spamassassin whitelist,
# pipes the message back through spamassassin to remove the SPAM
# markup, and then pipes it back into procmail so it will be filtered
# correctly.

# use to recover mail that has been marked as spam because you have
# friends who WRITE THEIR MAIL IN ALL CAPS AND USE HTML

use strict;
use warnings;

my @msg;
my $line;
my $whitefile = "/home/jaq/.spamassassin/user_prefs";

@msg = <STDIN>;

open OUT, ">>$whitefile"
    or die "couldn't open file $whitefile";

my ($from) = map /^From:.*[< ]([\w.-]+\@([\w.-]+\.)+\w+)>?/, @msg;

print OUT "whitelist_from $from\n" if ($from);
close OUT;

open SA, "|spamassassin -d -P | procmail" or die "couldn't open spamassassin";
print SA @msg;
close SA;

So, I periodically go through my spambox and recover mail from people who I
know aren't spammers, this script adds them to the spamassassin whitelist,
removes the spamassasin markup, and filters back into procmail to be
redelivered (this time as they're whitelisted, it should be delivered to the
correct mailbox)

-- 
[EMAIL PROTECTED]                           http://spacepants.org/jaq.gpg
 
Of course I use condoms! The smell of burning rubber really turns me on.
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to