procmail
[Top] [All Lists]

Re: ^TO_ is too clever

2002-05-14 09:15:25
Christian Kuhn wrote,

| I used procmail to provide my brother with a set of eMail addresses.
| What i intended was: all addresses at qno.de, beginning with a t,
| followed by none or more characters, ending with kuhn, should be
| forwarded to his freemailer-account. The recipe i used is:

| :0:
| * ^TO_t(_dot_)*kuhn(_at_)qno\(_dot_)de
| !mybrother(_at_)acertainfreemailer(_dot_)de

It's flawed to start, because it won't catch blind carbons and will be
confused by mail where some visible destination addresses match the expression
and some do not.  Also, you're asking for a local lockfile (1) where the
action doesn't need one and (2) without specifying a name for it in a
situation where procmail can't think of a name on its own.  However, while
those are important enough to bring up in passing, they aren't what Christian
asked about:

| Especially to tkuhn(_at_)qno(_dot_)de and thomas(_dot_)kuhn(_at_)qno(_dot_)de 
the recipe fits.
| But now the problem: My own address christian(_dot_)kuhn(_at_)qno(_dot_)de 
fits the
| recipe as well.

No, it doesn't, because ^TO_ will not match a string that ends in a letter of
the alphabet, a digit, nor a hyphen (and perhaps not in an underscore either).
Since the last character of the match to ^TO_ cannot be an S, that recipe will
not catch "To: christian(_dot_)kuhn(_at_)qno(_dot_)de".

Do remove that second colon, since you don't need a local lockfile there and
since requesting one without a name (where procmail can't come up with its own
name for it) will generate an error.  As to the other problem, well, we can
cross that bridge when we come to it.







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

<Prev in Thread] Current Thread [Next in Thread>