On Fri, Jun 11, 2021 at 02:47:40PM -0700, [email protected] wrote:

> Can I use a smtp_generic_map rewrite to do something like this??
> 
> @local.domain      [email protected]

I will make a bold guess that the real problem you're trying to solve
dealing with mail from "root" and similar system users, where in a
network of null-client hosts delivering all mail to a central mail hub,
you want the sender address to clearly reflect where the mail came from.

See: http://www.postfix.org/MULTI_INSTANCE_README.html#split for a walk-
through of how to configure such null-client instances.

If you really want to do this for arbitrary sender local parts, you'll
need a regexp or pcre table, and for bonus points some care to get it
right for quoted local-part addresses.

    /^"(.*)"@local\.domain$/    ${1}[email protected]
    /^(.*)@local\.domain$/    ${1}[email protected]

But, unless you have "-" as your recipient delimiter on the central
mailhub, the resulting sender address is invalid, which is best avoided.

-- 
    Viktor.

Reply via email to