Le 24/09/2020 à 17:03, Unicorn a écrit :
>> You can use a virtual user table, but you will have to split your
>> "deliver_local" table. As Uwe suggested, I would use lmtp for that:
>>
>> action "inbox" lmtp "/var/run/dovecot/lmtp" rcpt-to virtual <vusers>
>>
>> In that case, vusers is defined here:
>>
>> table vusers    file:/etc/smtpd/vusers
>>
>> And its content:
>>
>> postmaster                          [email protected]
>> abuse                               [email protected]
>> root                                [email protected]
>> contact                             [email protected]
>> [email protected]             vmail
>> [email protected]        vmail
>> [email protected]            [email protected]
>>
>> And so on…
> Thank you both Uwe and Archange for the pointer to lmtp, I was not
> familiar with that!
>
> I enabled lmtp according to what I read online by adding lmtp to the
> protocols
>
> Regarding the example contents of the vusers table you suggested
> Archange, the first 4 lines would only ever be active for local mail,
> correct? Would this eg. send the daily output and insecurity output to
> [email protected]?

No, it means that unless there is a more specific alias before, all
those 4 aliases, whatever is the domain part amongst the domains you
receive for, will be delivered to [email protected]

> Regarding the 5th and 6th line of your example table, wouldn't that
> just deliver to the Maildir of the user vmail? Would there ever be a
> case where I would want this? Just asking to confirm in case I do not
> understand. :)

No, you need to deliver to vmail for all users, Dovecot will be
responsible for placing emails into the right folders.

> Lastly, if I map [email protected] to 
> [email protected], would it end up in the Maildir of 
> [email protected] in the folder "special"? Or do I need to do
> any extra configuration on the side of dovecot to make this happen?

Yes, you will need Sieve rules in Dovecot (using Pigeon). By default,
smtpd will deliver mainuser+special to mainuser, and Dovecot will handle
it like this. You must add a Sieve rule matching the To: to make it
deliver to a specific folder.

>>> ##############################################################
>>> allow_username_mismatch = true;
>>>
>>> domain {
>>>     firstdomain.tld {
>>>         path = "/etc/mail/dkim/firstdomain.tld.key";
>>>         selector = "blah";
>>>     }
>>> }
>>> ##############################################################
>>>
>>> Will it work automatically by simply entering eg.
>>> 'seconddomain.tld
>>> {...}' with its respective keyfile and selector?
>> Yes. And if you use sensible file names like me, you can even do
>> this:
>>
>> path = "/etc/mail/dkim/$domain.$selector.key";
>>
>> Regards,
>> Archange
> I am glad to hear that this will work!
>
> Since I assume that the users will now have to authenticate with their
> full [email protected], can I remove 'allow_username_mismatch = true;'
> from the config? Iirc it was necessary before because users would just
> authenticate with their username.

Not necessarily, your users can still authenticate with their username,
it depends on your configuration. That’s what I do, of course it means I
cannot allow the same username for two different domains (but that’s not
an issue in my case). But if you move to [email protected], yes,
`allow_username_mismatch = true;` will likely not be required anymore
(but you should test, since I did not run such a setup myself).

Regards,
Archange


Reply via email to