develooper Front page | perl.qpsmtpd | Postings from April 2012

Re: [PATCH] SpamAssassing plugin now saves results in a note

Thread Previous | Thread Next
From:
Robert Spier
Date:
April 22, 2012 23:46
Subject:
Re: [PATCH] SpamAssassing plugin now saves results in a note
Message ID:
CAAroffcULiOC+YhtrYF9tUVe3Ao2NLp-jPRR9QWnjb0nyDBPow@mail.gmail.com
On Sun, Apr 22, 2012 at 2:22 PM, Matt Simerson <matt@tnpi.net> wrote:

>
> ---
> plugins/spamassassin |    9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/plugins/spamassassin b/plugins/spamassassin
> index 4ca890e..534d712 100644
> --- a/plugins/spamassassin
> +++ b/plugins/spamassassin
> @@ -11,6 +11,9 @@ from the SpamAssassin package.  F<
> http://www.spamassassin.org>
>
> SpamAssassin 2.6 or newer is required.
>
> +Stores the results in a note named spamass (for other plugins). The note
> +format is 3 fields joined with a colon: is_spam:score:autolearn
> +
> =head1 CONFIG
>
> Configured in the plugins file without any parameters, the
> @@ -243,6 +246,12 @@ sub insert_spam_headers {
>            next;   # Mail::Header mangles this prefolded header
> #           $self->log(LOGDEBUG, $new_headers->{$name} );
>        };
> +        if ( $name eq 'X-Spam-Status' ) {
> +            my ( $is_spam,undef,$score,$autolearn ) =
> $new_headers->{$name}
> +                =~ /^(yes|no),
> (score|hits)=([\d\.\-]+)\s.*?autolearn=([\w]+)/i;
> +            $self->log(LOGINFO, "SA: $is_spam; $score; $autolearn");
> +            $transaction->notes('spamass', "$is_spam:$score:$autolearn");
>

As in the other change, 'spamass' is unnecessary abbreviated.  What's the
benefit over spamassassin?


> +        };
>        $new_headers->{$name} =~ s/\015//; # hack for outlook (still
> necessary?)
>        $self->_cleanup_spam_header($transaction, $name);
>        $transaction->header->add($name, $new_headers->{$name}, 0);
> --
> 1.7.9.6
>
>


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About