procmail
[Top] [All Lists]

Re: Duplicates sent from lists

2004-03-11 06:32:15
On Mon, Mar 08, 2004 at 06:57:34PM -0700, LuKreme wrote:
I finally got this working.. It's a bit ugly, but pending a couple
more runs in the sandbox:

* ^To:[         ]*\/.*
{ TO=$MATCH }

# /   */ / is three spaces, '*/', and one space (basically 'two
# or more' I tried s/  +/ / and s/ {2,}/ / and various similar
# patterns but they all failed.

I'm frankly surprised at your statement that you tried {n,}
in procmail, after the many, many, many discussions here over
the time you have been reading the list, including many times
in the last three months, which have served to remind us that
that particular type of extended regex notation does not work
in procmail.


# concatenate the addresses collapse all the spaces to ' '
# substitute '|' for all spaces
:0
* ^Cc:[  ]*\/.*
{  ETO=`echo "$TO $MATCH" | sed 's/,//g' | sed 's/   */ /g' |tr ' ' 
'\|'` }

And here, I'm also surprised at the lazy inefficiency of your
invoking sed-piped-to-sed-piped-to-tr.  You are smarter than that,
Kreemy, and you sometimes even show it here.  ;)

Almost always a sed/grep/awk/tr piped to another can be
eliminated in lieu of one thing, usually sed.

Here is a discussion that is related in a way and can give some 
ideas:

http://www.xray.mpe.mpg.de/mailing-lists/procmail/2003-02/msg00408.html

-- 
dman

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail