Article View: news.software.nntp
Article #90957Re: Getting spamassassin and clamav as inn filters
From: Gea-Suan Lin
Date: Thu, 12 Oct 2023 09:00
Date: Thu, 12 Oct 2023 09:00
63 lines
3029 bytes
3029 bytes
Thanks for the information.
I added a setting into ~/.spamassassin/user_prefs for recognizing MIME
part:
#
bayes_token_sources all
Then I manually selected 200+ hams and 200+ spams from comp.lang.c, and
50+ spams from comp.lang.python as well as 200+ spams from sci.crypt.
Afterwards I sent all these hams/spams into sa-learn.
The result looks pretty good so far. Almost all new spams into
comp.lang.c were blocked by SpamAssassin.
I put my trained files here, so you may just reuse it:
https://newsfeed.hasname.com/files/usenet-spamassassin-20231012.tar.gz
Ray Banana <rayban@raybanana.net> wrote:
> * 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.
>
--
Resistance is futile.
https://blog.gslin.org/ & <gslin@gslin.org>
Technical Details
Message-ID:
<ug8cim$255$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-mailReferences:
<ug14cb$a9g$15@gallifrey.nk.ca> <ug7sh8$pcc$1@colo-sc-1.gslin.com> <slrnuif1ts.29emv.rayban@raybanana.net>Show Full Headers
Complete Article Headers
Message-ID: <ug8cim$255$1@colo-sc-1.gslin.com>
Subject: Re: Getting spamassassin and clamav as inn filters
Date: Thu, 12 Oct 2023 09:00:09 +0000
From: Gea-Suan Lin <gslin@gslin.org>
References: <ug14cb$a9g$15@gallifrey.nk.ca> <ug7sh8$pcc$1@colo-sc-1.gslin.com> <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-mail
Newsgroups: news.software.nntp
Organization: Hasname
Injection-Date: Thu, 12 Oct 2023 09:00:09 -0000 (UTC)
Injection-Info: colo-sc-1.gslin.com; posting-host="114-34-121-114.hinet-ip.hinet.net:114.34.121.114"; logging-data="2213"; mail-complaints-to="usenet@colo-sc-1.gslin.com"
User-Agent: tin/2.6.2-20220130 ("Convalmore") (Linux/5.15.0-86-generic (x86_64))