Subject: Re: .procmailrc problems?

From: [email-masked] (David W. Tamkin)
Date: Fri, 24 Mar 1995 13:37:50 -0600 (CST)

David Anyadike wrote,

| #_Rule 
| : 1 :
| ^Subject.*[FEMUSCLE]*
| FEMUSCLE

| What is happening is EVERYTHING is going into the FEMUSCLE folder.

Not everything ... only letters that have subject lines.  Your search
expression is faulty because (1) brackets are magic unless escaped, (2)
you're searching unnecessarily for an unspecified trailer, and (3) you're
mixing shell globbing pattern syntax into a regular expression when you
do #2.  #2 without #3 would be harmless, but #3 makes #2 a problem, and
together they make #1 a bigger problem.

You're asking procmail to look for mail in which a header line starts
(without regard to case of alphabetics) with "Subject:", followed by
anything or nothing (".*") followed by zero more more (the trailing
asterisk) f's, e's, m's, u's, s's, c's, l's, or (repetitively) e's.

Any subject header at all starts with "Subject:" and has that followed
by anything or nothing plus any or none of those letters, even if there
is nothing after the colon at all.  If there is no subject header, or
if there is space between "Subject" and the colon, then a letter can get
past that recipe.  (It's up in the air, apparently, whether space between
the name of the header and the colon is legal.)  If it weren't for the
trailing asterisk (#2 compounded by #3), problem #1 alone would cause that
recipe to catch any letter whose subject contained an f, an e, an m, a u,
an s, a c, or an l, but a letter whose subject line has none of those letters
would get past the recipe.

I'm assuming that you're using an old version that doesn't understand
asterisks, so try this instead:

 # defusing left bracket makes right bracket literal
 :: # 1 is the default
 ^Subject:.*\[FEMUSCLE]
 FEMUSCLE

---

From: [email-masked] (David W. Tamkin)
Date: Fri, 24 Mar 1995 17:14:50 -0600 (CST)

I wrote in answer to David Anyadike's question,

| You're asking procmail to look for mail in which a header line starts
| (without regard to case of alphabetics) with "Subject:", followed by
| anything or nothing (".*") followed by zero more more (the trailing
| asterisk) f's, e's, m's, u's, s's, c's, l's, or (repetitively) e's.

That should be just "Subject" because David's original recipe did not have a
colon in it after all.  Sorry for careless reading.  So here are my other
corrections:

| Any subject header at all starts with "Subject:" and has that followed
| by anything or nothing plus any or none of those letters, even if there
| is nothing after the colon at all.

Make that 

  Any line in the head that starts with "Subject" will cause a match to your
  condition, regardless of what, if anything, is on the rest of the line.

| If there is no subject header, or
| if there is space between "Subject" and the colon, then a letter can get
| past that recipe.  (It's up in the air, apparently, whether space between
| the name of the header and the colon is legal.)

should read

  If there is no subject header, then a letter will fail that recipe.

|  # defusing left bracket makes right bracket literal
|  :: # 1 is the default
|  ^Subject:.*\[FEMUSCLE]
|  FEMUSCLE

That suggestion I'll leave unchanged; I think it's a good idea to include
the colon.  Otherwise, sorry for the goof.