postfix-users March 2012 archive
Main Archive Page > Month Archives  > postfix-users archives
postfix-users: Re: address rewriting

Re: address rewriting

From: Wietse Venema <wietse_at_nospam>
Date: Sun Mar 04 2012 - 14:14:34 GMT
To: Postfix users <postfix-users@postfix.org>

dino muzic:
> 2) outside => postfix => inside server
> doesn't, because generic is rewriting user1@mydomain.local back
> to user1@mydomain.com before relaying it to inside server

Postfix uses different SMTP mail delivery agents for inbound mail
and outbound.

If the destination is in relay_domains, Postfix uses the "relay"
service in master.cf. This is what you should use for "inbound"
mail.

If the destination is NOT in relay_domains, Postfix uses the "smtp"
service in master.cf. This is what you should use for "outbound"
mail.

Therefore, you must apply generic mapping ONLY on the "smtp" service,
not on the "relay" service.

/etc/postfix/master.cf:
    smtp unix - - n - - smtp
        -o smtp_generic_maps=maptype:mapname
    relay unix - - n - - smtp

        Wietse