Great Circle Associates Majordomo-Users
(April 2002)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: [SAtalk] question re. reporting spam to razor
From: Theo Van Dinter <felicity @ kluge . net>
Date: Tue, 9 Apr 2002 14:39:26 -0400
To: Miles Fidelman <mfidelman @ ntcorp . com>
Cc: spamassassin-talk @ lists . sourceforge . net,Majordomo-users @ greatcircle . com
In-reply-to: <Pine.GSO.4.31.0204091344200.11285-100000@sun10101.dn.net>; from mfidelman@ntcorp.com on Tue, Apr 09, 2002 at 01:55:26PM -0400
References: <Pine.GSO.4.31.0204091344200.11285-100000@sun10101.dn.net>
User-agent: Mutt/1.2.5.1i

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



Follow-Ups:
References:
Indexed By Date Previous: question re. reporting spam to razor
From: Miles Fidelman <mfidelman@ntcorp.com>
Next: Re: [SAtalk] question re. reporting spam to razor
From: Miles Fidelman <mfidelman@ntcorp.com>
Indexed By Thread Previous: question re. reporting spam to razor
From: Miles Fidelman <mfidelman@ntcorp.com>
Next: Re: [SAtalk] question re. reporting spam to razor
From: Miles Fidelman <mfidelman@ntcorp.com>

Google
 
Search Internet Search www.greatcircle.com