Discussion:
Send specific addresses to other relay hosts
(too old to reply)
Drew Mazurek
2012-04-04 18:03:02 UTC
Permalink
We have an environment with two tiers of mail servers. The outer Postfix
servers receive mail for our entire domain and handle delivery for certain
addresses. Other specific regexp addresses at the same domain need to be
passed to different internal SMTP servers. Anything else must be bounced
by the outer servers. This seems like it should be easy to do (it's
basically the equivalent of sender_dependent_relayhost_maps, but for
recipients), but looking through the documentation and experimenting with
different configurations, I haven't been able to make it happen. The most
promising settings result in "Recipient address rejected: User unknown in
local recipient table". How can I get this set up?

Thanks,
Drew
Wietse Venema
2012-04-04 18:20:45 UTC
Permalink
Post by Drew Mazurek
We have an environment with two tiers of mail servers. The outer Postfix
servers receive mail for our entire domain and handle delivery for certain
addresses. Other specific regexp addresses at the same domain need to be
passed to different internal SMTP servers. Anything else must be bounced
by the outer servers.
Use the firewall/gateway example in
http://www.postfix.org/STANDARD_CONFIGURATION_README.html#firewall
to configure the domain as a relay domain.

Use virtual_alias_maps (NOT VIRTUAL ALIAS DOMAINS) to deliver some
addresses locally. See
http://www.postfix.org/STANDARD_CONFIGURATION_README.html#some_local

Wietse
Wietse Venema
2012-04-04 18:49:13 UTC
Permalink
Post by Wietse Venema
Post by Drew Mazurek
We have an environment with two tiers of mail servers. The outer Postfix
servers receive mail for our entire domain and handle delivery for certain
addresses. Other specific regexp addresses at the same domain need to be
passed to different internal SMTP servers. Anything else must be bounced
by the outer servers.
Use the firewall/gateway example in
http://www.postfix.org/STANDARD_CONFIGURATION_README.html#firewall
to configure the domain as a relay domain.
Use virtual_alias_maps (NOT VIRTUAL ALIAS DOMAINS) to deliver some
addresses locally. See
http://www.postfix.org/STANDARD_CONFIGURATION_README.html#some_local
If you're using different inside hosts, this would also require
transport_maps settings to tell postfix which recipients go where.

There is one simpler approach, but this requires that your inside
servers accept mail for ***@hostname.domain.

1 - Leave mydestination empty.

2 - Make example.com a virtual alias domain:

/etc/postfix/main.cf:
virtual_alias_domains = example.com
virtual_alias_maps = hash:/etc/postfix/example.com

3 - List all recipients in virtual_alias_maps:

/etc/postfix/example.com:
# User that delivers locally
***@example.com ***@localhost

# User that delivers on internal server
***@example.com ***@host.example.com

Instead of hash: file, you would use LDAP or *SQL.

Wietse
j***@rcsdk8.net
2018-05-17 15:48:32 UTC
Permalink
Post by Wietse Venema
Post by Wietse Venema
Post by Drew Mazurek
We have an environment with two tiers of mail servers. The outer Postfix
servers receive mail for our entire domain and handle delivery for certain
addresses. Other specific regexp addresses at the same domain need to be
passed to different internal SMTP servers. Anything else must be bounced
by the outer servers.
Use the firewall/gateway example in
http://www.postfix.org/STANDARD_CONFIGURATION_README.html#firewall
to configure the domain as a relay domain.
Use virtual_alias_maps (NOT VIRTUAL ALIAS DOMAINS) to deliver some
addresses locally. See
http://www.postfix.org/STANDARD_CONFIGURATION_README.html#some_local
If you're using different inside hosts, this would also require
transport_maps settings to tell postfix which recipients go where.
There is one simpler approach, but this requires that your inside
1 - Leave mydestination empty.
virtual_alias_domains = example.com
virtual_alias_maps = hash:/etc/postfix/example.com
# User that delivers locally
# User that delivers on internal server
Instead of hash: file, you would use LDAP or *SQL.
Wietse
Thanks Wietse, great tool and your tip is still relevant in 2018 :)
--
This is a staff email account managed by Redwood City School District. This
email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the sender.
Loading...