🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #84079

Cleanfeed: Looking for regex expression for ....

#84079
From: D. Stussy
Date: Tue, 31 May 2011 23:15
21 lines
1992 bytes
I have recently noticed that there seems to be alot of trolling coming from
users which have "From:" headers that have no "@" in them.  Is that even
legal per the standards and RFCs?  I think not.

My first impression was ^[^@]*$ into file bad_from.

However, I did get some strange results.  I next tried "^[^@]+$" to ignore
the empty header-data case (which should not exist anyway).

I had a few problems with that too.  Further tracing this, I discovered
that some systems were setting their "Complaints-To" header (or the field
from "Injection-Info") to an HTTP URL instead of a mailbox address.  I
check that field against the "bad_from" regex too.

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.

Technical Details
Message-ID: <is3slt$d30$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!border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.news.ucla.edu!news.snarked.org!pool-71-106-211-51.lsanca.dsl-w.verizon.net!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <is3slt$d30$1@snarked.org>
Subject: Cleanfeed: Looking for regex expression for ....
Date: Tue, 31 May 2011 16:15:43 -0700
From: "D. Stussy" <spam+newsgroups@bde-arc.ampr.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!border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.news.ucla.edu!news.snarked.org!pool-71-106-211-51.lsanca.dsl-w.verizon.net!not-for-mail
Newsgroups: news.software.nntp
Lines: 21
Reply-To: "D. Stussy" <replies@newsgroups.kd6lvw.ampr.org>
Injection-Date: Tue, 31 May 2011 23:13:01 +0000 (UTC)
Injection-Info: snarked.org;
 posting-host="pool-71-106-211-51.lsanca.dsl-w.verizon.net:71.106.211.51";
 logging-data="13408"; 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
X-Original-Bytes: 1755