On Sat, Oct 10, 2020 at 05:15:37PM +0200, Marek Kozlowski wrote:
> Is it possible to accept mail if the recipients address is found in
> virtual_alias_maps and reject in all other cases? Let's imagine I have
> two entries for virtual_alias_maps:
Following http://www.postfix.org/MULTI_INSTANCE_README.html#quick
mydestination =
local_transport = error:5.1.1 Mailbox unavailable
alias_database =
alias_maps =
local_recipient_maps =
Then:
indexed = ${default_database_type}:${config_directory}/
myorigin = example.com
virtual_mailbox_domains = example.com, example.net, ...
# You could instead use LMTP to deliver to Dovecot's or similar
# LMTP server. In this case, virtual_mailbox_maps RHS value is
# not significant, any non-empty value indicates a valid user.
# Also in the same case, the uid and gid maps are not used.
#
virtual_transport = virtual
virtual_mailbox_maps = ${indexed}vmbox
# Set uid/gid to IMAP server account
virtual_mailbox_uid_maps = static:12345
virtual_mailbox_gid_maps = static:12345
Tables:
vmbox:
# Set path layout to match IMAP server configuration
[email protected] /var/spool/virtual/example.com/user1/
[email protected] /var/spool/virtual/example.net/user2/
You could of course add an intermediate mapping via virtual(5), and have
just a single virtual mailbox domain, with the various domains in
virtual alias domains, and something "virtual.invalid" as the mailbox
domain, but it is not clear that the indirection is needed in your
case.
--
Viktor.