As you already have
example.com as a local domain configured in either
virtual_alias_domains you can't achieve this by also adding it to
Instead, you should add a transport(5) map that can override delivery rules defined by the default
transport:nexthop used by
The optional transport(5) table specifies a mapping from email
addresses to message delivery transports and next-hop destinations.
Message delivery transports such as local or smtp are defined in the
master.cf file, and next-hop destinations are typically hosts or domain
names. The table is searched by the trivial-rewrite(8) daemon.
This mapping overrides the default
transport:nexthop selection that is
built into Postfix.
Add transport_maps to your
transport_maps = hash:/etc/postfix/transport
And then add to
postmap /etc/postfix/transport as you are using
hash, Berkeley DB lookup table.)
This will use default transport rules for all
@example.com and anything else (
*) leaving other delivery configuration as is, but forward all email to
firstname.lastname@example.org to Office 365 via SMTP: the default pattern for Office 365 MX record for companies is
transport_maps is a global solution that will work with any external SMTP server. In a specific scenario, where a) the external account is on Office 365 and b) domain is configured on Postfix
virtual_alias_domains it could also be possible to add a virtual alias redirecting all mail to Office 365 user's initial domain (tenant) address,