Article View: news.software.nntp
Article #90954Re: Getting spamassassin and clamav as inn filters
From: Ray Banana
Date: Thu, 12 Oct 2023 05:44
Date: Thu, 12 Oct 2023 05:44
42 lines
2190 bytes
2190 bytes
* Gea-Suan Lin wrote:
> On 2023-10-09, The Doctor <doctor@doctor.nl2k.ab.ca> wrote:
>> Any recipes how?
>
> Yeah, I just implemented a simple hack within `cleanfeed.local`. Have
> tried, but not so useful. Still many spam into comp.lang.c and other
> groups.
[...]
> use Mail::SpamAssassin;
>
> my $sa_agent = Mail::SpamAssassin->new();
>
> sub local_filter_last {
> return unless $hdr{Path} =~ /google-groups\.googlegroups\.com/;
>
> 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 $mail = $sa_agent->parse($article_str);
> my $status = $sa_agent->check($mail);
>
> return reject("Reject Google Groups posting to $hdr{Newsgroups} by SpamAssassin") if $status->is_spam();
>
> $status->finish();
> $mail->finish();
>
> return;
> }
> ```
OK, now you need a ~/.spamassassin directory for your news user and a user_prefs
file in that directory. After that you can start adding rules for Usenet spam.
You will also need to feed several hundreds of spam and ham articles to sa-learn --spam
or sa-learn --ham as the news user. After that, SpamAssassin will gradually improve.
--
ΠΡΜΡΡΠ½ β Ρ
ΡΠΉΠ»ΠΎΜ
http://www.eternal-september.org
Technical Details
Message-ID:
<slrnuif1ts.29emv.rayban@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: <slrnuif1ts.29emv.rayban@raybanana.net> Subject: Re: Getting spamassassin and clamav as inn filters Date: Thu, 12 Oct 2023 05:44:28 +0000 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: 42 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 12 Oct 2023 05:44:28 -0000 (UTC) User-Agent: slrn/pre1.0.4-9 (Linux) Cancel-Lock: sha1:RHnK30vlAU1H7C+KhXT6MIYGIKU=