I want to translate a domain (foo.myohiovalley.net) to another domain (
myohiovalley.net) such that for all users (xy...@foo.myohiovalley.net) they
will be delivered (I'm using virtual_mailbox_domains, etc) as in the target
domain (xy...@myohiovalley.net).  I thought this would be accomplished by
putting "foo.myohiovalley.net" in virtual_alias_domains and mapping "
foo.myohiovalley.net" to "myohiovalley.net" in virtual_alias_maps.  But that
isn't happening as expected.  I tried mapping an actual user "
xy...@foo.myohiovalley.net" to "xy...@myohiovalley.net" and that actually
did work.  But I want to do this by domain name only so I don't end up with
<number_of_domains> times <number_of_users> mapping entries.

I thought virtual_alias_domains would do this because it is documented with
the wording "or domain" but on 2nd reading I guess that is still translating
to a u...@domain, where if USER is missing in the map result, it forms an
incomplete address (e.g. it doesn't carry over the original username
unchanged ... which is what I want to do).

Is there a way to just list a set of domains, and what domain to translate
only the domain part to, keeping the original username unchanged (at least
unchanged in this map)?

Note, there will be a LOT of domain names to be translated.  The
configuration below only shows a couple test domains.

command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
default_destination_concurrency_limit = 2
default_privs = nobody
in_flow_delay = 1s
inet_protocols = ipv4, ipv6
local_destination_concurrency_limit = 2
mail_owner = postfix
mydomain = myohiovalley.com
myhostname = mx.myohiovalley.com
mynetworks = 127.0.0.0/8, 172.30.0.0/16,[::1]/128, [fc00::]/48, [fe80::]/48
myorigin = $mydomain
proxy_interfaces = REDACTED-OUTSIDE-IP-ADDRESS
queue_directory = /var/spool/postfix
recipient_delimiter = -
smtp_bind_address = 172.30.0.25
smtpd_banner = $myhostname ESMTP - unsolicited bulk or illegal email is
prohibited
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated,
reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = none
smtpd_tls_security_level = may
soft_bounce = yes
unknown_local_recipient_reject_code = 450
virtual_alias_domains = foo.myohiovalley.net, bar.myohiovalley.net
virtual_alias_maps = cdb:/etc/postfix/maps/virtual_alias_maps
virtual_mailbox_domains = myohiovalley.biz, myohiovalley.com,
myohiovalley.info, myohiovalley.net, myohiovalley.org, myohiovalley.us
virtual_transport = dovecot

File /etc/postfix/maps/virtual_alias_maps that failed:

foo.myohiovalley.net    myohiovalley.net
bar.myohiovalley.net    myohiovalley.net

File /etc/postfix/maps/virtual_alias_maps that succeeded (but isn't
practical to manage for the real cases because the product of the number of
users and number of domains will become very large):

xy...@foo.myohiovalley.net      xy...@myohiovalley.net
xy...@bar.myohiovalley.net      xy...@myohiovalley.net

Reply via email to