Matus UHLAR - fantomas via Postfix-users:
out customer reported that they started migrating users to 365 services
(yeah, after they started).
[snip]
I tried to use fallback_transport and/or fallback_transport_maps
to ensure all mail with non-existing local users is forwarded to remote
destination:
t...@example.com relay:[example-com.mail.protection.outlook.com]
May 29 18:46:09 mail postfix/local[2207]: 4b7XLn4zwqzKsZS:
to=<t...@example.com>, relay=local, delay=0.16, delays=0.06/0.01/0/0.09,
dsn=5.1.1, status=bounced (unknown user: "test")
On 29.05.25 14:40, Wietse Venema via Postfix-users wrote:
fallback_transport_maps is searched with the local part not localpart@domain.
However, fallback_transport_maps is not a good way to match unknown users.
allback_transport would be better.
I wanted to test for single user first, and single domain later -
there are two different domains in $mydestination and the client only
configured addresses in one of them on 365.
If only local part is searched, I'll have to tell the client to either treat
both domains the same, expect mail to be undelivered, or do it the another
way Victor proposed.
But if only the localpart is searched, how is mail the recipient passed to
the transport, do I have to add the domain again?
(through separate postfix instance?)
Don't forget to "postfix reload" after changing this setting.
done.
On 30.05.25 12:58, Viktor Dukhovni via Postfix-users wrote:
Personally, I would flip this configuration around, and treat the domain
as a relay domain by default, rewriting the *known* local users to an
internal form that is passed to the local(8) delivery agent (if that's
how mail delivery happens, though I'd usually go with virtual mailboxes
via LMTP or virtual(8)).
This was one of possibilities I was thinking of, but I find it more
complicated with more ways to mess up the migration.
I'd have to alias all local accounts and aliases to new domain.
I can use proxy.example.com and add it to $mydestination instead of
example.com,
The upside would be that I can only work with one of local domains used.
Thanks for advices.
main.cf:
myorigin = $mydomain
relay_domains = some.example
# Specify actual list, if known.
relay_recipient_maps =
transport_maps = inline:{ {local.invalid = local} }
indexed = ${default_database_type}:${config_directory}/
virtual_alias_maps = ${indexed}valias
# Avoid automatic relay subdomains, if desired, add: smtpd_access_maps
#
parent_domain_matches_subdomains =
# Empty $mydestination, all local(8) delivery is via virtual aliases!
#
# Note however, that when $myorigin is not listed in $mydestination,
# unqualified addresses in the RHS of local aliases(5) are no
# longer "local" recipients, so may need to be qualified with
# a domain that does resolve to the local(8) transport.
#
# local-alias: user1@local.invalid, user2@local.invalid
#
# However, this is only necessary when there are potential
# "loops" in the alias "graph" with "A" forwarding (perhaps
# indirectly) to "B" and "B" back to "A". Also I strongly
# recommend managing aliases in virtual(5) and using aliases(5)
# only for ":include:/list/file", "owner-alias" or similarly
# "special" mechanisms that can't be handled via virtual(5).
#
mydestination =
# All local recipients are listed in virtual(5), the local
# recipient table is defined, but effectively empty.
#
local_recipient_maps = inline:{ {@ = not a lookup key} }
valias:
# Known local recipients and aliases
moe@some.example moe@local.invalid
larry@some.example joe@local.invalid
curly@some.example curly@local.invalid
everyone@some.example all-some.example@local.invalid
...
aliases:
owner-all-some.example: postmaster@some.example
all-some.example: :include:/var/db/all-some.example
--
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
My mind is like a steel trap - rusty and illegal in 37 states.
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org