Trouble with the e-mail app in Nextcloud - Unexpected error during account creation

I have trouble setting up the mail app with my e-mail settings.

Permanently, I get the error message „Unexpected error during account creation“
No more advice, what I can do, to solve the problem out.

As well the Apache2 access.log File is attached below and says no more errorcode.

Basically I used the same simple imap and smtp Data settings like thunderbird.

Who can help in this case ?

213.240.178.162 - - [25/Apr/2020:21:36:42 +0000] “GET /ocs/v2.php/apps/spreed/api/v1/signaling/4fquetq6 HTTP/1.1” 200 1544 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0”

213.240.178.162 - - [25/Apr/2020:21:37:13 +0000] “GET /ocs/v2.php/apps/spreed/api/v1/room/4fquetq6/participants HTTP/1.1” 200 2280 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0”

84.166.25.26 - - [25/Apr/2020:21:37:13 +0000] “POST /index.php/apps/mail/api/accounts HTTP/1.1” 400 1519 “-” “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36”

84.166.25.26 - - [25/Apr/2020:21:36:46 +0000] “GET /ocs/v2.php/apps/spreed/api/v1/signaling/4fquetq6 HTTP/1.1” 200 1544 “-” “Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0”

84.166.25.26 - - [25/Apr/2020:21:37:17 +0000] “GET /ocs/v2.php/apps/spreed/api/v1/room/4fquetq6/participants HTTP/1.1” 200 2280 “-” “Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0”

79.248.203.74 - - [25/Apr/2020:21:37:18 +0000] “GET /ocs/v2.php/apps/spreed/api/v1/room HTTP/1.1” 200 4777 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:75.0) Gecko/20100101 Firefox/75.0”

213.240.178.162 - - [25/Apr/2020:21:37:25 +0000] “GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1” 200 1444 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0”

213.240.178.162 - - [25/Apr/2020:21:36:56 +0000] “GET /ocs/v2.php/apps/spreed/api/v1/chat/4fquetq6?lookIntoFuture=1&lastKnownMessageId=156&includeLastKnown=0 HTTP/1.1” 304 267 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0”

84.166.25.26 - - [25/Apr/2020:21:36:56 +0000] “GET /ocs/v2.php/apps/spreed/api/v1/chat/4fquetq6?lookIntoFuture=1&lastKnownMessageId=156&includeLastKnown=0 HTTP/1.1” 304 267 “-” “Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0”

213.240.178.162 - - [25/Apr/2020:21:37:28 +0000] “GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1” 200 868 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0”

213.240.178.162 - - [25/Apr/2020:21:37:29 +0000] “GET /ocs/v2.php/apps/spreed/api/v1/room HTTP/1.1” 200 5478 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0”

84.166.25.26 - - [25/Apr/2020:21:37:30 +0000] “GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1” 200 4588 “-” “Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0”

84.166.25.26 - - [25/Apr/2020:21:37:31 +0000] “GET /index.php/csrftoken HTTP/1.1” 200 1433 “-” “Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0”

84.166.25.26 - - [25/Apr/2020:21:37:31 +0000] “GET /ocs/v2.php/apps/spreed/api/v1/room HTTP/1.1” 200 6373 “-” “Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0”

84.166.25.26 - - [25/Apr/2020:21:37:34 +0000] “GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1” 200 4588 “-” “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36”

213.240.178.162 - - [25/Apr/2020:21:37:13 +0000] “GET /ocs/v2.php/apps/spreed/api/v1/signaling/4fquetq6 HTTP/1.1” 200 1544 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0”

213.240.178.162 - - [25/Apr/2020:21:37:44 +0000] “GET /ocs/v2.php/apps/spreed/api/v1/room/4fquetq6/participants HTTP/1.1” 200 2280 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0”

84.166.25.26 - - [25/Apr/2020:21:37:17 +0000] “GET /ocs/v2.php/apps/spreed/api/v1/signaling/4fquetq6 HTTP/1.1” 200 1544 “-” “Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0”

