[Top] [All Lists]

Re: Rule not being honored. Why?

2009-02-10 16:46:07
At 14:45 2009-02-10 -0600, Christopher L. Barnard wrote:

Doesn't a dot expand to one or more characters other than newline?  Then
that would be what I want.  If I have it only accept space or tab before
the string then, as you say,
would not be accepted.  But if I want the rule to accept any line with
"L700 NetBackup" anywhere in it, then it should be as I wrote... Or am I
missing something?

Yea, the "zero or more" wildcard modifier:  *

* ^Subject:.*L700 NetBackup

a dot by itself is any one character. A dot followed by an asterisk is "zero or more of any character".

Subject:L700 NetBackup
Subject: L700 NetBackup
Subject: Re: error with backup (was L700 NetBackup)

would all match

* ^Subject:[    ]*L700 NetBackup

would match only those messages where the subject starts with L700 NetBackup - nothing but (optional) whitespace would be allowed between the Subject header and the specified text. Thus, someone else who might receive the message and reply to you:

Subject: Re: L700 NetBackup

would NOT end up being matched (but then, based on the other condition anchored on the From:, someone elses's reply wouldn't match anyway).

My original suggestion included using a space+tab character class:

* ^Subject:[    ]*L700 NetBackup

You might want to read up on regexps. Besides manpages, and web resources, there's an excellent ORA book on regexps. If you don't have a reasonable regexp foundation, then much of what you do with procmail is going to be clumsy and error prone.

Kind of like handing a carpenter a scalpel and having him perform open heart surgery, but probably not as dire. Depends upon how important you view email.

 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

procmail mailing list   Procmail homepage:

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