Yves Kreis:
> On 11.03.2009, at 11:49, Wietse Venema wrote:
> 
> > Yves Kreis:
> >> Dear,
> >>
> >> Can I use a canonical map like:
> >> if /^To: u...@domain\.com$/
> >> /^From: (".*" )*(.+)@(.+)$/ From: ${1}${2}+$...@anotherdomain.com
> >> endif
> >
> > Dear Yves, please RTFM the pcre_table manpage.
> >
> >       if /pattern/flags
> >
> >       endif  Match the input string  against  the  patterns   
> > between  if  and
> >              endif,  IF  AND ONLY IF THAT SAME INPUT STRING ALSO  
> > MATCHES PAT-
> >              TERN. The if..endif can nest.
> 
> Sorry, I overlooked this. Can I parse the whole headers at once, i.e.  
> use something similar without the ^ and $ or are the headers feeded  
> into the canonical map line by line?

This is documented in header_checks.

        Wietse

HEADER_CHECKS(5)                                              HEADER_CHECKS(5)

NAME
       header_checks - Postfix built-in content inspection

SYNOPSIS
       header_checks = pcre:/etc/postfix/header_checks
       mime_header_checks = pcre:/etc/postfix/mime_header_checks
       nested_header_checks = pcre:/etc/postfix/nested_header_checks
       body_checks = pcre:/etc/postfix/body_checks

       postmap -q "string" pcre:/etc/postfix/filename
       postmap -q - pcre:/etc/postfix/filename <inputfile

DESCRIPTION
       ...
       Note: message headers are examined one logical header at a  time,  even
       when a message header spans multiple lines. Body lines are always exam-
       ined one line at a time.

Reply via email to