Rocksolid Light

groups  faq  privacy  How to post  login

Message-ID:  

Q: How much does it cost to ride the Unibus? A: 2 bits.


rocksolid / Rocksolid Nodes Help / Re: [rslight] header_filters.conf questions

SubjectAuthor
* [rslight] header_filters.conf questionsSugarBug
`* Re: [rslight] header_filters.conf questionsRetro Guy
 `* Re: [rslight] header_filters.conf questionsSugarBug
  +* Re: [rslight] header_filters.conf questionsSugarBug
  |`* Re: [rslight] header_filters.conf questionsRetro Guy
  | `- Re: [rslight] header_filters.conf questionsSugarBug
  `* Re: [rslight] header_filters.conf questionsRetro Guy
   `* Re: [rslight] header_filters.conf questionsSugarBug
    `* Re: [rslight] header_filters.conf questionsSugarBug
     `- Re: [rslight] header_filters.conf questionsRetro Guy

1
Subject: [rslight] header_filters.conf questions
From: SugarBug
Newsgroups: rocksolid.nodes.help
Organization: Baggy Jeans Mafia (sybershock.com)
Date: Fri, 22 Mar 2024 21:04 UTC
Path: i2pn2.org!.POSTED!not-for-mail
From: 388...@sugar.bug (SugarBug)
Newsgroups: rocksolid.nodes.help
Subject: [rslight] header_filters.conf questions
Date: Fri, 22 Mar 2024 16:04:32 -0500
Organization: Baggy Jeans Mafia (sybershock.com)
Message-ID: <6b03eb75eb84c4640cb112d3f68b6197$1@sybershock.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: i2pn2.org;
logging-data="2877420"; mail-complaints-to="usenet@i2pn2.org";
posting-account="yZybWhCr+jI4C3MuGpPde+DhCwsjQrVZrsCOigcx7fM";
X-Newsreader: 3883.7766
X-Spam-Checker-Version: SpamAssassin 4.0.0
View all headers

Will someone please refresh my memory ...

Where do I need to locate the file, header_filters.conf for rslight to read it?

header_filters.conf blocks messages from:

remote server on pull?

local server posted by local user?

header_filters.conf is activated, how?

If I recall correctly an entry in header_filters.conf is a single line with a header name followed by regex string, like this:

From: /test/

Is this correct?

--
SugarBug <3883@sugar.bug> | sybershock.com

Subject: Re: [rslight] header_filters.conf questions
From: Retro Guy
Newsgroups: rocksolid.nodes.help
Organization: Rocksolid Light
Date: Fri, 22 Mar 2024 23:26 UTC
References: 1
Path: i2pn2.org!.POSTED!not-for-mail
From: retro...@novabbs.org (Retro Guy)
Newsgroups: rocksolid.nodes.help
Subject: Re: [rslight] header_filters.conf questions
Date: Fri, 22 Mar 2024 16:26:06 -0700
Organization: Rocksolid Light
Message-ID: <f8d7c2c157a032e2cb7a97c3d3ce957c$1@www.novabbs.org>
References: <6b03eb75eb84c4640cb112d3f68b6197$1@sybershock.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: i2pn2.org;
logging-data="2888157"; mail-complaints-to="usenet@i2pn2.org";
posting-account="PGd4t4cXnWwgUWG9VtTiCsm47oOWbHLcTr4rYoM0Edo";
User-Agent: 40tude_Dialog/2.0.15.41
X-Spam-Checker-Version: SpamAssassin 4.0.0
View all headers

On Fri, 22 Mar 2024 16:04:32 -0500, SugarBug wrote:

> Will someone please refresh my memory ...
>
> Where do I need to locate the file, header_filters.conf for rslight to read it?

In $config_dir
> header_filters.conf blocks messages from:
>
> remote server on pull?

Yes.

> local server posted by local user?

I'm pretty sure it does not.

> header_filters.conf is activated, how?

By existing :)

> If I recall correctly an entry in header_filters.conf is a single line with a header name followed by regex string, like this:
>
> From: /test/
>
> Is this correct?

From: <1mk68gcb4f6tf$.12pg7u6934ohl.dlg@40tude.net>

Try $config_dir/header_filters.conf

This should work with the following headers:
'Message-ID'
'Subject'
'From'
'Path'

The format should be the header AND header content, and is a regex:

