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 ...
# Grab the message
my @msg = grep( $i || /^\s*$/ && $i++, <>);
splice @msg,0,1 while ( $msg =~ /^(>From |SPAM:|\s*$)/ );
# strip the spamassassin markup
my $spamass = Mail::SpamAssassin->new();
my $mail = Mail::SpamAssassin::NoMailAudit->new(
data => \@msg,
add_From_line => 0
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