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 pg@example.com
, and that
- These emails have to be delivered to Dovecot mailbox
mbox
, and - These emails must also be forwarded to
pg@foo.com
In virtual_alias_maps
I originally had:
pg@example.com pg@example.com, pg@foo.com
And in virtual_mailbox_maps
I originally had:
pg@example.com example.com/mbox/
This seemed logical to me, but didn't work. The mails are forwarded to pg@foo.com
Ok, but Dovecot delivery fails, with a bounce. I managed to fix this by changing virtual_alias_maps
to:
pg@example.com mbox@example.com, pg@foo.com
And changing virtual_mailbox_maps
to:
mbox@example.com 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?