From: /black@hole\.url/
From: /Black Hole \<black@hole\.url\>/
From: /Black Hole/

Subject: /Buy Illegal Crap Today/

-----
Good luck :)

Subject: Re: [rslight] header_filters.conf questions
From: SugarBug
Newsgroups: rocksolid.nodes.help
Organization: Baggy Jeans Mafia (sybershock.com)
Date: Sat, 23 Mar 2024 17:15 UTC
References: 1 2
Path: i2pn2.org!.POSTED!not-for-mail
From: 388...@sugar.bug (SugarBug)
Newsgroups: rocksolid.nodes.help
Subject: Re: [rslight] header_filters.conf questions
Date: Sat, 23 Mar 2024 12:15:37 -0500
Organization: Baggy Jeans Mafia (sybershock.com)
Message-ID: <a58de901aed2096fe6876f650237f93b$1@sybershock.com>
References: <6b03eb75eb84c4640cb112d3f68b6197$1@sybershock.com>
<f8d7c2c157a032e2cb7a97c3d3ce957c$1@www.novabbs.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: i2pn2.org;
logging-data="2969649"; mail-complaints-to="usenet@i2pn2.org";
posting-account="yZybWhCr+jI4C3MuGpPde+DhCwsjQrVZrsCOigcx7fM";
X-Newsreader: 3883.7766
X-Spam-Checker-Version: SpamAssassin 4.0.0
View all headers

It seems that if one or more lines of the header_filters.conf file have a regex formatting error that not even the properly formatted lines will result in blocking any incoming messages.

For instance I put this in:

From: /<fake.broken.remove.this@hello.dude>/
From: /test5/
From: /test6/
From: /test7/
From: /test8/
From: /test9/

And the result is that blocking did not work, and, a message that seemed blocked previously showed up in the spool a couple cron jobs after the bad formatting was tested.

Also, even with properly formatted lines, it still doesn't block, or arbitrarily, and there seems no rhyme or reason. It let most messages through and blocked only a few.

I am missing something here as it seems that header_filters.conf is having no effect in group rocksolid.nodes.help.

I did a upgrade install with most recent git pull and I tried this:

~$ cat header_filters.conf
From: /test/i
From: /SugarBug/
From: /Marco Moock/
From: /Kyonshi/
From: /Retro Guy/
From: /yamo/

Then I ran the cron job a few times, and the messages from these users still show up in the spool:

https://rocksolid.sybershock.com/rocksolid/thread.php?group=rocksolid.nodes.help

However the line:

From: /test/i

did seem to be filter the messages, as shown here:

https://rocksolid.sybershock.com/random/thread.php?group=alt.test

This did filter out test messages with 'test' as a substring in the From: header. But it is not working with all the others tested in the same runs.

What am I missing?

--
3883@sugar.bug | sybershock.com

Subject: Re: [rslight] header_filters.conf questions
From: SugarBug
Newsgroups: rocksolid.nodes.help
Organization: Baggy Jeans Mafia (sybershock.com)
Date: Sat, 23 Mar 2024 17:30 UTC
References: 1 2 3
Path: i2pn2.org!.POSTED!not-for-mail
From: 388...@sugar.bug (SugarBug)
Newsgroups: rocksolid.nodes.help
Subject: Re: [rslight] header_filters.conf questions
Date: Sat, 23 Mar 2024 12:30:33 -0500
Organization: Baggy Jeans Mafia (sybershock.com)
Message-ID: <e6fe02899f6a1ab6dc47bdca26ff85e1$1@sybershock.com>
References: <6b03eb75eb84c4640cb112d3f68b6197$1@sybershock.com>
<f8d7c2c157a032e2cb7a97c3d3ce957c$1@www.novabbs.org>
<a58de901aed2096fe6876f650237f93b$1@sybershock.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: i2pn2.org;
logging-data="2970922"; mail-complaints-to="usenet@i2pn2.org";
posting-account="yZybWhCr+jI4C3MuGpPde+DhCwsjQrVZrsCOigcx7fM";
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Newsreader: 3883.7766
View all headers

P.S. One more test ...

I changed header_filters.conf to contain only a single line:

From: /Retro Guy/

and this seemed to filter out all messages from Retro Guy.

But having more than one line there is failure, as before.

Then I tried again with this line:

From: /SugarBug/

and this seemed to filter out all messages from SugarBug.

But once there is more than one line in the file it seems to fail to filter most or all, in a hit and miss fashion.

