Article View: news.software.nntp
Article #52086Re: Canceling articles from within a newsreader
From: Damien
Date: Sun, 29 Apr 2001 14:26
Date: Sun, 29 Apr 2001 14:26
53 lines
3291 bytes
3291 bytes
On Sun, 29 Apr 2001 07:19:29 -0000, those who know me have no need of
my name <not-a-real-address@usa.net> wrote:
> ># path to logfile
> >my $logfile = "/dev/null";
>
> why didn't you at least give the same functionality as was originally
> present, i.e., syslog? it's trivial, even in perl.
I didn't remember how it was done. Patches are appreciated. (Even if
I will never actually run this program.)
> > # is this line a message-id header?
> > if(m/Message-ID:\ <(\W+?)>/x){
> this pattern isn't sufficient. use /message-id:\s+<(.+)>/i instead,
> with a leading ^\s* if it's supposed to be the only thing on the line.
That pattern is a typo. It should have been /Message-ID:\ <(\S+?)>/x
instead. I left out the ^\s* because the message may have been
quoted. A better pattern might be /Message-ID:\s+<([^ >])>/, but the
[^ >] is overly complicated and only important with broken message-id
headers.
RFC 1036 is case consistant, although not explicitly case sensitive,
so case sensitivity is a matter of ambiguity.
(\S+?) as opposed to (\.+) weeds out more broken message-id, without
adding as much complexity as ([^ >]).
> also, why extended? you didn't use comments or multi-line, the only
> thing it did was force you to quote the space.
I was toying with the idea of always using extended regular
expressions, since they usually improve readability. Alas, sometimes
they don't, and they probably shouldn't be used in those cases.
> > if(! $found_mail_message_id){
> > $found_mail_message_id = "1"; # we have now
> talk about unclear or ugly programming. mixing strings and boolean
> expressions, and content flagging rather than structure recognition.
Mixing strings and booleans is a common Perl idiom. "Strong
typecasting is for those with weak minds."
Content flagging vs Structure recognition was an unfortunate
carry-over from Mach's code. As a side effect, a gibberish post
containing a lot of valid message ID's will probably cause a lot of
valid messages to be canceled. But structure recognition when more
than one post could be contained in one message is more work than I'm
willing to do for free.
Technical Details
Message-ID:
<3aec24a5$0$1915$b45e6eb0@senator-bedfellow.mit.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!newsfeed.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!senator-bedfellow.mit.edu!dreaderd!not-for-mailReferences:
<ILAD6.44$8n2.28999@dfiatx1-snr1.gtei.net> <200104191703.MAA01793@www.xganon.com> <tdv6gcjos0g0f8@news.supernews.com> <200104200332.WAA31099@www.xganon.com> <3ae33166$0$1917$b45e6eb0@senator-bedfellow.mit.edu> <teng41e4bd75ce@news.supernews.com>Show Full Headers
Complete Article Headers
Message-ID: <3aec24a5$0$1915$b45e6eb0@senator-bedfellow.mit.edu> Subject: Re: Canceling articles from within a newsreader Date: Sun, 29 Apr 2001 14:26:45 +0000 From: damien@damien.mit.edu.munge (Damien) References: <ILAD6.44$8n2.28999@dfiatx1-snr1.gtei.net> <200104191703.MAA01793@www.xganon.com> <tdv6gcjos0g0f8@news.supernews.com> <200104200332.WAA31099@www.xganon.com> <3ae33166$0$1917$b45e6eb0@senator-bedfellow.mit.edu> <teng41e4bd75ce@news.supernews.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!newsfeed.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!senator-bedfellow.mit.edu!dreaderd!not-for-mail Newsgroups: alt.hackers.malicious,news.software.nntp Reply-To: damien@damien.mit.edu.munge User-Agent: slrn/0.9.7.0 (Linux) Lines: 52 NNTP-Posting-Host: DAMIEN.MIT.EDU X-Trace: 988554405 senator-bedfellow.mit.edu 1915 18.239.2.147