[PLUG] Procmail help needed

Paul Heinlein heinlein at madboa.com
Mon Nov 4 15:30:01 UTC 2019


On Sun, 3 Nov 2019, Rich Shepard wrote:

> I thought I worked out all wrinkles in the ~/.procmailrc recipes. I hadn't.
>
> Paul taught me a lot about procmail recipes (such as putting them all in
> .procmailrc rathet than an include file and that any string in a message
> header can be used as the search string.) I've also read a couple of
> detailed procmail blogs/web pages with examples of recipes which I've tried
> to emulate.
>
> Recipes can have multiple search strings and my understanding is that any
> string must match for procmail to send the message to that file/folder.
> Perhaps that's not the case but I saw no definitive answer.
>
> I've moved all recipes into ~/.procmailrc:
>
> # Catch SPAM
> :0
> * ^X-Spam-Flag: YES
> * ^X-Spam-Level: \*\*\*\*\*\*
> /dev/null
>
> ## Call SpamAssassin
> :0fw: spamassassin.lock
> * < 256000
> | spamassassin
>
> ## Flagged as SPAM by spamassassin?
> :0
> * ^X-Spam-Status: Yes
> /dev/null
>
> :0:
> * ^Subject: *****SPAM*****
> /dev/null
>
> :0:
> * ^(To|Cc).*twodogs.us
> personal
>
> :0:
> * ^TO_.*appl-ecosys.com
> $DEFAULT
>
> :0;
> * [GRASS-user]
> #* ^List-Id:.*<grass-user\.lists\.osgeo\.org>
> #* ^(From|Cc|To).*osgeo\.org
> spatial-analyses
>
> :0:
> * ^(From|Cc|To).*postgresql\.org
> database
>
> :0:
> * ^(From|Cc|To).*gnucash\.org
> accounting
>
> :0:
> * ^(From|Cc|To).*jpilot\.org
> pda-jpilot
>
> :0:
> * ^(From|Cc|To).*lists\.lyx\.org
> typesetting
>
> :0:
> * ^List-ID:.*<plug.*\.pdxlinux\.org>
> * ^(From|Cc|To).*pdxlinux\.org
> PLUG
>
> :0:
> * ^(From|Cc|To).*tug\.org
> typesetting
>
> :0:
> * ^List-Id:.*<python-list\.python\.org>
> * [sqlalchemy]
> programming
>
> * ^(From|Cc|To).*sqlite\.org
> SQL
>
> :0:
> * r-sig-mixed-models
> * r-help
> * ^(From|Cc|To).*r-project\.org
> * ^(From|Cc|To).*ethz\.ch
> R
>
> :0:
> * slackbuilds-users
> * ^(From|Cc|To).*slackbuilds\.org
> * ^(From|Cc|To).*mailman\.lug\.org\.uk
> * ^(From|Cc|To).*@slackware\.com
> slackware
>
> :0: * [taskjuggler-users]
> office
>
> :0:
> * postfix-users
> * ^(From|Cc|To).*postfix\.org * ^(From|Cc|To).*cloud9\.net
> mailhelp
> #EOF
>
> This past weekend all incoming messages were sent to spatial-analyses (the
> first recipe) and not matched to the proper recipe. Is that because _all_
> search strings must match? Should I write a separate recipe for each search
> string?

Rich,

This would be interpreted as a case-insensitive regular expression:

> * [GRASS-user]

Any message with a header containing the letters a, e, g, r, s, or u 
(and perhaps t; I'm not exactly sure how the hyphen would be 
interpreted in that context) will match the rule. You'd need to escape 
the brackets:

* \[GRASS-user\]

-- 
Paul Heinlein
heinlein at madboa.com
45°38' N, 122°6' W


More information about the PLUG mailing list