Hi,
I have a postfix setup which has several domains hosted using virtual
alias domains/maps, the maps resolve the accounts to internal mailbox
addresses which have their own transport configured.
Recently one of the hosted domains configured an e-mail security
gateway, which uses a third-party MX server to receive the messages,
filter the content and then they relay it to my server, the problem I
noticed is that, when a different domain hosted in the same instance
sends a message to it, postfix resolves the MAIL TO address locally
using the maps and directly delivers the message without relaying it to
the external gateway.
For example: both b...@domain-a.com and al...@domain-b.com are virtual to
this instance and the configured virtual alias map resolves them to
b...@local-mailbox.com and al...@local-mailbox.com respectively;
local-mailbox.com uses the lmtp transport to deliver the message to the
mailboxes.
Currently, when b...@domain-a.com sends a message to al...@domain-b.com,
it never leaves the instance, al...@domain-b.com is rewritten by qmgr to
al...@local-mailbox.com before the delivery happens and the message goes
straight to the destination's mailbox.
What i expected to happen is that, when b...@domain-a.com sends a message
to al...@domain-b.com, as the message is entering through a submission
smtpd, it should not rewrite it and always relay the message to the
destinations MX, even if it has to reconnect to my own MX smtpd.
I spent a few days reading postfix's documentation looking for a
solution that could make all "outgoing" messages to leave the instance
and be relayed to their MX server, i tried to set up an empty
virtual_alias_domains/maps for the smtpd that handles submission while i
kept the default one in the smtpd that is the MX and it didn't work.
I also tried configuring different cleanup and trivial-rewrite daemons
for them (also with empty virtual_alias_domains/maps), but in the end
qmgr's trivial-rewrite always rewrites the destination.
In conclusion: i can't remove the virtual alias domains/maps from qmgr's
trivial-rewrite as the local domains would stop receiving e-mail in
their mailboxes, but if i keep it, it resolves destinations locally in
every occasion.
Am I missing something in the docs? Is there a way for qmgr to use the
virtual alias maps/domains only when the message was received from a
specific source (that would be the MX smtpd and not the submission smtpd)?
The only solution that i could think of was to use different qmgrs for
local submission and external reception by MX, and it seems to me that
the right way to do this would be by configuring two different postfix
instances (which I'm trying to avoid).
Thanks,
--
Gustavo Balduino