Article View: news.software.readers
Article #247009Re: 40tude Dialog - reply by e-mail and to newsgroup
From: VanguardLH
Date: Wed, 24 Aug 2011 18:00
Date: Wed, 24 Aug 2011 18:00
95 lines
6725 bytes
6725 bytes
Bob Henson wrote:
> VanguardLH wrote:
>
>> Bob Henson wrote:
>>
>>> It hasn't happened again since, so I'll certainly check the headers
>>> first, and then my posting procedures. Thanks for your comprehensive
>>> reply.
>>
>> By the way, you can have Dialog alert when it sees certain headers that
>> might cause problems, like someone posting that uses the Mail-Copies-To
>> or FollowUp-To headers.
>
> May I pick your (our anyone else's reading) brains again. I'm trying to
> move inbound e-mail from a mailing list to its own directory in Dialog. The
> e-mails have the writers address in the From: field, so I cannot filter on
> that as is differs each time - so I cannot use:-
>
> !move (target-directory) From "mailing@list"
>
> I tried substituting "To" and "List-ID" for "From", but these are not
> acceptable operators. Can you tell me what fields are useable? I've had a
> search around, but haven't found a list yet.
If you read Dialog's help, you see the list of overview headers that can
be specified in a filter. Under Help's "Reference -> Scoring/Actions"
chapter, scroll down to the "When retrieving article headers in an XOver
operation you can score on the following headers" paragraph. You will
see you can test on the From, Subject, Date, Message-ID, and References
overview headers (you get these headers in the 1st pass when retrieving
just headers). If you want to test on a different overview (1st pass)
or non-overview header (2nd pass) header then you need to use the Header
directive, as in:
!move (target-directory) Header {^headername: value}
I couldn't get too specific in the regex value other than to anchor the
header name at the start of a line. I'd have to see the header and its
value to know what regex to use. Also, Dialog (well, regex) doesn't
necessarily stop at the end of a line to make a match. I found this out
when I was testing on a header but part of the value was in another
header or down in the body of the post. That is, I would test on, say,
someone posting through a Usenet leech site (a web-based forum using an
HHTP-to-NNTP gateway to peer to newsgroups):
Header {^User-Agent: .*\b(gateway|NewsPortal|PHP)\b}
but had problems in that the filter was triggering on posts where the
header did not have a matching value. Turned out that "gateway" was
used either in a later header's value or down in the body. Dialog has
to search multiple lines because headers can span more than one line.
When you test on overview headers, Dialog knows enough to stop scanning
at the blank delimiter line between the headers and body (and, though
I've not tested it, know enough to restrict the search within one header
that spans multiple lines but stops at the next header line). So I had
to find a way to restrict Dialog to test only within one line; i.e., not
allow Dialog to scan multiple lines. Of course, if the header wraps to
multiple lines then my filter might not find a match. Those where I
restrict to 1 line on a search for a match usually don't span more than
one line. The way to restrict to 1-line is to add the (?-s) qualifier
before the regex, as in:
Header {(?-s)^User-Agent: .*\b(gateway|NewsPortal|PHP)\b}
The above does the following:
{ } The regex is delimited by the braces.
(?-s) Limits the search to one line. It won't go beyond the newline
character.
^User-Agent Looks for the User-Agent header line (headers start at
column 1).
.* Skip past any leading characters not part of my search.
/b Start checking for the strings on a word boundary.
(gateway|...) Multiple choice of different strings in this header that
identify the poster came from a gatewayed web-based
site. (I have more choices than shown here and there
are also other headers used by these gatewayed sites.)
/b End checking for the strings on a word boundary. Anything beyond
those strings is unimportant so I don't check or skip
anything beyond the keywords that I'm looking for.
First, you have to use the Header directive if you want to test on a
non-overview header (i.e., if it's not an overview header listed as
supported with a direct header name in the Help file). Second, it'll
take awhile to get used to regular expressions (regex) to figure out how
to use them well. I'm more expert than some but I've seen PCRE (Perl
Core Regular Expression) that boggles my mind. It's like trying to
learn a programming language. For regex, you learn as you go and you
tweak your old filters as you learn new ways to use regex.
So if you give the headers that can identify the mailing list then I can
give you a regex that will work to trigger on those items. If those
headers include e-mail addresses, don't post them here. Munge any
e-mail addresses or insert placeholders.
Technical Details
Message-ID:
<j33e0g$o7r$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.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!weretis.net!feeder1.news.weretis.net!news.albasani.net!.POSTED!not-for-mailReferences:
<x9e5mt64nelz.m95tpp8q5oix$.dlg@40tude.net> <j2uhii$psg$1@news.albasani.net> <k5o32a7yi7uq$.13o09yyjcd169$.dlg@40tude.net> <j319bs$glk$1@news.albasani.net> <vy3g8nzov32q.11zsbt5yztvub.dlg@40tude.net>Show Full Headers
Complete Article Headers
Message-ID: <j33e0g$o7r$1@news.albasani.net> Subject: Re: 40tude Dialog - reply by e-mail and to newsgroup Date: Wed, 24 Aug 2011 13:00:32 -0500 From: VanguardLH <V@nguard.LH> References: <x9e5mt64nelz.m95tpp8q5oix$.dlg@40tude.net> <j2uhii$psg$1@news.albasani.net> <k5o32a7yi7uq$.13o09yyjcd169$.dlg@40tude.net> <j319bs$glk$1@news.albasani.net> <vy3g8nzov32q.11zsbt5yztvub.dlg@40tude.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.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!weretis.net!feeder1.news.weretis.net!news.albasani.net!.POSTED!not-for-mail Newsgroups: news.software.readers Organization: 0.35MOA sniper at loose in Usenet Lines: 95 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net oEMH1Aq0yHI1hIBYrZsrAvnEVNZrGLErh/fPQdlm1Pxuam5/saa6+ufK9NC5pSkX3Eu6Osk/qmgSCbfuZmj0kXx32OewyRw0v/xZTiR8IHUGhg+8w2BfGTfY+Ym08p6T NNTP-Posting-Date: Wed, 24 Aug 2011 17:56:33 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="bwq1iCKiS+6qu3+1Tj4CUlKV+jszYLusm0fJvMkAlsh0b2QCfoEqqSurbBQTPNSTBgfteAJleA8Cp7d141VTpz8ufeZ7ic0wl/sl4LtpXvexMWlC1mJpq7rkcIs+00xr"; mail-complaints-to="abuse@albasani.net" Keywords: VanguardLH VLH811 User-Agent: 40tude_Dialog/2.0.15.41 Cancel-Lock: sha1:izq5pvg21vXdWp8t1KkI7Kf+EKc= X-MOTD: It is wiser to remain silent and let others ponder your ignorance than to speak and remove all doubt X-Original-Bytes: 6508