I must have something configured out of whack here, but I don't know where to look. Ideas?

Subject: Re: [rslight] header_filters.conf questions
From: Retro Guy
Newsgroups: rocksolid.nodes.help
Organization: Rocksolid Light
Date: Sat, 23 Mar 2024 17:38 UTC
References: 1 2 3 4
Path: i2pn2.org!.POSTED!not-for-mail
From: retro...@novabbs.org (Retro Guy)
Newsgroups: rocksolid.nodes.help
Subject: Re: [rslight] header_filters.conf questions
Date: Sat, 23 Mar 2024 10:38:06 -0700
Organization: Rocksolid Light
Message-ID: <fac7ff00037a2be7d953637c87e7a825$1@www.novabbs.org>
References: <6b03eb75eb84c4640cb112d3f68b6197$1@sybershock.com> <f8d7c2c157a032e2cb7a97c3d3ce957c$1@www.novabbs.org> <a58de901aed2096fe6876f650237f93b$1@sybershock.com> <e6fe02899f6a1ab6dc47bdca26ff85e1$1@sybershock.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: i2pn2.org;
logging-data="2972347"; mail-complaints-to="usenet@i2pn2.org";
posting-account="PGd4t4cXnWwgUWG9VtTiCsm47oOWbHLcTr4rYoM0Edo";
User-Agent: 40tude_Dialog/2.0.15.41
X-Spam-Checker-Version: SpamAssassin 4.0.0
View all headers

On Sat, 23 Mar 2024 12:30:33 -0500, SugarBug wrote:

> P.S. One more test ...
>
> I changed header_filters.conf to contain only a single line:
>
> From: /Retro Guy/
>
> and this seemed to filter out all messages from Retro Guy.
>
> But having more than one line there is failure, as before.
>
> Then I tried again with this line:
>
> From: /SugarBug/
>
> and this seemed to filter out all messages from SugarBug.
>
> But once there is more than one line in the file it seems to fail to filter most or all, in a hit and miss fashion.
>
> I must have something configured out of whack here, but I don't know where to look. Ideas?

I will look into this now. Maybe more that one line is an issue? I will
check.

Tbh, I don't use this filter, I only use spamassassin on my installs, so
feedback is appreciated.

Subject: Re: [rslight] header_filters.conf questions
From: Retro Guy
Newsgroups: rocksolid.nodes.help
Organization: Rocksolid Light
Date: Sat, 23 Mar 2024 17:45 UTC
References: 1 2 3
Path: i2pn2.org!.POSTED!not-for-mail
From: retro...@novabbs.org (Retro Guy)
Newsgroups: rocksolid.nodes.help
Subject: Re: [rslight] header_filters.conf questions
Date: Sat, 23 Mar 2024 10:45:26 -0700
Organization: Rocksolid Light
Message-ID: <8053438047064cccfbf270f1470db748$1@www.novabbs.org>
References: <6b03eb75eb84c4640cb112d3f68b6197$1@sybershock.com> <f8d7c2c157a032e2cb7a97c3d3ce957c$1@www.novabbs.org> <a58de901aed2096fe6876f650237f93b$1@sybershock.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: i2pn2.org;
logging-data="2972600"; mail-complaints-to="usenet@i2pn2.org";
posting-account="PGd4t4cXnWwgUWG9VtTiCsm47oOWbHLcTr4rYoM0Edo";
User-Agent: 40tude_Dialog/2.0.15.41
X-Spam-Checker-Version: SpamAssassin 4.0.0
View all headers

On Sat, 23 Mar 2024 12:15:37 -0500, SugarBug wrote:

> It seems that if one or more lines of the header_filters.conf file have a regex formatting error that not even the properly formatted lines will result in blocking any incoming messages.
>
> For instance I put this in:
>
> From: /<fake.broken.remove.this@hello.dude>/
> From: /test5/
> From: /test6/
> From: /test7/
> From: /test8/
> From: /test9/
>
> And the result is that blocking did not work, and, a message that seemed blocked previously showed up in the spool a couple cron jobs after the bad formatting was tested.
>
> Also, even with properly formatted lines, it still doesn't block, or arbitrarily, and there seems no rhyme or reason. It let most messages through and blocked only a few.
>
> I am missing something here as it seems that header_filters.conf is having no effect in group rocksolid.nodes.help.
>
> I did a upgrade install with most recent git pull and I tried this:
>
> ~$ cat header_filters.conf
> From: /test/i
> From: /SugarBug/
> From: /Marco Moock/
> From: /Kyonshi/
> From: /Retro Guy/
> From: /yamo/
>
> Then I ran the cron job a few times, and the messages from these users still show up in the spool:
>
> https://rocksolid.sybershock.com/rocksolid/thread.php?group=rocksolid.nodes.help
>
> However the line:
>
> From: /test/i
>
> did seem to be filter the messages, as shown here:
>
> https://rocksolid.sybershock.com/random/thread.php?group=alt.test
>
> This did filter out test messages with 'test' as a substring in the From: header. But it is not working with all the others tested in the same runs.
>
> What am I missing?

