Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sender_canonical_maps for incoming e-mails

84 views
Skip to first unread message

Nicolás

unread,
Jan 19, 2016, 12:14:11 PM1/19/16
to
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 <user...@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 user...@xyz.com? Am I missing
something?

FWIW, this is Postfix v. 2.9.6-1.

Thanks.

Wietse Venema

unread,
Jan 19, 2016, 1:37:39 PM1/19/16
to
Nicol?s:
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

nic...@devels.es

unread,
Jan 20, 2016, 4:24:18 AM1/20/16
to
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

Wietse Venema

unread,
Jan 20, 2016, 6:15:06 AM1/20/16
to
nic...@devels.es:
> > 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?

"static:all" matches everything (see man 1 postconf). For other details
see http://www.postfix.org/postconf.5.html#local_header_rewrite_clients

Wietse

0 new messages