procmail
[Top] [All Lists]

Re: Walking down the chain of "Received: from" headers

1999-07-12 09:37:01
I had written,

| > Walter Dnes had a bunch of conditions beginning like this:
| >
| >   * ^^.*$+rest_of_regexp

... which I misread as ^^(.*$)+ when I was responding before... sigh.

| > ... and the regexp was one that couldn't match on the
| > first line

and Walter asked me,

|   Are there any instances where a message wouldn't begin
| with something like "From foo(_at_)bar" in the first line?  If
| so, your concern would be valid.  My filters are intended
| for use with sendmail and/or Exim if it makes any difference.

Well, whatever you have in "rest_of_regexp" won't match if it occurs only in
the top line, because you're expecting at least one newline before it, and
with "^^" there, "$" won't be able to match the opening putative newline.

If the expression were

   .*$+rest_of_regexp

without ^^, then .* could match nothing, $+ could match the opening putative
newline, and rest_of_regexp could match the very first real contents of the
search area.

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