Ok, I think I see the issue. As I mentioned, I don't use this so I don't
notice these things.

Each header should be one line in header_filters.conf:
From: /test5|test6|test7|test8|test9/

Only one line per header.

In the code:
$from_filter = get_config_value('header_filters.conf', 'From');
if (preg_match($from_filter, $from[1])) {

So, the one line for From: is checked as one big regex.

Subject: Re: [rslight] header_filters.conf questions
From: SugarBug
Newsgroups: rocksolid.nodes.help
Organization: Baggy Jeans Mafia (sybershock.com)
Date: Sat, 23 Mar 2024 17:56 UTC
References: 1 2 3 4 5
Path: i2pn2.org!rocksolid2!.POSTED!not-for-mail
From: 388...@sugar.bug (SugarBug)
Newsgroups: rocksolid.nodes.help
Subject: Re: [rslight] header_filters.conf questions
Date: Sat, 23 Mar 2024 12:56:02 -0500
Organization: Baggy Jeans Mafia (sybershock.com)
Message-ID: <utn4rk$2om4v$1@novabbs.org>
References: <6b03eb75eb84c4640cb112d3f68b6197$1@sybershock.com>
<f8d7c2c157a032e2cb7a97c3d3ce957c$1@www.novabbs.org>
<a58de901aed2096fe6876f650237f93b$1@sybershock.com>
<e6fe02899f6a1ab6dc47bdca26ff85e1$1@sybershock.com>
<fac7ff00037a2be7d953637c87e7a825$1@www.novabbs.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 23 Mar 2024 17:51:49 -0000 (UTC)
Injection-Info: novabbs.org;
logging-data="2906271"; mail-complaints-to="usenet@novabbs.org";
posting-account="TzG3Hl99Aa0Fgb506WreKRgRTO2mG9+aGjVDifyfNqo";
X-Newsreader: 3883.7766
X-Spam-Checker-Version: SpamAssassin 4.0.0
View all headers

On Sat, 23 Mar 2024 10:38:06 -0700
Retro Guy <retroguy@novabbs.org> wrote:

> On Sat, 23 Mar 2024 12:30:33 -0500, SugarBug wrote:
>
> > P.S. One more test ...
> >
> > I changed header_filters.conf to contain only a single line:
> >
> > From: /Retro Guy/
> >
> > and this seemed to filter out all messages from Retro Guy.
> >
> > But having more than one line there is failure, as before.
> >
> > Then I tried again with this line:
> >
> > From: /SugarBug/
> >
> > and this seemed to filter out all messages from SugarBug.
> >
> > But once there is more than one line in the file it seems to fail to filter most or all, in a hit and miss fashion.
> >
> > I must have something configured out of whack here, but I don't know where to look. Ideas?
>
> I will look into this now. Maybe more that one line is an issue? I will
> check.
>
> Tbh, I don't use this filter, I only use spamassassin on my installs, so
> feedback is appreciated.

I almost have it narrowed down, but not entirely so. At this point it seems mostly that the first From: line gets filtered, and then the From: lines after that do not get filtered. After a few tests this seems to be the case. If you compare my group, alt.test, to your spool, you should see what I mean, for 'From: /t3st1ng/'.

--
3883@sugar.bug | sybershock.com

Subject: Re: [rslight] header_filters.conf questions
From: SugarBug
Newsgroups: rocksolid.nodes.help
Organization: Baggy Jeans Mafia (sybershock.com)
Date: Sat, 23 Mar 2024 17:58 UTC
References: 1 2 3 4
Path: i2pn2.org!.POSTED!not-for-mail
From: 388...@sugar.bug (SugarBug)
Newsgroups: rocksolid.nodes.help
Subject: Re: [rslight] header_filters.conf questions
Date: Sat, 23 Mar 2024 12:58:24 -0500
Organization: Baggy Jeans Mafia (sybershock.com)
Message-ID: <ff5afde6edf9d96348e723df867b81db$1@sybershock.com>
References: <6b03eb75eb84c4640cb112d3f68b6197$1@sybershock.com>
<f8d7c2c157a032e2cb7a97c3d3ce957c$1@www.novabbs.org>
<a58de901aed2096fe6876f650237f93b$1@sybershock.com>
<8053438047064cccfbf270f1470db748$1@www.novabbs.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: i2pn2.org;
logging-data="2973331"; mail-complaints-to="usenet@i2pn2.org";
posting-account="yZybWhCr+jI4C3MuGpPde+DhCwsjQrVZrsCOigcx7fM";
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Newsreader: 3883.7766
View all headers

On Sat, 23 Mar 2024 10:45:26 -0700
Retro Guy <retroguy@novabbs.org> wrote:

> On Sat, 23 Mar 2024 12:15:37 -0500, SugarBug wrote:
>
> > It seems that if one or more lines of the header_filters.conf file have a regex formatting error that not even the properly formatted lines will result in blocking any incoming messages.
> >
> > For instance I put this in:
> >
> > From: /<fake.broken.remove.this@hello.dude>/
> > From: /test5/
> > From: /test6/
> > From: /test7/
> > From: /test8/
> > From: /test9/
> >
> > And the result is that blocking did not work, and, a message that seemed blocked previously showed up in the spool a couple cron jobs after the bad formatting was tested.
> >
> > Also, even with properly formatted lines, it still doesn't block, or arbitrarily, and there seems no rhyme or reason. It let most messages through and blocked only a few.
> >
> > I am missing something here as it seems that header_filters.conf is having no effect in group rocksolid.nodes.help.
> >
> > I did a upgrade install with most recent git pull and I tried this:
> >
> > ~$ cat header_filters.conf
> > From: /test/i
> > From: /SugarBug/
> > From: /Marco Moock/
> > From: /Kyonshi/
> > From: /Retro Guy/
> > From: /yamo/
> >
> > Then I ran the cron job a few times, and the messages from these users still show up in the spool:
> >
> > https://rocksolid.sybershock.com/rocksolid/thread.php?group=rocksolid.nodes.help
> >
> > However the line:
> >
> > From: /test/i
> >
> > did seem to be filter the messages, as shown here:
> >
> > https://rocksolid.sybershock.com/random/thread.php?group=alt.test
> >
> > This did filter out test messages with 'test' as a substring in the From: header. But it is not working with all the others tested in the same runs.
> >
> > What am I missing?
>
> Ok, I think I see the issue. As I mentioned, I don't use this so I don't
> notice these things.
>
> Each header should be one line in header_filters.conf:
> From: /test5|test6|test7|test8|test9/
>
> Only one line per header.
>
> In the code:
> $from_filter = get_config_value('header_filters.conf', 'From');
> if (preg_match($from_filter, $from[1])) {
>
> So, the one line for From: is checked as one big regex.

So, I should list all the substrings on one single line prefixed with that header name?

I'll test that and get back in touch.

--
3883@sugar.bug | sybershock.com

Subject: Re: [rslight] header_filters.conf questions
From: SugarBug
Newsgroups: rocksolid.nodes.help
Organization: Baggy Jeans Mafia (sybershock.com)
Date: Sat, 23 Mar 2024 18:15 UTC
References: 1 2 3 4 5
Path: i2pn2.org!.POSTED!not-for-mail
From: 388...@sugar.bug (SugarBug)
Newsgroups: rocksolid.nodes.help
Subject: Re: [rslight] header_filters.conf questions
Date: Sat, 23 Mar 2024 13:15:18 -0500
Organization: Baggy Jeans Mafia (sybershock.com)
Message-ID: <15f543c2094fa5d0db1f4ff2b51fd836$1@sybershock.com>
References: <6b03eb75eb84c4640cb112d3f68b6197$1@sybershock.com>
<f8d7c2c157a032e2cb7a97c3d3ce957c$1@www.novabbs.org>
<a58de901aed2096fe6876f650237f93b$1@sybershock.com>
<8053438047064cccfbf270f1470db748$1@www.novabbs.org>
<ff5afde6edf9d96348e723df867b81db$1@sybershock.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: i2pn2.org;
logging-data="2975403"; mail-complaints-to="usenet@i2pn2.org";
posting-account="yZybWhCr+jI4C3MuGpPde+DhCwsjQrVZrsCOigcx7fM";
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Newsreader: 3883.7766
View all headers

On Sat, 23 Mar 2024 12:58:24 -0500
SugarBug <3883@sugar.bug> wrote:

> On Sat, 23 Mar 2024 10:45:26 -0700
> Retro Guy <retroguy@novabbs.org> wrote:
>
> > On Sat, 23 Mar 2024 12:15:37 -0500, SugarBug wrote:
> >
> > > It seems that if one or more lines of the header_filters.conf file have a regex formatting error that not even the properly formatted lines will result in blocking any incoming messages.
> > >
> > > For instance I put this in:
> > >
> > > From: /<fake.broken.remove.this@hello.dude>/
> > > From: /test5/
> > > From: /test6/
> > > From: /test7/
> > > From: /test8/
> > > From: /test9/
> > >
> > > And the result is that blocking did not work, and, a message that seemed blocked previously showed up in the spool a couple cron jobs after the bad formatting was tested.
> > >
> > > Also, even with properly formatted lines, it still doesn't block, or arbitrarily, and there seems no rhyme or reason. It let most messages through and blocked only a few.
> > >
> > > I am missing something here as it seems that header_filters.conf is having no effect in group rocksolid.nodes.help.
> > >
> > > I did a upgrade install with most recent git pull and I tried this:
> > >
> > > ~$ cat header_filters.conf
> > > From: /test/i
> > > From: /SugarBug/
> > > From: /Marco Moock/
> > > From: /Kyonshi/
> > > From: /Retro Guy/
> > > From: /yamo/
> > >
> > > Then I ran the cron job a few times, and the messages from these users still show up in the spool:
> > >
> > > https://rocksolid.sybershock.com/rocksolid/thread.php?group=rocksolid.nodes.help
> > >
> > > However the line:
> > >
> > > From: /test/i
> > >
> > > did seem to be filter the messages, as shown here:
> > >
> > > https://rocksolid.sybershock.com/random/thread.php?group=alt.test
> > >
> > > This did filter out test messages with 'test' as a substring in the From: header. But it is not working with all the others tested in the same runs.
> > >
> > > What am I missing?
> >
> > Ok, I think I see the issue. As I mentioned, I don't use this so I don't
> > notice these things.
> >
> > Each header should be one line in header_filters.conf:
> > From: /test5|test6|test7|test8|test9/
> >
> > Only one line per header.
> >
> > In the code:
> > $from_filter = get_config_value('header_filters.conf', 'From');
> > if (preg_match($from_filter, $from[1])) {
> >
> > So, the one line for From: is checked as one big regex.
>
> So, I should list all the substrings on one single line prefixed with that header name?
>
> I'll test that and get back in touch.

Confirmed. It appears that the filters do work when on a single line for each header as you have shown above.

Question: is there a line concatenation charcter that PHP recognizes, in the way that bash recognizes '\' at line ending?

--
3883@sugar.bug | sybershock.com

Subject: Re: [rslight] header_filters.conf questions
From: Retro Guy
Newsgroups: rocksolid.nodes.help
Organization: RetroBBS
Date: Sat, 23 Mar 2024 18:28 UTC
References: 1 2 3 4 5 6
Path: i2pn2.org!.POSTED!not-for-mail
From: retro...@novabbs.com (Retro Guy)
Newsgroups: rocksolid.nodes.help
Subject: Re: [rslight] header_filters.conf questions
Date: Sat, 23 Mar 2024 18:28:23 +0000
Organization: RetroBBS
Message-ID: <48097657ec4b445a09648de822c6131e@www.rocksolidbbs.com>
References: <6b03eb75eb84c4640cb112d3f68b6197$1@sybershock.com> <f8d7c2c157a032e2cb7a97c3d3ce957c$1@www.novabbs.org> <a58de901aed2096fe6876f650237f93b$1@sybershock.com> <8053438047064cccfbf270f1470db748$1@www.novabbs.org> <ff5afde6edf9d96348e723df867b81db$1@sybershock.com> <15f543c2094fa5d0db1f4ff2b51fd836$1@sybershock.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="2977044"; mail-complaints-to="usenet@i2pn2.org";
posting-account="qk6pvs/sIyKYNRNFdjVS+ghlZZkCUq7cWs+7p7kaLpU";
User-Agent: Rocksolid Light
X-Face: .&YR-G(w(DZ$$,}%k=]*5*!p'=(anr"IT`wZG'2VWdfl\r)l[42u7JH`n(JUQ*e5*A|XCDf
?&\X&uwkl38"CYX3O8m}C8E4p'%N$2#kSTVzx{Ly|DjLT\Vk7NE}NQ(VC$Yq]i:7|z[.9iv^g>*8_B
H0=hZt'[%)4kG|
X-Rslight-Site: $2y$10$0mpEGHUlN/dLIoi9q6GKmuZ0Uc9B4nuEgZd/GlM2L8SvJxMx2ONmS
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Posting-User: 470b25edab282a455f83b37c76e8728963cc19ae
View all headers

SugarBug wrote:

> On Sat, 23 Mar 2024 12:58:24 -0500
> SugarBug <3883@sugar.bug> wrote:

>> On Sat, 23 Mar 2024 10:45:26 -0700
>> Retro Guy <retroguy@novabbs.org> wrote:
>>
>> > On Sat, 23 Mar 2024 12:15:37 -0500, SugarBug wrote:
>> >
>> > > It seems that if one or more lines of the header_filters.conf file have a regex formatting error that not even the properly formatted lines will result in blocking any incoming messages.
>> > >
>> > > For instance I put this in:
>> > >
>> > > From: /<fake.broken.remove.this@hello.dude>/
>> > > From: /test5/
>> > > From: /test6/
>> > > From: /test7/
>> > > From: /test8/
>> > > From: /test9/
>> > >
>> > > And the result is that blocking did not work, and, a message that seemed blocked previously showed up in the spool a couple cron jobs after the bad formatting was tested.
>> > >
>> > > Also, even with properly formatted lines, it still doesn't block, or arbitrarily, and there seems no rhyme or reason. It let most messages through and blocked only a few.
>> > >
>> > > I am missing something here as it seems that header_filters.conf is having no effect in group rocksolid.nodes.help.
>> > >
>> > > I did a upgrade install with most recent git pull and I tried this:
>> > >
>> > > ~$ cat header_filters.conf
>> > > From: /test/i
>> > > From: /SugarBug/
>> > > From: /Marco Moock/
>> > > From: /Kyonshi/
>> > > From: /Retro Guy/
>> > > From: /yamo/
>> > >
>> > > Then I ran the cron job a few times, and the messages from these users still show up in the spool:
>> > >
>> > > https://rocksolid.sybershock.com/rocksolid/thread.php?group=rocksolid.nodes.help
>> > >
>> > > However the line:
>> > >
>> > > From: /test/i
>> > >
>> > > did seem to be filter the messages, as shown here:
>> > >
>> > > https://rocksolid.sybershock.com/random/thread.php?group=alt.test
>> > >
>> > > This did filter out test messages with 'test' as a substring in the From: header. But it is not working with all the others tested in the same runs.
>> > >
>> > > What am I missing?
>> >
>> > Ok, I think I see the issue. As I mentioned, I don't use this so I don't
>> > notice these things.
>> >
>> > Each header should be one line in header_filters.conf:
>> > From: /test5|test6|test7|test8|test9/
>> >
>> > Only one line per header.
>> >
>> > In the code:
>> > $from_filter = get_config_value('header_filters.conf', 'From');
>> > if (preg_match($from_filter, $from[1])) {
>> >
>> > So, the one line for From: is checked as one big regex.
>>
>> So, I should list all the substrings on one single line prefixed with that header name?
>>
>> I'll test that and get back in touch.

> Confirmed. It appears that the filters do work when on a single line for each header as you have shown above.

Great! I'm glad it works :)

> Question: is there a line concatenation charcter that PHP recognizes, in the way that bash recognizes '\' at line ending?

I'm pretty sure you can continue on another line. Not sure if it will cause an issue in the middle of a regex though. The regex would probably see a space as a space, but maybe a cr/lf is ok?

I don't tend to do this, but I believe you can. Give it a try :)

--
Retro Guy


rocksolid / Rocksolid Nodes Help / Re: [rslight] header_filters.conf questions

1
server_pubkey.txt

rocksolid light 0.9.136
clearnet tor