On Mon, May 06, 2019 at 03:47:58AM +0200, Andreas Thienemann wrote:

> > If you're not using /etc/aliases or .forward files in any substantive
> > way, you could switch to a virtual mailbox domain.
> 
> No .forward files at all. Users do not have local accounts on the machine 
> anymore, except uucp users of course...
> I do use /etc/aliases (and another alias list) for a few mailman redirects 
> plus a handful of pipe deliveries and some minor redirects...

In most cases virtual(5) is superior to aliases(5), but you still
need it for mailman and pipes, so you'd rewrite those to localhost
(or some suitable domain listed in mydestination).

> To paraphrase my understanding than:
> 
> If a domain is not listed in any other class, it needs to be listed in 
> virtual_alias_domains. virtual_alias_maps rewrites are being applied to 
> incoming mail regardless of the class however.

Well, it needs to be listed if you want to accept inbound mail and
your only choice is rewriting to some underlying domain.  Yes,
rewriting happens either way.


> I was hoping to get away from the rewrites. Especially as I'd like people 
> to be able to login to the imap server with their email-address, e.g. 
> u...@example.org. That prevents a lot of confusion on the user side...
> .invalid would probably make things weird...

The recipient envelope has nothing to do with how users log in, or
which mailbox they see.  Mapping of users to mailboxes is up to the
IMAP server.  In some cases, you can also rewrite back to the original
address via smtp_generic_maps, but it is often not needed, since the
IMAP server can perform the relevant mappings.

> If a domain has at least one virtual_mailbox user, add it to the 
> virtual_mailbox_domains list and remove it from virtual_alias_domains or
> relay_domains.

And also mydestination.

> Add all virtual_mailbox users under the mydestinations domain to the 
> local_recipient_maps for now.

At which point, no need for local_recipient_maps for that domain.
That's only for domains where all the users are local or aliased.

> In that setup transport_maps would still be consulted, right?

Always consulted, unless the final recipient is in a virtual alias
domain, in which case the recipient is bounced.

-- 
        Viktor.

Reply via email to