On Tue, Apr 09, 2002 at 01:55:26PM -0400, Miles Fidelman wrote:
> - strip off both the spamassassin markup (easy - pipe through spamassassin
> -d), AND...

or tell SA to not filter majordomo bounce mails

> - remove the stuff that majordomo changes (headers, BOUNCE info, etc.)

majordomo doesn't actually change anything.  the bounce is essentially a new message 
with the old
message as the body.  so you could do something like this:

perl -nle 'next if (1../^\s*$/) or /^>From /; print;' < bounce > fresh

> So... has anybody already solved this problem - say by writing a script
> that does this all automagically?

I haven't tested this very much myself, but ...

#!/usr/bin/perl -w
$|++;
use strict;
use Mail::SpamAssassin;
use Mail::SpamAssassin::NoMailAudit;

# Grab the message
my $i=0;
my @msg = grep( $i || /^\s*$/ && $i++, <>);
splice @msg,0,1 while ( $msg[0] =~ /^(>From |SPAM:|\s*$)/ );

# strip the spamassassin markup
my $spamass = Mail::SpamAssassin->new();
my $mail    = Mail::SpamAssassin::NoMailAudit->new(
    data          => \@msg,
    add_From_line => 0
);

$spamass->report_as_spam($mail);
#print $spamass->remove_spamassassin_markup($mail);




To test, swap the comments on the last two lines.  It will print out
the message it would report.  If it looks good, set it back to the way
it is above and it'll report it.

-- 
Randomly Generated Tagline:
"If you want to waste food, throw a vegetable." - The Drew Carey Show

_______________________________________________________________

Sponsored by:
Looking for hip toys and fun scwag.  There is no better place
then the good friends at ThinkGeek. http://www.ThinkGeek.com/
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to