🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #243241

Re: Dialog (regex defect): Action rule using "Header" scans into body of post

#243241
From: Oliver Cromm
Date: Mon, 15 Nov 2010 17:12
61 lines
3928 bytes
* VanguardLH:

> Action rule:
> 
> !ignore,markread Header {^User-Agent: .*\b(gateway|NewsPortal|PHP)\b.*$}
> 
> Originally I did not have the ".*$" at the end of the regex since I
> figured it parsed to the end of the line or to the end of the value for
> a header (i.e., it stopped parsing when it either hit another header
> line or the blank delimiter line).  Wrong, as I found out and noted
> below.  However, adding the trailing "$" to denote the end of line does
> not restrict the parsing to just the same line as where the header title
> string is found.
> 
> Expected result:
> - Header does not exist.  Rule does not fire.
> - Header exists.  No match on regex for its value.  Rule does not fire.
> - Header exists.  Match on regex for its value.  Rule fires.
> 
> Problem:
> The "Header" operator does NOT restrict the parsing to only the header
> section of the article.  It scans through the ENTIRE article, including
> the body.

[...] 

> ==============================
> From: someone <email@domain.tld>
> Newsgroup: <pickone>
> <moreHeaders>
> User-Agent: Mozilla(yadda...yadda...yadda...
> <moreHeaders>
> 
> First line (after blank delimiter line) of body.  User want drivers for
> a Gateway model and need drivers for an old version of Windows.
> ==============================
> 
> From the action rule given above, it should NOT fire.  There is no
> "gateway", "newsportal", or "php" words in the value for the User-Agent
> header.  But what does Dialog do?  It matches all the way from the
> "User-Agent" header title in the header section, past the blank
> delimiter line and into the body to end its match at the end of the
> "Gateway" word in the body.  

I tested this specific example, and the rule did not fire for me. Are
you sure that there wasn't a match anywhere in the Header below the
User-Agent line?

In any case, the solution to your problem should be turning off
multi-line matching with (?-m):

 !ignore,markread Header {(?-m)^User-Agent: .*\b(gateway|NewsPortal|PHP)\b.*$}

I remember my initial confusion because the standard parameters for
RegEx in Scoring are ignore-case and match-multiline. So just in case,
also remember (?-i), the parameter to make the match case-sensitive.

-- 
dasz jederman sehe, wie falsch unsere gugelmönche zu ihres ordens
verteidigung der ersten kirchenexempel anziehen Calvin
  GRIMM, Deutsches Wörterbuch
Technical Details
Message-ID: <4jnelelbf8ic.dlg@mid.crommatograph.info>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news-out.octanews.net!indigo.octanews.net!auth.beige.octanews.com.POSTED!not-for-mail
References: <ibieuc$fa1$1@news.albasani.net>

Show Full Headers
Complete Article Headers
Message-ID: <4jnelelbf8ic.dlg@mid.crommatograph.info>
Subject: Re: Dialog (regex defect): Action rule using "Header" scans into body of post
Date: Mon, 15 Nov 2010 12:12:13 -0500
From: Oliver Cromm <lispamateur@crommatograph.info>
References: <ibieuc$fa1$1@news.albasani.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news-out.octanews.net!indigo.octanews.net!auth.beige.octanews.com.POSTED!not-for-mail
Newsgroups: news.software.readers
User-Agent: 40tude_Dialog/2.0.15.41
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Organization: Bananologisches Institut
X-Face: .f:ZE>c\~9oJ+1nK#>ntSHOQS~4x"Qx2m(<D<@p$G"tzb1lgWLUGY.zApKa@VL_?d$r(8=?VjrD9=uY:x!+H=hvj58Uw7)Y9<:KMYD.+^~#qMpeg2rvt`{#2a~7YoyFaFaBEdo4.TJzBqgtCZZ:mku4J|hey}DE}_"z(rl0N)\Pxh*0$"3B2mr\01&YPY7WJ:2kSe'I#PqiTxs1s49!S#W85'\zMXy*wRgD,,k.=4:3M{(P"i6S;
 \az~ut3z`; ?*Y;
 &]11<(EPF-SN`|3PhyL%~AuZpoFjjE_oM1`znHPq_?uib2WXwE+q@m),cLq~B$r^5uO]u6?CEecn=%xsDXNVa(1DX.)O(
Cancel-Lock: sha1:QKtnSCvB8cRjRpXWeLzLLvGQSN0=
Lines: 61
NNTP-Posting-Date: 15 Nov 2010 11:12:11 CST
X-Complaints-To: abuse@octanews.net
X-Original-Bytes: 3651