Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Try `stty 0' -- it works much better.


computers / news.software.nntp / Re: [PATCH]: SLRN: include Injection headers in new score.

SubjectAuthor
* [PATCH]: SLRN: include Injection headers in new score.Kaz Kylheku
+* Re: [PATCH]: SLRN: include Injection headers in new score.Matthew Ernisse
|`- Re: [PATCH]: SLRN: include Injection headers in new score.Kaz Kylheku
`- Re: [PATCH]: SLRN: include Injection headers in new score.Kaz Kylheku

1
[PATCH]: SLRN: include Injection headers in new score.

<20230828125422.870@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=2066&group=news.software.nntp#2066

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-4973@kylheku.com (Kaz Kylheku)
Newsgroups: news.software.nntp
Subject: [PATCH]: SLRN: include Injection headers in new score.
Date: Mon, 28 Aug 2023 19:57:35 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 97
Message-ID: <20230828125422.870@kylheku.com>
Injection-Date: Mon, 28 Aug 2023 19:57:35 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="10c6d898fd3a93281822b96d674293f3";
logging-data="1943710"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+raa4vvHgwQ4TQ8H8G/RsCU8rxfW5IcZ0="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:hHmc3Xoz/6kS18NlTsGgDtdnMm0=
 by: Kaz Kylheku - Mon, 28 Aug 2023 19:57 UTC

This patch affects editing of the score file. Usenet suffers from a lot
of Google Groups spam, and it is often identified well through the
Injection*: headers. These headers are not propagated to the score
file, so I've had to manually copy and paste, which is annoying.

This change makes slrn scan through the list of additional headers and
pick out anything that starts with "Injection" or contains
"Posting-Host". (Note that I'm not seeing the NNTP-Posting-Host header
show up in the list, but if that is fixed, it will be included.)

I sent the patch upstream to J.E.D.

From c84453f2def8f78721d4f31166c1e75568a2fd90 Mon Sep 17 00:00:00 2001
From: Kaz Kylheku <kaz@kylheku.com>
Date: Mon, 28 Aug 2023 00:01:05 -0700
Subject: [PATCH 2/2] Include Injection headers when editing scores.

Google Groups posts contain headers that are useful in
filtering, identifying the account and IP address.
SLRN should propagate these to the score file to make
it easier to make use of them.

* src/editscore.c (slrn_edit_score):Walk the additional
headers in h->add_hdrs. If the name of any header starts
with "Inject" or contain "Posting-Host", then include it.
---
src/editscore.c | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)

diff --git a/src/editscore.c b/src/editscore.c
index 5c7d2df..ba1d022 100644
--- a/src/editscore.c
+++ b/src/editscore.c
@@ -186,6 +186,8 @@ int slrn_edit_score (Slrn_Header_Type *h, char *newsgroup)
if (Slrn_Prefix_Arg_Ptr == NULL)
{
+ Slrn_Header_Line_Type *ah_iter;
+ char *line;
int comment;
linenum = 1;
@@ -292,6 +294,47 @@ int slrn_edit_score (Slrn_Header_Type *h, char *newsgroup)
fprintf (fp, "%%\tNewsgroup: %s\n", q);
}
+
+ for (ah_iter = h->add_hdrs; ah_iter != NULL; ah_iter = ah_iter->next)
+ {
+ char *value = ah_iter->value;
+ char *name = ah_iter->name;
+ + if (name == NULL || value == NULL)
+ continue;
+ + if (strncmp(name, "Inject", 6) != 0 &&
+ strstr(name, "Posting-Host") == 0)
+ continue;
+ + line = slrn_safe_strmalloc (value);
+ remove_linebreaks (line);
+ if ((NULL == (q = SLregexp_quote_string (line, qregexp, sizeof (qregexp)))) ||
+ (ch != 'f') ||
+#if SLANG_VERSION < 20000
+ (0 != SLang_regexp_compile (&re))
+#else
+ (NULL == (re = SLregexp_compile (qregexp, SLREGEXP_CASELESS)))
+#endif
+ )
+ {
+ re_error |= (ch == 'f');
+ comment = 1;
+ }
+ else
+ comment = 0;
+ fprintf (fp, "%c\t%s: %s\n",
+ (comment ? '%' : ' '), ah_iter->name, (q ? q : line));
+ slrn_free (line);
+#if SLANG_VERSION >= 20000
+ if (re != NULL)
+ {
+ SLregexp_free (re);
+ re = NULL;
+ }
+#endif
+ }
+ fprintf (fp, "%%EOS\n");
file_modified = 1;
}
--
2.17.1

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: [PATCH]: SLRN: include Injection headers in new score.

<slrnuf22ql.2ek.matt@imladris.colo.ub3rgeek.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=2067&group=news.software.nntp#2067

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: matt@going-flying.com (Matthew Ernisse)
Newsgroups: news.software.nntp
Subject: Re: [PATCH]: SLRN: include Injection headers in new score.
Date: Thu, 31 Aug 2023 21:51:17 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <slrnuf22ql.2ek.matt@imladris.colo.ub3rgeek.net>
References: <20230828125422.870@kylheku.com>
Injection-Date: Thu, 31 Aug 2023 21:51:17 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="157b2022f9781aad8fcef8edf4d0ba39";
logging-data="3630166"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4M88nY623wZndx9yjvYEnsZygtOqxi0I="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:sZT5o94N9jg/8yb01E0cp8zg9Fs=
 by: Matthew Ernisse - Thu, 31 Aug 2023 21:51 UTC

On Mon, 28 Aug 2023 19:57:35 -0000 (UTC), Kaz Kylheku wrote:
> This patch affects editing of the score file. Usenet suffers from a lot
> of Google Groups spam, and it is often identified well through the
> Injection*: headers. These headers are not propagated to the score
> file, so I've had to manually copy and paste, which is annoying.

Is there a reason you don't just score based on Message-ID? Google
Groups messages are farily easily identifiable that way. I have the
below in my News/Scores file to mark all Google Group originated
articles.

[*]
%% Demote all googlegroup origin articles.
Score: -20
Message-ID: googlegroups

I mention this because I don't think Injection or Posting-Host are
generally included in the overview which means slrn will have to fetch
more information to apply scoring -- potentially needlessly.

( eternal-september lists the following for overview headers )
---
LIST OVERVIEW.FMT
215 Order of fields in overview database
Subject:
From:
Date:
Message-ID:
References:
Bytes:
Lines:
Xref:full
---

--
"The avalanche has started, it is too late for the pebbles to vote."
--Kosh

Re: [PATCH]: SLRN: include Injection headers in new score.

<20230831163303.962@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=2068&group=news.software.nntp#2068

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-4973@kylheku.com (Kaz Kylheku)
Newsgroups: news.software.nntp
Subject: Re: [PATCH]: SLRN: include Injection headers in new score.
Date: Thu, 31 Aug 2023 23:52:16 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <20230831163303.962@kylheku.com>
References: <20230828125422.870@kylheku.com>
<slrnuf22ql.2ek.matt@imladris.colo.ub3rgeek.net>
Injection-Date: Thu, 31 Aug 2023 23:52:16 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d7d6043c57cccad85a622dc3d680f17e";
logging-data="3661796"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18cy0xMi4nEJ9tuB3GUlGVgOvFEckikJSo="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:Lr8YuRS40TrjmCUAF+6cUu4VqDc=
 by: Kaz Kylheku - Thu, 31 Aug 2023 23:52 UTC

On 2023-08-31, Matthew Ernisse <matt@going-flying.com> wrote:
> On Mon, 28 Aug 2023 19:57:35 -0000 (UTC), Kaz Kylheku wrote:
>> This patch affects editing of the score file. Usenet suffers from a lot
>> of Google Groups spam, and it is often identified well through the
>> Injection*: headers. These headers are not propagated to the score
>> file, so I've had to manually copy and paste, which is annoying.
>
> Is there a reason you don't just score based on Message-ID? Google
> Groups messages are farily easily identifiable that way.

Well, yes, if I wanted to nuke everything coming from Google Groups,
I know which iron to pull out from the golf bag.

There are sometimes normal people coming from GG whose only
fault is that they don't know about using a proper newsreader
connected to an NNTP server.

> I have the
> below in my News/Scores file to mark all Google Group originated
> articles.
>
> [*]
> %% Demote all googlegroup origin articles.
> Score: -20
> Message-ID: googlegroups

I never use a score other than -9999, using .slrn-scores purely
as a kill file.

I can't think of a situation in which I would want multiple
conditions to be met in order for a post to disappear.

Every single rule I put in the file is a clear "deal breaker"
considered in isolation.

> I mention this because I don't think Injection or Posting-Host are
> generally included in the overview which means slrn will have to fetch
> more information to apply scoring -- potentially needlessly.

Correct. SLRN fetches extra headers to apply my rules. For the volume,
it's nothing. Probably less than what a Google Groups user fetches
via their browser just to load a page.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: [PATCH]: SLRN: include Injection headers in new score.

<20230906235950.123@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=2097&group=news.software.nntp#2097

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-4973@kylheku.com (Kaz Kylheku)
Newsgroups: news.software.nntp
Subject: Re: [PATCH]: SLRN: include Injection headers in new score.
Date: Thu, 7 Sep 2023 07:01:26 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 73
Message-ID: <20230906235950.123@kylheku.com>
References: <20230828125422.870@kylheku.com>
Injection-Date: Thu, 7 Sep 2023 07:01:26 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="807045ea870d199c868d719ac01c2ddb";
logging-data="3056937"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+QEmBu13eRibP5HYCHis+8vOeo98sIOD0="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:jOYXjPIdxpBDsJao/L1RfKwDXzo=
 by: Kaz Kylheku - Thu, 7 Sep 2023 07:01 UTC

On 2023-08-28, Kaz Kylheku <864-117-4973@kylheku.com> wrote:
> From c84453f2def8f78721d4f31166c1e75568a2fd90 Mon Sep 17 00:00:00 2001
> From: Kaz Kylheku <kaz@kylheku.com>
> Date: Mon, 28 Aug 2023 00:01:05 -0700
> Subject: [PATCH 2/2] Include Injection headers when editing scores.

This is has an issue, requiring a follow-up patch

From 51444fba3b157cebcf2296833a52be26e2e5b745 Mon Sep 17 00:00:00 2001
From: Kaz Kylheku <kaz@kylheku.com>
Date: Wed, 6 Sep 2023 20:32:04 -0700
Subject: [PATCH 3/3] bug: editscore: extra headers react to 'f'

I copy-pasted some code in coming up with the feature
whereby additional header are included in a score file
edit. If the user selects to create the score by F)rom,
these headers are wrongly being uncommented.
I think that extra headers should always be commented.

* src/editscore.c (slrn_edit_score): In the loop that
checks the list of additional headers, every header
that we select is now added to the file commented
with the % character, unconditionally. This simplifies
the code; the copy pasted (ch == 'f') and (ch != 'f')
are gone, as is the regex compilation check, and
setting of re_error.
---
src/editscore.c | 28 +++++-----------------------
1 file changed, 5 insertions(+), 23 deletions(-)

diff --git a/src/editscore.c b/src/editscore.c
index ba1d022..f0d5218 100644
--- a/src/editscore.c
+++ b/src/editscore.c
@@ -309,30 +309,12 @@ int slrn_edit_score (Slrn_Header_Type *h, char *newsgroup)
line = slrn_safe_strmalloc (value);
remove_linebreaks (line);
- if ((NULL == (q = SLregexp_quote_string (line, qregexp, sizeof (qregexp)))) ||
- (ch != 'f') ||
-#if SLANG_VERSION < 20000
- (0 != SLang_regexp_compile (&re))
-#else
- (NULL == (re = SLregexp_compile (qregexp, SLREGEXP_CASELESS)))
-#endif
- )
- {
- re_error |= (ch == 'f');
- comment = 1;
- }
- else
- comment = 0;
- fprintf (fp, "%c\t%s: %s\n",
- (comment ? '%' : ' '), ah_iter->name, (q ? q : line));
+ /* Extra headers are always commented, so we don't do the regex
+ * compilation check or react to selection letter in ch.
+ */
+ q = SLregexp_quote_string (line, qregexp, sizeof (qregexp));
+ fprintf (fp, "%%\t%s: %s\n", ah_iter->name, (q ? q : line));
slrn_free (line);
-#if SLANG_VERSION >= 20000
- if (re != NULL)
- {
- SLregexp_free (re);
- re = NULL;
- }
-#endif
}
fprintf (fp, "%%EOS\n");
--
2.17.1

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor