procmail
[Top] [All Lists]

Re: I can't explain this, it's just weird!

2007-06-05 01:37:11
Stephen Allen writes:
In both my procmail recipe files, I define white space, like this:

    SPACE   = ' '
    TAB     = '     '
    WS      = "$SPACE$TAB"

In one recipe files, I use the following condition, which successfully
matches against the mailbox.

    * ^X-Original-To:[$WS]*\/[^(_at_)]+

In the other recipe file, I use a similar condition, which won't match
at all.

    * ^X-Original-To:[$WS]*help_please(_at_)mydomain\(_dot_)tld


Might try:

    * $ ^X-Original-To:[$WS]*help_please(_at_)mydomain\(_dot_)tld

(notice the addition of the '$' symbol in the condition, enabling
variable substitution in the condition.) Also, a record in an SMTP
header can span lines, so:

    #
    # Folded whitespace, (the characters between the block braces are a
    # tab character, hex 09, followed by a space character, hex 20):
    #
    WS='[        ]*($[   ]+)*'

is a better white space regular expression, in which case, the
condition would be:

    * $ ^X-Original-To:${WS}help_please(_at_)mydomain\(_dot_)tld

      John

-- 

John Conover, conover(_at_)rahul(_dot_)net, http://www.johncon.com/
____________________________________________________________
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