🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
7 messages
7 total messages Started by D. Stussy Fri, 24 Jun 2011 06:49
Cleanfeed and headers.
#84140
Author: D. Stussy
Date: Fri, 24 Jun 2011 06:49
18 lines
2038 bytes
As I understand how headers are stored under perl and the cleanfeed filter,
it's an associative array, with the header name as the "index."  However,
does that permit an easy way to determine whether a header exists when
using a regex to match the header name, not knowing the specific header
name in advance?  All I can think of is a loop cycling through the array,
testing for a match one at a time.  Perl is known for efficiency better
than that, so is there a better way?

Why do I ask?  Because some (well, at least one) of our trolls out there
have resulted to using headers like "X-.*f.ck.*" (replace the lone period
with "u") and other nasty words which would never appear in any "legitimate
use" extended header.  Although posted to some of the "sewer" groups, I am
of the opinion that perhaps accepting such is accepting too much,
especially when one has 20+ of those headers in a single message.

Thoughts?

Re: Cleanfeed and headers.
#84139
Author: Junior
Date: Fri, 24 Jun 2011 09:51
19 lines
2060 bytes
D. Stussy wrote:
> As I understand how headers are stored under perl and the cleanfeed filter,
> it's an associative array, with the header name as the "index."  However,
> does that permit an easy way to determine whether a header exists when
> using a regex to match the header name, not knowing the specific header
> name in advance?  All I can think of is a loop cycling through the array,
> testing for a match one at a time.  Perl is known for efficiency better
> than that, so is there a better way?
>
> Why do I ask?  Because some (well, at least one) of our trolls out there
> have resulted to using headers like "X-.*f.ck.*" (replace the lone period
> with "u") and other nasty words which would never appear in any "legitimate
> use" extended header.  Although posted to some of the "sewer" groups, I am
> of the opinion that perhaps accepting such is accepting too much,
> especially when one has 20+ of those headers in a single message.
>
> Thoughts?

Try not to overthink things?
Re: Cleanfeed and headers.
#84141
Author: Golden Pretzel
Date: Fri, 24 Jun 2011 18:35
18 lines
1938 bytes
In article <iu1bv3$o9b$1@snarked.org>
"D. Stussy" <spam+newsgroups@bde-arc.ampr.org> wrote:
>
> Why do I ask?  Because some (well, at least one) of our trolls out there
> have resulted to using headers like "X-.*f.ck.*" (replace the lone period
> with "u") and other nasty words which would never appear in any "legitimate
> use" extended header.  Although posted to some of the "sewer" groups, I am
> of the opinion that perhaps accepting such is accepting too much,
> especially when one has 20+ of those headers in a single message.
>
> Thoughts?

Kevin pissed you off did he?




Re: Cleanfeed and headers.
#84142
Author: Julien ÉLIE
Date: Fri, 24 Jun 2011 18:38
23 lines
2157 bytes
Hi Dieter,

> does that permit an easy way to determine whether a header exists when
> using a regex to match the header name, not knowing the specific header
> name in advance?  All I can think of is a loop cycling through the array,
> testing for a match one at a time.  Perl is known for efficiency better
> than that, so is there a better way?
>
> Thoughts?

Hmm…  first of all, shouldn't your message have been marked as spam and 
rejected by Cleanfeed because of its being posted to news.software.nntp 
instead of a newsgroup dealing with Perl? :-)

Oh, OK --> []
Just kidding…  I am also sometimes a bit off-topic :-)
It was too tantalizing here!

-- 
Julien ÉLIE

« Ce n'est pas en tournant le dos aux choses qu'on leur fait face. »
   (Pierre Dac)
Re: Cleanfeed and headers.
#84143
Author: Gary L. Burnore
Date: Sat, 25 Jun 2011 03:42
30 lines
2749 bytes
On Fri, 24 Jun 2011 20:35:30 +0200, "Golden Pretzel"
<invalid@home.com> wrote:

>In article <iu1bv3$o9b$1@snarked.org>
>"D. Stussy" <spam+newsgroups@bde-arc.ampr.org> wrote:
>>
>> Why do I ask?  Because some (well, at least one) of our trolls out there
>> have resulted to using headers like "X-.*f.ck.*" (replace the lone period
>> with "u") and other nasty words which would never appear in any "legitimate
>> use" extended header.  Although posted to some of the "sewer" groups, I am
>> of the opinion that perhaps accepting such is accepting too much,
>> especially when one has 20+ of those headers in a single message.
>>
>> Thoughts?
>
>Kevin pissed you off did he?
>
>
Hammer, Nail, Head.
-- 
gburnore at DataBasix dot Com 
---------------------------------------------------------------------------
                    How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore                       |  ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
Black Helicopter Repair Services, Ltd.|  ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
                                      |  ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
You KNOW you want one:                |  ÝÛ 0 1 7 2 3 / Ý³Þ 3 7 4 9 3 0 Û³
https://signup.databasix.com          |     Official Proof of Purchase
===========================================================================
Re: Cleanfeed and headers.
#84144
Author: Ralf Döblitz
Date: Sat, 25 Jun 2011 16:00
25 lines
2600 bytes
D. Stussy <spam+newsgroups@bde-arc.ampr.org> wrote:
> As I understand how headers are stored under perl and the cleanfeed filter,
> it's an associative array, with the header name as the "index."

Usually this is called a "hash".

>  However,
> does that permit an easy way to determine whether a header exists when
> using a regex to match the header name, not knowing the specific header
> name in advance?  All I can think of is a loop cycling through the array,
> testing for a match one at a time.  Perl is known for efficiency better
> than that, so is there a better way?

You can get a list of all hash keys with
  keys %whatever_your_hash_is_named
and thus can subsequently filter this list with
  grep { /you_regex/ }
rendering a list of matching hash keys which can then be processed any
way you like (count it, e.g.).

Ralf
-- 
Eine GABELN heißt im Fido nämlich "Echo", weil da reingegatete Artikel
öfters mit anderer Message-ID wieder rauskommen.
                                                  – Oliver B. Warzecha
Re: Cleanfeed and headers.
#84145
Author: D. Stussy
Date: Sun, 26 Jun 2011 03:19
34 lines
2636 bytes
"Ralf Döblitz" <doeblitz@doeblitz.net> wrote in message
news:iu50nm$ktp$1@selene.doeblitz.net...
> D. Stussy <spam+newsgroups@bde-arc.ampr.org> wrote:
> > As I understand how headers are stored under perl and the cleanfeed
filter,
> > it's an associative array, with the header name as the "index."
>
> Usually this is called a "hash".
>
> >  However,
> > does that permit an easy way to determine whether a header exists when
> > using a regex to match the header name, not knowing the specific header
> > name in advance?  All I can think of is a loop cycling through the
array,
> > testing for a match one at a time.  Perl is known for efficiency better
> > than that, so is there a better way?
>
> You can get a list of all hash keys with
>   keys %whatever_your_hash_is_named
> and thus can subsequently filter this list with
>   grep { /you_regex/ }
> rendering a list of matching hash keys which can then be processed any
> way you like (count it, e.g.).

1) Thank you for letting me know that there is a way.  I'll look into it.
(Perl was created after I got my CompSci degree, so I never learned it in
school, etc....)

2)  The next question is:  Should I be looking to filter these obnoxious
custom headers that some are using?  So far, I've received answers for both
sides of the argument but nothing persuasive.  I know there's alot of raw
garbage on Usenet, but how much "cleaning" is too much?

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads