On 2013-11-11 Christoph Kling wrote:
>> User mappings, including catch-alls, should go into the respective
>> map. In case of virtual mailboxes you must map the catch-all to an
>> existing mailbox in $virtual_mailbox_maps, e.g.:
>> 
>> f...@example.net  example.net/foo
>> b...@example.net  example.net/bar
>> @example.net     example.net/bar
> 
> As described, I don't have any catch-all in virtual_mailbox_maps. What
> I have and what works perfectly is "foo@anotherdomain" in
> virtual_mailbox_maps. It is the only mailbox. Since virtual_transport
> is "dovecot", there is no need to specify the mailbox name here.
> However, if virtual_transport would be "virtual" and if I would
> specify mailboxes here, the problem would be exactly the same.
> 
> The only catch all is in virtual_alias_maps. This catch-all forwards
> all emails from "@domain" to "@anotherdomain", not to a specific user@
> anotherdomain.

Don't do this. Ever. Postfix does not recursively resolve wildcard alias
mappings, so it correctly translates addresses from one domain to the
other, and bounces if the outcome is not a valid mailbox or forward.

Besides, the VIRTUAL_README that I already referred you to clearly
states:

  NEVER put a virtual MAILBOX wild-card in the virtual ALIAS file!!

>> A better approach (unless you really need a catch-all, which I
>> somehow doubt) would be to auto-generate a virtual alias map by
>> reading the virtual mailbox map and creating a mapping for each
>> address found in it:
>> 
>> f...@example.com  f...@example.net
>> b...@example.com  b...@example.net
>> ...
> 
> Yes, this would be a nice workaround. But it would be much better, if
> postfix would correctly handle virtual alias forwards with the pattern
> @domain -> @anotherdomain, with anotherdomain being a virtual mailbox
> domain. See my original email for a complete example.
>
> In fact, postfix *ignores* virtual_mailbox_maps when there is a valid
> virtual_alias_maps entry pointing to a virtual mailbox domain, thereby
> creating mailboxes that should not exist and accepting mail that
> should actually be rejected.

No. Postfix behaves as documented, but you chose to ignore the
documentation. Don't blame Postfix for your own negligence.

> I consider this a bug, not a feature. Neither the manual for
> virtual_mailbox_maps nor the one for virtual_alias_maps says that the
> restriction from virtual_mailbox_maps is being ignored if there is a
> valid virtual_alias_maps entry for a virtual_mailbox_domain. Maybe I
> am wrong, but I am pretty sure. What do you think?

You're free to file a bug report, but I can practically guarantee you
that it will be discarded, since the virtual mailbox configuration
example in the VIRTUAL_README clearly tells you not to do what you're
doing.

Regards
Ansgar Wiechers
-- 
"Abstractions save us time working, but they don't save us time learning."
--Joel Spolsky

Reply via email to