Re: An 'or' recipe

udi M <[email protected]> Tue, 15 Aug 2017 10:19:27 +0300
Newsgroups gmane.mail.procmail
Organization tau
Message-ID <[email protected]>

On 14/08/17 02:20, John Conover wrote:
> #
> ws=3D'[    ]*($[   ]+)*'
To be precise:

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

> #
> :0
> * 2147483647^0 $ ^From:${ws}.*susanmay21@iinet\.net\.au
This line will includes strings like:  From:Hello =

[email protected]
it is not what Chris asked for.

--udi



> * 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 <[email protected]> you write:
>>>> :0
>>>> *^From:[email protected] |\
>>>> ^From:[email protected] |\
>>>> ^From:[email protected] |\
>>>> ^From:[email protected] |\
>>>> ^From:[email protected] |\
>>>> ^From:[email protected] |\
>>>> ^From:[email protected] |\
>>>> ^From:[email protected] |\
>>>> ^From:[email protected] |\
>>>> ^From:[email protected] |\
>>>> ^From:[email protected]
>>>> $AUTHORS
>>> Ugh, see below.
>>>
>>>> The output to my procmaillog shows
>>>> procmail: No match on "^From:[email protected] |^From:billh@m
>>>> arsj
>>>> ourney.info |^From:[email protected] |^From:barry@barryjhutchi
>>>> son.
>>>> com |^From:[email protected] |^From:[email protected]
>>>> |^From:bra
>>>> [email protected] |^From:[email protected] |^From:cgockel
>>>> @cgo
>>>> ckelwrites.com |^From:[email protected] |^From:jrobertsonwrites@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:.*([email protected]|[email protected]|mail@cchase
>>> harwood.com|[email protected]|[email protected]|help@boo
>>> kfunnel.com|[email protected]|[email protected]|cgockel@
>>> cgockelwrites.com|[email protected]|[email protected])
>>> $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)
>> 17:45:21 up 2 days, 9:58, 1 user, load average: 1.31, 0.75, 0.57
>> Description:	Ubuntu 16.04.3 LTS, kernel 4.10.0-32-generic
>> ____________________________________________________________
>> procmail mailing list   Procmail homepage: http://www.procmail.org/
>> [email protected]
>> https://mailman.rwth-aachen.de/mailman/listinfo/procmail
>>
>>
>> ____________________________________________________________
>> procmail mailing list   Procmail homepage: http://www.procmail.org/
>> [email protected]
>> https://mailman.rwth-aachen.de/mailman/listinfo/procmail