procmail
[Top] [All Lists]

Re: Blocking "re: ]"

2004-07-28 12:11:23
Scott told Priscila,

Because ']' is a special character to procmail, you'll need to escape
it somehow.  These will both work:

 * ^Subject:.*re: (])$
 * ^Subject:.*re: \]$

No, that's not it. The right bracket is special only if there's been a left bracket to start a character class description (and not always then). There's something else going on. (If that were the problem, I'm not so sure that parentheses would have helped anyway, though a backslash certainly would.)

Priscila, my guesses are

1. The invisible text between "re:" and the right bracket isn't exactly one space; it might be multiple spaces or a tab.

2. The condition was right-anchored; maybe there's more whitespace after the right bracket.

So I'd suggest

 :0:
 * ^Subject:.*re:[      ]+]
 re-right-bracket

(I agree with the other poster's advice not to send them to /dev/null until everything's debugged.)

Between the left bracket and the first right bracket (which *is* special) are a space and a tab. If escaping the literal right bracket makes you more comfortable, it doesn't hurt:

 :0:
 * ^Subject:.*re:[      ]+\]
 re-right-bracket

but it isn't necessary.


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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