On Mon, Sep 27, 2010 at 12:12:55PM +0200, Markus Meyer wrote:
> Hello all,
>
> I have a problem with a specific regex in a PCRE-map.
>
> This is my setup:
>
> Postfix version(packet from the Debian Lenny):
> # dpkg -s postfix | grep ^Ver
> Version: 2.5.5-1.1
>
> main.cf
> =======
> local_header_rewrite_clients = permit_inet_interfaces, permit_mynetworks
> recipient_canonical_maps = pcre:/etc/postfix/pcre-recipient_canonical
>
> The map contains:
> =================
> # cat /etc/postfix/pcre-recipient_canonical
> /^[[:alnum:]]{7}-0xrockindahouse0x-(....@.+)$/ $1
>
> The map works quite well, except with some quirky but valid(AFAIK) email
> addresses. If there is a dot directly before the '@' or two dots in the
> address the regex doesn't work. Meaning the rcpt_to is not rewritten.
Such addresses MUST be quoted to be RFC-compliant, for example:
"This-is-a-silly-address."@example.com
Don't use these, or add another form of the regex for quoted strings:
/^"[[:alnum:]]{7}-0xrockindahouse0x-(.+)"@(.+)$/ "$1"@$2
/^[[:alnum:]]{7}-0xrockindahouse0x-(.+)@(.+)$/ $...@$2
--
Viktor.