> I am looking for an easy way for my spamassassin to relearn messages
> marked as spam that users would like to get.  Would it be
> safe and avoid
> bayesian poisoning if I were to setup an email box such as
> [EMAIL PROTECTED] and have users forward nonspam emails to this email
> address and then learn it as ham?

There was a script posted a while back as an example of how you could
detach "forward as attachment" messages into a folder for learning. I
don't remember the author, but I'm reposting the script since it could
be useful here.

WARNING: lines may wrap
_________________________

#!/usr/bin/perl

use strict;
use warnings;

my @message = <STDIN>;
my $path = "/tmp/spam/";

use Mail::SpamAssassin::Message;
use Data::UUID;

my $msg = Mail::SpamAssassin::Message->new(
     {
       'message' => [EMAIL PROTECTED],
     }
) || die "Message error?";

foreach my $p ($msg->find_parts(qr/^message\b/i, 0)) {
     eval {
            no warnings ;
            my $type = $p->{'type'};
            my $ug = new Data::UUID;
            my $uuid1 = $ug->create_str();
            my $attachname = $path . $uuid1 . ".eml";
            open OUT, ">", "$attachname" || die "Can't write file
$attachname:$!";
            binmode OUT;
            print OUT $p->decode();
     };
}
__END__
________________________________



Reply via email to