procmail
[Top] [All Lists]

Re: Argh! Why is procmail doing this?

1998-12-03 15:39:28
You need one more level of parens around the subject strings (and can
afford to lose the quoting of each substring).

By quoting, I assume you the inner parens.

Yes, sorry about that. I did mean the inner parens. When the documentation
and code differ, the code is always right, even if it does the wrong
thing.

Do you really receive these messages with zeroes instead of letter
'O'?

Yes, sadly.  People trying to be clever.

My spam filters are littered with [0o] wherever an alpha oh is reasonable. I 
guess I have less inventive friends and cow-orkers than you.

1. If you mean to use the ^TO token, and not simply to match 'To' at the
   beginning of the line, the ' .*' is unnecessary, and possibly incorrect
   (because of the space -- I'm too lazy right now to test it, but don't
   let that stop you from testing it). If you don't intend the ^TO token,
   use '^To: .*' or (preferably) something tighter to prevent matching
   liamcampbell(_at_)s-1-community(_dot_)net(_dot_)

Well, what I *DO* want is to filter out these mail that are going
specifically TO me rather than the ones going to "allcompanies",
"softops", "secondfloor", etc.  Am I doing this incorrectly?

Your use of ^TO was incorrect, or at least not idiomatic. The expansion of
that token terminates in a more refined version of '.*\<' (man procmailrc
for details), and should be followed directly by the address for which you
are testing. If you have procmail version 3.11pre4 or later, you can
instead use ^TO_, which is designed to better trap a destination containing
a specific address, instead of ^TO, which is better suited to trap a
destination containing a specific word.


4. You may also want to check for tabs where you check for
   spaces. Simply replace each space in the regexps with [ ]
   (enclosing a space and a tab).

Other people have told me this too, and I understand the logic behind
it, but to date (after some number of years of using procmail on and
off), I can't remember ever having been bitten by this.

I have had mail with a tab and no space in the date header after Date:,
and mail with tabs throughout the subject header, but that is all. I
would claim that one should always code defensively, but some here have
seen my code.

Many thanks to all that have responded; as was pointed out, it was my
misunderstanding of the precedence of or and concatenation.

And the answer to you original question is that there was probably a '000'
in some header.

-- 
Rik Kabel          Old enough to be an adult              
rik(_at_)netcom(_dot_)com