Article View: news.software.nntp
Article #91521Re: Getting spamassassin and clamav as inn filters
From: Ray Banana
Date: Sun, 28 Jan 2024 10:22
Date: Sun, 28 Jan 2024 10:22
38 lines
2252 bytes
2252 bytes
Thus spake yamo' <yamo@beurdin.invalid>
[...]
> After some tests, I've adopted the technique from Gea-Suan Lin, it could
> be found here :
> <http://al.howardknight.net/?STYPE=msgid&MSGI=%3Cug7sh8%24pcc%241%40colo-sc-1.gslin.com%3E>
For performance reasons, especially if you receive a full text feed, I
would recommend to use spamd instead of starting spamassassin for every
article:
my %myhdr = %hdr;
delete $myhdr{__BODY__};
delete $myhdr{__LINES__};
my $header_str = join "\n", map { "$_: $hdr{$_}" } keys %myhdr;
my $article_str = "$header_str\n\n$hdr{__BODY__}";
my $spamtest = Mail::SpamAssassin::Client->new({
port => /spamd port/,
host => /spamd host/,
username => 'news'}); # Use ~news/.spamassassin/user_prefs
my $result = $spamtest->process($article_str);
$score = $result->{score};
INN::syslog('notice', $hdr{'Message-ID'} . " Score: $score, isspam: " . $result->{isspam} );
if ($result->{isspam} =~ 'True') {
[...] # local proceessing, nocemize etc.
return 'SPAM';
} else {
[...] # local processing
}
--
ΠΡΜΡΡΠ½ β Ρ
ΡΠΉΠ»ΠΎΜ
https://www.eternal-september.org
Technical Details
Message-ID:
<8m1qa1daf8.fsf@raybanana.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mailReferences:
<ug14cb$a9g$15@gallifrey.nk.ca> <ug7sh8$pcc$1@colo-sc-1.gslin.com>Show Full Headers
Complete Article Headers
Message-ID: <8m1qa1daf8.fsf@raybanana.net> Subject: Re: Getting spamassassin and clamav as inn filters Date: Sun, 28 Jan 2024 11:22:51 +0100 From: Ray Banana <rayban@raybanana.net> References: <ug14cb$a9g$15@gallifrey.nk.ca> <ug7sh8$pcc$1@colo-sc-1.gslin.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail Newsgroups: news.software.nntp Organization: A noiseless patient spider Lines: 38 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit User-Agent: Plonkenlights Cancel-Lock: sha1:qIN1XGj3HXhIzKon4sw1KZ/cdaE= X-Attribution: Ray Banana