I have a working Postfix setup where I can deliver incoming mails to both a Dovecot mailbox, and forward on those mails to an external address. However, this doesn't feel right, and I'd appreciate a sanity check.
The Postfix main.cf
includes both virtual_alias_maps
and virtual_mailbox_maps
. Assume that I'm handling mails for [email protected]
, and that
- These emails have to be delivered to Dovecot mailbox
mbox
, and
- These emails must also be forwarded to
[email protected]
In virtual_alias_maps
I originally had:
[email protected] [email protected], [email protected]
And in virtual_mailbox_maps
I originally had:
[email protected] example.com/mbox/
This seemed logical to me, but didn't work. The mails are forwarded to [email protected]
Ok, but Dovecot delivery fails, with a bounce. I managed to fix this by changing virtual_alias_maps
to:
[email protected] [email protected], [email protected]
And changing virtual_mailbox_maps
to:
[email protected] example.com/mbox/
I'm not really happy with this because it doesn't seem to fit in with any documentation I've found. As far as I can see, virtual_mailbox_maps
is meant to map an address to a mailbox, and not a mailbox to a mailbox. Am I doing this the right way, or is there a better way to do this?