Any recipes how?
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;
}
```
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.
* 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.
Hi Gea-Suan Lin,
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.
FWIW, there's a doc in French to set up a "spamchk" funnel to
SpamAssassin in the newsfeeds file:
https://web.archive.org/web/20230901182332/https://git.alphanet.ch/gitweb/?p=inn-install;a=blob_plain;f=README.html;hb=HEAD#filtrer-le-spam-avec-spamassassin
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>
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:
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 307 |
Nodes: | 16 (2 / 14) |
Uptime: | 129:16:25 |
Calls: | 6,854 |
Files: | 12,360 |
Messages: | 5,417,847 |