El 2016-01-19 18:37, wie...@porcupine.org escribió:
Nicol?s:
Hi,

We have a filter located outside our organization for outgoing mail
which rewrites the Return-Path to their domain, in the form:
username=abc....@theirdomain.com. Once the filter processes the message,
it's forwarded to the destination where these headers are received:

Return-Path: username=abc....@theirdomain.com
From: Foo <usern...@abc.com>

This destination instance also has this configuration for Postfix:

   sender_canonical_maps = regexp:/etc/postfix/sender_canonical_maps

sender_canonical_maps:
   /^(.*)@abc.com$/   ${1}@xyz.com

What I want to achieve is rewriting sender address when it's received
from a specific domain (concretely, abc.com). As per the
sender_canonical_maps documentation: Optional address mapping lookup
tables for envelope and header sender addresses.

I know the Return-Path doesn't match the regexp, but I believe the From
header does. Why it's not rewritten to usern...@xyz.com? Am I missing
something?

FWIW, this is Postfix v. 2.9.6-1.

By default, Postfix does not rewrite headers from remote clients.
The idea is to avoid breaking DKIM signatures.  This is controlled
with local_header_rewrite_clients.

You may need to specify:

    local_header_rewrite_clients = static:all

Or some other suitable filter.

        Wietse

Thanks, that did the trick.

I'm confused about the following, however. As documented, default value for local_header_rewrite_clients is permit_inet_interfaces. In our case, inet_interfaces = all.

Why does setting static:all explicitly make a difference here?

Regards,

Nicolás

Reply via email to