"Ruud H.G. van Tol" <rvtol(_at_)isolution(_dot_)nl> wrote:
Charles Gregory <cgregory(_at_)hwcn(_dot_)org> wrote:
* MATCH ?? ^^\/[^(_at_)]+
Good. With this, it's no longer necessary, but still good practice to
protect variable substitutions in action lines with double quotes. As
has been alluded to but not spelled out, the leading space in front of
"amazon" split the matching action line into two parts ".email_alias_"
and "amazon(_at_)concept(_dot_)". Here's how that space got in there. Birl
Given the input line "To:
amazon(_at_)concept(_dot_)ocis(_dot_)temple(_dot_)edu", "[^(_at_)]", not
".*", matched the space. That's because "\/" captures a maximal match
to the right, and everything to the left is a minimal match. So if no
occurrences is possible on the left, that's all that will match there.
A standard cure for this is to anchor the ".*" with a "\<", as ".*\<".
It so happens that the handy "^TO_" macro is great for this situation.
Another problem is that the catch-all comes before the specific parse.
Anything that could conceivably match:
Will already have gotten intercepted by the preceding catch-all. This
is probably just something that got done while Birl was experimenting.
Here's one possible coding, that takes into account all the foregoing:
IDENT = "[a-z0-9][a-z0-9._=+-]*"
PLUS = "sbirl+"
SITE = "concept.temple.edu"
GO = "9876543210"
* $ $GO^0 ^TO_$\PLUS\/$IDENT(_at_)$\SITE
* $ $GO^0 ^TO_\/$IDENT(_at_)$\SITE
* MATCH ?? ^^$IDENT
I've added a new feature to my own procmail, so I can do it like this:
* $ $GO^0 ^TO_$\PLUS\/$IDENT\/@$\SITE
* $ $GO^0 ^TO_\/$IDENT\/@$\SITE
The second match delimiter specifies that the latter part be stripped.
procmail mailing list