Article View: news.software.nntp
Article #81402Re: Cleanfeed (v227) comments:
From: D. Stussy
Date: Mon, 15 Jun 2009 20:48
Date: Mon, 15 Jun 2009 20:48
59 lines
3692 bytes
3692 bytes
"Steve Crook" <steve@mixmin.net> wrote in message
news:slrnh3civj.fbg.steve@news.mixmin.net...
> On Sat, 13 Jun 2009 13:46:51 -0700, D. Stussy wrote in
> Message-Id: <h1137j$i7k$1@snarked.org>:
> Thanks very much for your feedback.
> ...
> > Bad_From(_RE): I see that the suggestion regarding bad "From:" header
> > matching didn't fall on deaf ears. However, consider also matching the
> > pattern against "Sender:" and "Reply-To:" headers, perhaps as an
option.
>
> All three headers, From, Sender and Reply-To are now checked. A match
> against any one will result in a 'Bad From' reject reason.
Note that I consider order important here, and the system should report in
the message WHICH header was matched. I checked them locally in this
order: Reply-To, Sender, From. I wanted to give preference to the
optional headers, and Reply-To seems more critical to be a valid mailbox
than the rest. From is often made invalid while Reply-To should (or must?)
be valid. Example:
if ($Bad_From) {
return reject("Banned Reply-To ($1)",'Banned Reply-To')
if $hdr{'Reply-To'} =~ $Bad_From_RE;
return reject("Banned Sender ($1)",'Banned Sender')
if $hdr{'Sender'} =~ $Bad_From_RE;
}
I prefer to say "Banned From|Sender|Reply-To" than "Bad From..." - It's
more precise.
I have also seen some questionable posts where From = Reply-To. However,
Reply-To should only be given if it differs from From.
> > Possibly "Errors-To:" also (which should only appear in articles gated
from
> > mailing lists where it is technically depreciated).
> I'll monitor this one for a while and see what hits are logged.
Locally, I chose not to implement any checks for it. However, it is a
"sender"-type header, so it deserved consideration with the above.
> > Some variables have mixed-case regex expressions - e.g.:
> >
> > $HTTP = '[Hh][Tt][Tt][Pp][Ss]?:\/\/?(?:\w+(?::\w+)?@)?';
> >
> > Is this necessary, as opposed to using "=~ /$HTTP/i", thus making the
> > expression comparison case insensitive with the "i" flag? Would this
> > change result in either cleaner looking code or faster execution?
>
> The whole URL matching section needs some rework. It functions on the
> principle that all posted URL's are prefixed with http:// which is often
> not true. I'll try and clean this section up over the next week, time
> permitting.
Note that my point here was efficiency and ease of reading the code. If it
executes faster "as is", then it should NOT be changed.
Technical Details
Message-ID:
<h16b3g$ltr$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.ams.giganews.com!nntp.giganews.com!newsfeed.freenet.de!feeder.news-service.com!de-l.enfer-du-nord.net!gegeweb.org!news.snarked.org!not-for-mailReferences:
<h1137j$i7k$1@snarked.org> <slrnh3civj.fbg.steve@news.mixmin.net>Show Full Headers
Complete Article Headers
Message-ID: <h16b3g$ltr$1@snarked.org> Subject: Re: Cleanfeed (v227) comments: Date: Mon, 15 Jun 2009 13:48:37 -0700 From: "D. Stussy" <spam@bde-arc.ampr.org> References: <h1137j$i7k$1@snarked.org> <slrnh3civj.fbg.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.ams.giganews.com!nntp.giganews.com!newsfeed.freenet.de!feeder.news-service.com!de-l.enfer-du-nord.net!gegeweb.org!news.snarked.org!not-for-mail Newsgroups: news.software.nntp Lines: 59 Reply-To: "D. Stussy" <replies@newsgroups.kd6lvw.ampr.org> NNTP-Posting-Host: pool-71-106-211-188.lsanca.dsl-w.verizon.net X-Trace: snarked.org 1245097904 22459 71.106.211.188 (15 Jun 2009 20:31:44 GMT) X-Complaints-To: newsmaster@snarked.org NNTP-Posting-Date: Mon, 15 Jun 2009 20:31:44 +0000 (UTC) X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1478 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478