procmail
[Top] [All Lists]

Re: An 'or' recipe

2017-08-15 15:59:13
On Tue, 2017-08-15 at 10:19 +0300, udi M wrote:

On 14/08/17 02:20, John Conover wrote:

#
ws='[    ]*($[   ]+)*'
To be precise:

ws='[   ]*'     # when the  []  contains TAB and SPACE


#
:0
* 2147483647^0 $ ^From:${ws}.*susanmay21@iinet\.net\.au
This line will includes strings like:  From:Hello 
hellosusanmay21(_at_)iinet(_dot_)net(_dot_)au
it is not what Chris asked for.

--udi

In my case I believe that either would work. It's just that with this
* 2147483647^0 $ ^From:${ws}ads@adstarrling\.com procmail is not
checking for another string in front of the senders address. I imagine
that if I wanted to for authors that have their own domains such as the
one above I could use 
* 2147483647^0 $ ^From:${ws}.*@adstarrling\.com 
though I may be wrong since I'm definitely not a procmail guru, not
even close.



* 2147483647^0 $ ^From:${ws}.*billh@marsjourney\.info
* 2147483647^0 $ ^From:${ws}.*mail@cchaseharwood\.com
* 2147483647^0 $ ^From:${ws}.*barry@barryjhutchison\.com
     .
     .
     .
* 2147483647^0 $ ^From:${ws}.*jrobertsonwrites@gmail\.com
$AUTHORS
#

where ${ws} is folded whitespace, (the characters between the block
braces are a tab character, hex 09, followed by a space character,
hex
20).

The '.' (period character,) should be escaped, otherwise in a
regular
expression, it means any character.

The email addresses you receive the most messages from should be at
the top of the recipe, (as soon as a match is found, procmail stops
the recipe search, and goes directly to the action, i.e., store the
message in ${AUTHORS}.)

     John

Chris writes:

On Sun, 2017-08-13 at 22:40 +0000, John Levine wrote:

In article 
<1502655704(_dot_)21816(_dot_)8(_dot_)camel(_at_)embarqmail(_dot_)com> 
you write:

:0
*^From:susanmay21(_at_)iinet(_dot_)net(_dot_)au |\
^From:billh(_at_)marsjourney(_dot_)info |\
^From:mail(_at_)cchaseharwood(_dot_)com |\
^From:barry(_at_)barryjhutchison(_dot_)com |\
^From:blake(_at_)blakebrivers(_dot_)com |\
^From:help(_at_)bookfunnel(_dot_)com |\
^From:brandon(_at_)brandon-ellis(_dot_)com |\
^From:brian(_at_)brianference(_dot_)com |\
^From:cgockel(_at_)cgockelwrites(_dot_)com |\
^From:contact(_at_)ccekeke(_dot_)com |\
^From:jrobertsonwrites(_at_)gmail(_dot_)com
$AUTHORS
Ugh, see below.


The output to my procmaillog shows
procmail: No match on "^From:susanmay21(_at_)iinet(_dot_)net(_dot_)au 
|^From:b
illh@m
arsj
ourney.info |^From:mail(_at_)cchaseharwood(_dot_)com 
|^From:barry@barryj
hutchi
son.
com |^From:blake(_at_)blakebrivers(_dot_)com 
|^From:help(_at_)bookfunnel(_dot_)com

^From:bra
ndon(_at_)brandon-ellis(_dot_)com 
|^From:brian(_at_)brianference(_dot_)com
|^From:cgockel
@cgo
ckelwrites.com |^From:contact(_at_)ccekeke(_dot_)com 
|^From:jrobertsonwr
ites@g
mail
.com"

Does that look correct?
Yes, it's very rare to have a From: line with no white space or
comment
between the From: and the address.  Try this:

:0
* 
^From:.*(susanmay21(_at_)iinet(_dot_)net(_dot_)au|billh(_at_)marsjourney(_dot_)info|mail@
cchase
harwood.com|barry(_at_)barryjhutchison(_dot_)com|blake(_at_)blakebrivers(_dot_)com|he
lp@boo
kfunnel.com|brandon(_at_)brandon-ellis(_dot_)com|brian(_at_)brianference(_dot_)com|cg
ockel@
cgockelwrites.com|contact(_at_)ccekeke(_dot_)com|jrobertsonwrites(_at_)gmail(_dot_)co
m)
$AUTHORS

If you do a lot of this, you may need to make LINEBUF
bigger.  I have
patterns like this that are over 4000 characters long and they
work
fine.

R's,
John

Thanks John, I see now what you did. By putting the addresses in
braces
separated by a pipe it's still essentially what I have only
neater and
procmail will still go through each address until it gets a hit.

Thanks so much for the help

Chris

-- 
Chris
KeyID 0xE372A7DA98E6705C
31.11972; -97.90167 (Elev. 1092 ft)
15:52:53 up 7:57, 1 user, load average: 0.27, 0.17, 0.22
Description:    Ubuntu 16.04.3 LTS, kernel 4.10.0-32-generic

Attachment: signature.asc
Description: This is a digitally signed message part

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)rwth-aachen(_dot_)de
https://mailman.rwth-aachen.de/mailman/listinfo/procmail
<Prev in Thread] Current Thread [Next in Thread>