On Mon, May 06, 2019 at 02:38:15AM +0200, Andreas Thienemann wrote:

> I currently have a mailserver that serves as final destination for a 
> domain, say example.com which is configured as mydestination.

This works, but I generally prefer to not put any "real" domains
in mydestination, with addresses only getting resolved to local(8)
delivery via virtual(5) aliases to a domain like "localhost", which
would then be the only one listed in mydestination.  The "real"
domains are then always virtual alias, virtual mailbox or relay
domains.

> I have users on that domain (u...@example.com) which are getting mail 
> delivered via lmtp configured under mailbox_transport to a dovecot server.

If you're not using /etc/aliases or .forward files in any substantive
way, you could switch to a virtual mailbox domain.

> On reading the documentation and observing the logs I am not sure if the 
> virtual_alias_domains entry is actually needed

It is needed, in order to authorize incoming mail to that domain
from strangers.

> Now I am trying to set up postfix but there are two warnings which give me 
> pause:
> 
>   NEVER list a virtual MAILBOX domain name as a mydestination domain!
>   NEVER list a virtual MAILBOX domain name as a virtual ALIAS domain!

For each domain, choose just one address class.

> The way I seem to understand the setup, in order for the 
> virtual_mailbox_maps to be consulted, the domain needs to be marked as a 
> virtual_mailbox_domain first.

My virtual mailbox domain is "virtual.invalid", users are rewitten
into that domain as needed.  My "real" domains are all "virtual alias"
domains.

  main.cf:
    append_dot_mydomain = yes
    mydestination = localhost.$mydomain
    virtual_mailbox_domains = virtual.invalid
    virtual_alias_domains = example.com, example.net, example.org
    indexed = ${default_database_type}:${config_directory}/
    virtual_alias_maps = ${indexed}virtual

  virtual:
    u...@example.com    user@localhost
    u...@example.net    user@virtual.invalid
    u...@example.org    ... take your pick ...

-- 
        Viktor.

Reply via email to