procmail
[Top] [All Lists]

Re: Can not get a filter recognised for one email source

2011-02-16 10:09:37
At 07:10 2011-02-16, N.J. Mann wrote:
With a regexp of
  ^From: .*Debra
it will not match
  from: Debra(_at_)emblibrary(_dot_)com
because it is expecting 'from:' followed by one space, followed by one
'any' character, followed by zero or more 'any' characters,

WRONG.

First, Procmail is case insentitive unless told otherwise (via a recipe flag), so, From/from doesn't matter one iota. It also does not "ignore" headers that don't conform to the first-character-capitalized format.

Second, the * is a count modifier, which modified the immediatley preceeding regexp (in this case, dot, which is a single character wildcard): .* means zero or more of any character. It DOES NOT mean, precisely one character, followed by zero or more of anything. Therefore space dot star WILL match a space, or ten spaces, or a space followed by a name, or whatever. It is not the same as dot star, because it enforces that the first character must be a space. I don't see this as a problem, though certainly a lot of people might choose to omit the space as a requirement, as the colon itself is the demarc between the header name and the content (exception: the ^from_ line, which uses a space - but then, you'd be specifying the space in place of the colon anyway).


OP: I've got to wonder - are these headers perhaps appearing in a digest? So, you're seeing them in the MBX, but they're really not standalone messages - there's a true set of headers somewhere above?

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

____________________________________________________________
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