RegEx were never my strong point.
I looked in the archives to see if something similar was posted, but looks
like my searching abilities stink too.
-------------------------------------------------------------------------------
Nutshell:
Trying to filter email aliases. Sometimes the email is in the form of
1) "First Last" <Joe(_dot_)Schmoe(_at_)concept(_dot_)temple(_dot_)edu>
2) <Joe(_dot_)Schmoe(_at_)concept(_dot_)temple(_dot_)edu>
3) Joe(_dot_)Schmoe(_at_)concept(_dot_)temple(_dot_)edu
4) JoeSchmoe(_at_)concept(_dot_)temple(_dot_)edu
In examples 3 and 4, my filter works good. But the " and < throw me.
-------------------------------------------------------------------------------
Details:
Here's the current receipe
-------------------------------------------------------------------------------
# Need to work out kinks with <
:0
* ! ^(To|Cc):.*sbirl@
* ^(To|Cc):.*[^${SPACE}${TAB}[<]"]+\/[^(_at_)]+
{
LOG=" ---> Reached catch-all for email aliases (username).
Matched \"$MATCH\"${NL}"
:0:
+$MATCH
}
-------------------------------------------------------------------------------
I previously had for my 2nd condition
* ^(To|Cc):.*[^${SPACE}${TAB}<"]+\/[^(_at_)]+
which was close to what I wanted.
But after reading
http://www.xray.mpe.mpg.de/mailing-lists/procmail/2003-10/msg00241.html
I changed it.
-------------------------------------------------------------------------------
RETURN-PATH ---> <asia_girl72(_at_)yahoo(_dot_)com>
DATE ---> Mon, 5 Apr 2004 21:38:02 -0500
FROM ---> "Dime Board" <asia_girl72(_at_)yahoo(_dot_)com>
TO ---> "sbirl"
<Sara(_dot_)Brinsfield(_at_)concept(_dot_)ocis(_dot_)temple(_dot_)edu>
SUBJECT ---> contests i'm participating in
BEGIN searching aliases
procmail: Match on ! "^(To|Cc):.*sbirl@"
procmail: Assigning "MATCH="
procmail: Matched ""sbirl" <Sara.Brinsfield"
procmail: Match on "^(To|Cc):.*[^${SPACE}${TAB}<"]+\/[^(_at_)]+"
procmail: Assigning "LOG= ---> Reached catch-all for email aliases
(username). Matched ""sbirl" <Sara.Brinsfield"
"
---> Reached catch-all for email aliases (username). Matched
""sbirl" <Sara.Brinsfield"
procmail: Locking "+"sbirl".lock"
procmail: Skipped "<Sara.Brinsfield"
procmail: Assigning "LASTFOLDER=+"sbirl""
procmail: Opening "+"sbirl""
procmail: Acquiring kernel-lock
procmail: [10651] Mon Apr 5 22:40:11 2004
procmail: Unlocking "+"sbirl".lock"
-------------------------------------------------------------------------------
After the change I have:
procmail: No match on "^(To|Cc):.*[^${SPACE}${TAB}[<]"]+\/[^(_at_)]+"
Thanks
Birl
Archives http://www.xray.mpe.mpg.de/mailing-lists/procmail/
RegEx help with double-quotes double quotes " less-than less than <
angle-brackets angle brackets
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail