Viktor Dukhovni: > On Tue, Feb 22, 2022 at 10:16:26AM +0100, V?ctor Rubiella Monfort wrote: > > > Next test should be test to add all-accounts to alias maps: > > > > virtual_mailbox_maps: > > h...@example.com maildir1/ > > ad...@example.com maildir2/ > > > > virtual_alias_maps > > @example.com h...@example.com > > h...@example.com h...@example.com > > ad...@example.com ad...@example.com > > > > .. > > > > This is the correct way? > > Yes, but with all those rewrites in virtual alias maps, you no longer > need the virtual_mailbox_maps entries. They'd only be used for > recipient validation, for which the virtual alias entries are > sufficient. > > > Is t really necessary to duplicate all existing account on aliases > > with A A keyvalues? > > No, you can leave virtual_mailbox_maps empty if you're not using the > virtual(8) delivery agent, and using lmtp(8) to Dovecot instead. > > > Isn't there a cleaner way to only match the non-existent ones? > > No, but duplication is not needed, and if it were, you could always > use "make" or similar to construct one of the tables from the other.
For a solution without email addresses in virtual_xx_maps, see https://doc.dovecot.org/configuration_manual/howto/postfix_dovecot_lmtp/ This uses reject_unverified_recipient to discover what users exist. The webpage is not complete, but this may help: virtual_mailbox_domains = example.com virtual_mailbox_maps = inline:{{@example.com = whatever}} virtual_transport = lmtp:unix:private/dovecot-lmtp smtpd_recipient_restrictions = ... reject_unauth_destination, reject_unverified_recipient Corrections are welcome. Wietse