Jaroslaw Rafa:
> Hello,
> I want to do sender address rewriting on outgoing mail similar to what
> sender_canonical_maps does, but only for mail that is sent to one
> particular domain (for example gmail.com). If the mail has no recipients in
> that domain, rewriting should not be done.

In master.cf, configure a dedicated SMTP delivery agent with a
"-o smtp_generic_maps=maptype:mapname" override.

Use transport_maps to select that delivery agent for deliveries to
the domain that needs address rewriting.

This rewrites {envelope, header} {sender, recipient} addresses.

See also: https://www.postfix.org/SOHO_README.html#fantasy for
the primary use case of smtp_generic_maps.

        Wietse

> The rewriting should happen both for mail that is submitted locally via
> /usr/sbin/sendmail and for mail that is submitted from SMTP clients.
> 
> Is it possible to do it using only Postfix configuration directives or do I
> need to use a milter for this?
> -- 
> Regards,
>    Jaroslaw Rafa
>    r...@rafa.eu.org
> --
> "In a million years, when kids go to school, they're gonna know: once there
> was a Hushpuppy, and she lived with her daddy in the Bathtub."
> 

Reply via email to