procmail
[Top] [All Lists]

Re: Q's for Quick Start: ^TO, ^TO_, .forward, LDA, MDA, MTA

1999-08-20 10:39:03
Nancy asked,

| Question: Is there ever a situation where one would want to use ^TO
| rather than ^TO_ (other than you're using an old procmail that
| doesn't have ^TO_)?

One, at least: if the text on the condition line after ^TO can follow
a hyphen.  ^TO_ will not match a string ending in a hyphen.

So if you are looking for the second part of an address that might be
preceded by owner-, return-, errors-, bounce-, or such, ^TO will match
but ^TO_ will not.

^TO_-? or ^TO_- won't match there either, because the character before the
hyphen is a letter of the alphabet, and ^TO_ won't match a string ending in
a letter of the alphabet.  I guess that ^TO_(.*\<)? would work, though, but
if one needs to do that, half the value of having a token has been lost.

When Stephen was considering a new value for ^TO that would not match on
a string that ended in a hyphen, I brought up that problem.  He decided
that ^TO should have been named ^TO_ in the first place, so he left ^TO
as it was (so that existing code that tries to match strings ending in
hyphens would not break) and added ^TO_.

| And now a completely new question: In Era's great FAQ, he says:
| 
|  If your MTA is not Sendmail, something reasonably simple like
| 
|         "|/usr/local/bin/procmail -f"
| 
| I'm wondering why this command isn't
| 
|         "|/usr/local/bin/procmail -f-"

Must be a typo.  -f needs an argument, which can be -, so -f- is all right
but -f alone is wrong and gives me a "missing name" error message.