🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #84084

Re: Cleanfeed: Looking for regex expression for ....

#84084
From: D. Stussy
Date: Wed, 01 Jun 2011 23:57
49 lines
3276 bytes
"Steve Crook" <steve@mixmin.net> wrote in message
news:slrniucd46.47d.steve@news.mixmin.net...
> On Tue, 31 May 2011 16:15:43 -0700, D. Stussy wrote in
> Message-Id: <is3slt$d30$1@snarked.org>:
>
> > Therefore, my third try is this:  ^[^@:]+$
> > or is it better to specify it as     ^[^@:]{1,}$
> >
> > My goal is to eliminate illegally formatted messages from my server.
> > Opinions wanted.
>
> This is a lot harder than it appears because the From header can
> contain legitimate freeform text.  E.g. Steve <steve@mixmin.net>.
>
> You could check for the presence of a valid address in the From header
> with something like this in cleanfeed.local:
> if ($hdr{From} !~ /[\w\-\.]+\@[\w\-\.]+/) {
>     logart('malformed_from');
> };
>
> There are much more elaborate email address regexs but that will
> probably suffice.

OK, but instead of writing code to check for the presence of "@" then
negating, I'm appending to an existing expression and checking for its
absence.

I thought that the purpose of the "bad_from" regex file was:
1)  To ban specific users and user patterns, and
2)  To detect invalid constructs.

The pattern I'm testing addresses #2.  It should reject anything that
doesn't have either "@" or ":".  I'm being nice by accepting the colon - so
as not to reject the ONE site that's using a properly formatted HTTP URL
despite the fact that the field is supposed to have a mailbox address.

I've only found 5 sites which are being affected (when applying this to the
"complaints to" field).  Two of them are trying to specify HTTP addresses
but don't have a leading "http://".  The other three are playing games with
mailbox address formats by using "(at)" or "_at_" instead of "@".


For Julien:  It doesn't matter if INN handles it properly.  Other software
is also used for Usenet, and we certainly can't speak for them or their
users - beyond what the RFCs and accepted standards tell us.  Simply put:
The crap is getting in somewhere, and once in, it doesn't matter from
where.

Technical Details
Message-ID: <is6jgc$m1l$1@snarked.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.snarked.org!pool-71-106-211-51.lsanca.dsl-w.verizon.net!not-for-mail
References: <is3slt$d30$1@snarked.org> <slrniucd46.47d.steve@news.mixmin.net>

Show Full Headers
Complete Article Headers
Message-ID: <is6jgc$m1l$1@snarked.org>
Subject: Re: Cleanfeed: Looking for regex expression for ....
Date: Wed, 1 Jun 2011 16:57:37 -0700
From: "D. Stussy" <spam+newsgroups@bde-arc.ampr.org>
References: <is3slt$d30$1@snarked.org> <slrniucd46.47d.steve@news.mixmin.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.snarked.org!pool-71-106-211-51.lsanca.dsl-w.verizon.net!not-for-mail
Newsgroups: news.software.nntp
Lines: 49
Reply-To: "D. Stussy" <replies@newsgroups.kd6lvw.ampr.org>
Injection-Date: Wed, 1 Jun 2011 23:54:52 +0000 (UTC)
Injection-Info: snarked.org;
 posting-host="pool-71-106-211-51.lsanca.dsl-w.verizon.net:71.106.211.51";
 logging-data="22581"; mail-complaints-to="newsmaster+complaints@snarked.org"
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1478
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478