Hello greetings, this is my first message.
I have a little problem with the mail configuration,
I have Nextcloud installed on the same machine as the mail server (Postfix, Dovecot) working correctly
When creating the account in nextcloud it tells me “Unexpected error during account creation”
Looking at the log files, I see that the www-data user does not have permissions to send emails, (I correct it in dovecot, although I shouldn’t since the www-data user shouldn’t send emails)
I try again and see that the error now is that it cannot create the subdirectory / var / www / Maildir (I create it by hand and assign it the owner so that it can use it).
New try, I see that it creates files and subdirectories, but it keeps giving the same error.
Consulting this page I see many entries with similar errors. I am not the only one with these problems.
I try what is indicated on the next page and neither.
The truth is not a problem that keeps me awake, I can still not connect the mail, but I think that many of us will have Nextcloud together with the mail server and it would be good if it works.
If anyone has the solution and wants to indicate it, I would appreciate it.
Sorry my bad englis (web-translator).
Reinstall from 0 nextcloud. and I realized that even before I tried to configure the email account I was getting these messages from the mail log.
dovecot: lmtp (6428, www-data): Error: Failed to initialize user: Mail access for users with UID 33 not permitted (see first_valid_uid in config file, uid from userdb lookup).
This must be a programming error, the www-data user must not be able to send emails. And although it can be solved by changing first_valid_uid in dovecot, it would still be a security flaw since the www-data user is a privileged user.