Victor Duchovni:
> On Fri, Mar 06, 2009 at 01:16:07PM -0600, Nate Carlson wrote:
> 
> > On Fri, 6 Mar 2009, Noel Jones wrote:
> >> Victor Duchovni wrote:
> >>> Probably want a ":" in there to make it a valid header:
> >>> header_checks.pcre:
> >>>     if /^Received:/
> >>>     /\n\tby (smtp\.example\.com \(Postfix\) with ESTMPS?A id \w+)/
> >>>         REPLACE X-Submitted: to $1
> >>>     endif
> >> Yes, thanks.
> >
> > I extrapolated from this, and got something that works perfectly - thanks 
> > so much!
> >
> > if /^Received:/
> > /.*by (hostname \(Postfix\) with ESMTPS?A).*/
> >         REPLACE X-Submitted: to $1
> > endif
> 
> Replace the ".*" with "\n\t" or "\012\011" if not PCRE and you
> are losing the queue-id, which is very useful for later trouble-shoots.

The .* are always unnecessary at the start and end of a pattern.

Also, he is replacing the entire header, not the middle portion.
Therefore the following will suffice:

if /^Received:/
/\s+(host\.example\.com \(Postfix\) with ESMTPS?A id \w+)/
         REPLACE X-Submitted: to $1
endif

        Wietse

Reply via email to