Article View: news.software.nntp
Article #84085Re: Cleanfeed: Looking for regex expression for ....
From: Steve Crook
Date: Wed, 01 Jun 2011 12:45
Date: Wed, 01 Jun 2011 12:45
20 lines
1682 bytes
1682 bytes
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.
Technical Details
Message-ID:
<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!border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin1!goblin.stu.neva.ru!news.mixmin.net!.POSTED.2a01:4f8:100:5243::4!not-for-mailReferences:
<is3slt$d30$1@snarked.org>Show Full Headers
Complete Article Headers
Message-ID: <slrniucd46.47d.steve@news.mixmin.net> Subject: Re: Cleanfeed: Looking for regex expression for .... Date: Wed, 01 Jun 2011 12:45:58 +0000 From: Steve Crook <steve@mixmin.net> References: <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!goblin1!goblin.stu.neva.ru!news.mixmin.net!.POSTED.2a01:4f8:100:5243::4!not-for-mail Newsgroups: news.software.nntp Organization: Mixmin Injection-Date: Wed, 1 Jun 2011 12:45:58 +0000 (UTC) Injection-Info: news.mixmin.net; posting-host="2a01:4f8:100:5243::4"; logging-data="6966"; mail-complaints-to="abuse@mixmin.net" User-Agent: slrn/pre1.0.0-26 (Linux) Lines: 19 X-Original-Bytes: 1410