Mail account provisioning not working

When a user tries to open the mail app for the first time, no account is being added all though the information in the settings is filled accordingly and provisioning is enabled. In the log, I’m seeing this error:

[mail] Fatal: OCA\Mail\Exception\ServiceException: IMAP errorNo password provided. at <<closure>>

0. /hp/ax/af/rc/www/cloud/nextcloud/apps/mail/lib/Service/MailManager.php line 101
   OCA\Mail\IMAP\MailboxSync->sync(OCA\Mail\Account {})
1. /hp/ax/af/rc/www/cloud/nextcloud/apps/mail/lib/Controller/PageController.php line 119
   OCA\Mail\Service\MailManager->getFolders(OCA\Mail\Account {})
2. /hp/ax/af/rc/www/cloud/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 169
   OCA\Mail\Controller\PageController->index()
3. /hp/ax/af/rc/www/cloud/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 100
   OC\AppFramework\Http\Dispatcher->executeController(OCA\Mail\Controller\PageController {}, "index")
4. /hp/ax/af/rc/www/cloud/nextcloud/lib/private/AppFramework/App.php line 152
   OC\AppFramework\Http\Dispatcher->dispatch(OCA\Mail\Controller\PageController {}, "index")
5. /hp/ax/af/rc/www/cloud/nextcloud/lib/private/Route/Router.php line 309
   OC\AppFramework\App::main("OCA\\Mail\\Controller\\PageController", "index", OC\AppFramework\ ... {}, {_route: "mail.page.index"})
6. /hp/ax/af/rc/www/cloud/nextcloud/lib/base.php line 1008
   OC\Route\Router->match("/apps/mail/")
7. /hp/ax/af/rc/www/cloud/nextcloud/index.php line 37
   OC::handleRequest()

GET /index.php/apps/mail/
from *IP adress removed* by *username removed* at 2021-02-09T20:13:02+00:00

I don’t understand why the log reports “no password provided”. Doesn’t Nextcloud just use the user’s Nextcloud account password to log in?

What might be important is that I have SSO/SAML enabled but the password associated with the actual user account in Nextcloud (that I created manually) matches the one needed to log into the email account.

Thanks in advance!

Yes, you understood it correctly. You have to set-up an individual account password for each mail account you want to access.

Sorry for necroing this topic, but I am being confronted with this too.
I have nextcloud running with an OpenLDAP accountprovider. The points I encounter:

  • setting up each account in the mail app by hand is kind of tedious
  • Because the mailserver also uses the LDAP accountprovider, as soon the LDAP user changes the password, the settings in the Nextcloud mail app need to be changed manually afterwards.

Are there any options to make this more workable (like taking LDAP / mailserver settings ‘automagically’?