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

[email protected] (Matt Simerson)
Newsgroups perl.qpsmtpd
Message-ID <[email protected]>
On Apr 22, 2012, at 11:46 PM, Robert Spier <[email protected]> wrote:

> On Sun, Apr 22, 2012 at 2:22 PM, Matt Simerson <[email protected]> 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?

No reason at all. I've changed it and pushed to github.

Matt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.