On Sat, Nov 29, 2008 at 10:24:25PM -0600, Noel Jones wrote:

> john mickler wrote:
> >
> >As for the newline insertion mentioned on the website, I'm wondering
> >if using a pcre instead of standard regex would allow this.  I'm going
> >to translate and give it a try.
> 
> Don't bother.  The postfix REPLACE action does not support 
> newlines in headers regardless of the map type used.
> 
> The only possible "workaround" is to add code to postfix 
> supporting multi-line header insertion.

It should work if the newline is part of a ${n} sub-pattern match:

    # ${3} matches Newline + folding white-space
    /^(Received): (.*?)(\n[\t\x20])(.*)$/
            ${1}: ${2}${3}(my comment)${3}${4}

With test.pcre containing the above, "postmap -q" yields:

    $ postmap -q "$(printf "Received: %s\n\t%s\n" abc def)" pcre:test.pcre
    Received: abc
            (my comment)
            def

showing the insertion of an additional line into the header. What is not
possible is the insertion of a literal newline in the Postfix replacement
text in indexed file, regexp table or policy service lookups.

-- 
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:[EMAIL PROTECTED]>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.

Reply via email to