84.166.25.26 - - [25/Apr/2020:21:37:48 +0000] “GET /ocs/v2.php/apps/spreed/api/v1/room/4fquetq6/participants HTTP/1.1” 200 2280 “-” “Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0”

79.248.203.74 - - [25/Apr/2020:21:37:48 +0000] “GET /ocs/v2.php/apps/spreed/api/v1/room HTTP/1.1” 200 4777 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:75.0) Gecko/20100101 Firefox/75.0”

Known limitations which we have to work on Give more insights into setup errors · Issue #3006 · nextcloud/mail · GitHub

The Nextcloud mail app offers an extensive logging system to make it easier identifying and tracking down bugs. Please enable debug mode and set the log level to debug in your admin settings. Then, try to reproduce your issue and take another look at data/nextcloud.log, data/horde_imap.log and data/horde_smtp.log.

Dear Christoph Wurst,

it did not solved the problem out.
we have checked the mail log on the Mailserver as well, but there ist no request from Nextcloud.

The Protokollfile nextcloud.log says the following:

{“reqId”:“fkHrZMr7jUnY6HzHUFM1”,“level”:3,“time”:“2020-05-02T20:42:35+00:00”,“remoteAddr”:“213.240.178.162”,“user”:“michaeladmin”,“app”:“password_policy”,“method”:“POST”,“url”:"/index.php/apps/mail/api/accounts",“message”:{“Exception”:“RuntimeException”,“Message”:“App class OCA\Password_Policy\AppInfo\Application is not setup via query() but directly”,“Code”:0,“Trace”:[{“file”:"/var/www/nextcloud/apps/password_policy/lib/AppInfo/Application.php",“line”:40,“function”:"__construct",“class”:“OCP\AppFramework\App”,“type”:"->",“args”:[“password_policy”]},{“file”:"/var/www/nextcloud/apps/password_policy/appinfo/app.php",“line”:23,“function”:"__construct",“class”:“OCA\Password_Policy\AppInfo\Application”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/legacy/app.php",“line”:266,“args”:["/var/www/nextcloud/apps/password_policy/appinfo/app.php"],“function”:“require_once”},{“file”:"/var/www/nextcloud/lib/private/legacy/app.php",“line”:155,“function”:“requireAppFile”,“class”:“OC_App”,“type”:"::",“args”:[“password_policy”]},{“file”:"/var/www/nextcloud/lib/private/legacy/app.php",“line”:128,“function”:“loadApp”,“class”:“OC_App”,“type”:"::",“args”:[“password_policy”]},{“file”:"/var/www/nextcloud/lib/base.php",“line”:993,“function”:“loadApps”,“class”:“OC_App”,“type”:"::",“args”:[]},{“file”:"/var/www/nextcloud/index.php",“line”:38,“function”:“handleRequest”,“class”:“OC”,“type”:"::",“args”:[]}],“File”:"/var/www/nextcloud/lib/public/AppFramework/App.php",“Line”:80,“CustomMessage”:"–"},“userAgent”:“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) snap Chromium/81.0.4044.129 Chrome/81.0.4044.129 Safari/537.36”,“version”:“18.0.4.2”}
{“reqId”:“fkHrZMr7jUnY6HzHUFM1”,“level”:4,“time”:“2020-05-02T20:42:35+00:00”,“remoteAddr”:“213.240.178.162”,“user”:“michaeladmin”,“app”:“mail”,“method”:“POST”,“url”:"/index.php/apps/mail/api/accounts",“message”:“Creating account failed: Could not connect to IMAP: Error connecting to mail server.”,“userAgent”:“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) snap Chromium/81.0.4044.129 Chrome/81.0.4044.129 Safari/537.36”,“version”:“18.0.4.2”}

The app can’t open a connection from your Nextcloud host to the mail host. Check your network configuration.

Hi Christoph Wurst,

The message comes immediately after pressing the Connect button.
I rather suspect that the Nextcloud is not waiting long enough for a response.
The Nextcloud server is on the same home network as my laptop where Thunderbird has no problem.

That is easy to test: https://github.com/nextcloud/mail/blob/master/doc/admin.md#timeouts