procmail
[Top] [All Lists]

Re: An 'or' recipe

2017-08-14 16:32:31
Chris writes:
On Sun, 2017-08-13 at 16:20 -0700, John Conover wrote:
#
ws='[    ]*($[   ]+)*'
#
:0
* 2147483647^0 $ ^From:${ws}.*susanmay21@iinet\.net\.au
* 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

Hi John, sorry it took me so long to reply. When I first saw your reply
I was totally confused which sometimes isn't hard for me. So, I've been
reading up on procmail scoring and I 'think' I'm beginning to
understand what you did above but I'm going to have to do some more
reading on in before I totally understand what you did.


Yea, Bugless, (Stephen R. van den Berg, original author of Procmail,)
put a lot of stuff in the program in the early 90's, including
scoring, which made possible one of the first Bayesian spam
filters-score the log of the probabilities, add them up and the total
score is the log of the products; the total probability that a message
is spam. (The page is still on line at
http://www.johncon.com/john/StochasticUCEDetection/, but its last
update was 2005, although it is still being used with updated tables.)

    John

BTW, see, also, (for other techniques and ideas):

    http://www.johncon.com/john/SecuringEMail/
    http://www.johncon.com/john/QuarantineAttachments/

and most importantly:
    
    http://www.johncon.com/john/archive/procmail.lint

which is a really cheap, (i.e., Bugless put all his error statements
in one file in the source code, use egrep(1) to look for the
statements in the log file,) way of testing procmail scripts, real
time.

FWIW ...

-- 

John Conover, conover(_at_)rahul(_dot_)net, http://www.johncon.com/
____________________________________________________________
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>