Jari Aalto posted,
| o You can avoid multplse and possible expensive FROM_DAEMON tests
| by cacheing the result at the top of your .procmailrc.
Good idea!
| We use a
| little trick here to get more verbose logging. The [^daemon] is
| actually a regexp; which will always match and make procmail to
| log: Match on "[^daemon]".
That will work, as the header will always contain at least one colon (and
some digits too), and you wouldn't apply ^FROM_DAEMON to the body. But ""
is quicker to read in the rcfile and quicker for procmail to match on (as I
understand).
| We could have used from_daemon=".",
| but that wouldn't tell much in condition line log: Match on "."
"" would have the same problem, but you could use "!!", which, like "", is
always a match to any text. It can also be negated, because "!!!" is a
non-match to any text.
| from_daemon = !
|
| :0
| * ^FROM_DAEMON
| {
| from_daemon = "[^daemon]"
or heck, just unset it:
from_daemon
| }
|
| # Later you just use from_daemon like the big brother
| # Match on "[^daemon]"
|
| :0
| *$ $from_daemon
| {
| ..do-it..
| }
|
That will work just fine if the non-daemon value of $from_daemon is null,
unset, or two exclamation points.
As to the matching problem, Era explained that the leading backslash was
the problem. The recommended way to deal with it is to defuse it with an
empty pair of parentheses.