Can't connect to mailserver

Hi, i read some of the hints here and add to my config.php
app.mail.verify-tls-peer = false

and
“mail_smtpstreamoptions” => array(
‘ssl’ => array(
‘allow_self_signed’ => true,
‘verify_peer’ => false,
‘verify_peer_name’ => false
)
),

But when i try to add my emailaccount on a selfhosted system i get
{“reqId”:“e94lTVLAukaHdkIae1IE”,“level”:3,“time”:“2021-03-04T12:23:36+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“fe9a1222-a073-1032-8008-63885659c292”,“app”:“mail”,“method”:“POST”,“url”:"/index.php/apps/mail/api/accounts",“message”:“Creating account failed: Could not connect to IMAP host dub.domain.de:993: Error connecting to mail server.”,“userAgent”:“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36”,“version”:“20.0.8.1”,“id”:“6040d1496a71d”}

i know to change the tls version to a lower version has to be done, also in thunderbird in order to successfully connect to the mailserver (it will be in 2 months updated) but what else need the mailapp to do?
thanks for some hints…

Try with debug logging: mail/admin.md at master · nextcloud/mail · GitHub

okay, what exatly do you need?

so here are the rusults of my short debug.
it produces an huge anmount of data…

{"reqId":"xQTou2La7xAHbk6ZV8GD","level":0,"time":"2021-03-04T13:01:40+00:00","remoteAddr":"123.123.123.123","user":"fe9a1222-a073-1032-8008-63885659c292","app":"groupfolders","method":"POST","url":"/index.php/apps/mail/api/accounts","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36","version":"20.0.8.1"}

{“reqId”:“xQTou2La7xAHbk6ZV8GD”,“level”:0,“time”:“2021-03-04T13:01:40+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“fe9a1222-a073-1032-8008-63885659c292”,“app”:“richdocuments”,“method”:“POST”,“url”:"/index.php/apps/mail/api/accounts",“message”:"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.",“userAgent”:“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36”,“version”:“20.0.8.1”}
{“reqId”:“xQTou2La7xAHbk6ZV8GD”,“level”:0,“time”:“2021-03-04T13:01:40+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“fe9a1222-a073-1032-8008-63885659c292”,“app”:“files_retention”,“method”:“POST”,“url”:"/index.php/apps/mail/api/accounts",“message”:"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.",“userAgent”:“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36”,“version”:“20.0.8.1”}
{“reqId”:“xQTou2La7xAHbk6ZV8GD”,“level”:0,“time”:“2021-03-04T13:01:40+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“fe9a1222-a073-1032-8008-63885659c292”,“app”:“files_sharing”,“method”:“POST”,“url”:"/index.php/apps/mail/api/accounts",“message”:"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.",“userAgent”:“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36”,“version”:“20.0.8.1”}
{“reqId”:“xQTou2La7xAHbk6ZV8GD”,“level”:1,“time”:“2021-03-04T13:01:40+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“fe9a1222-a073-1032-8008-63885659c292”,“app”:“mail”,“method”:“POST”,“url”:"/index.php/apps/mail/api/accounts",“message”:“Setting up manually configured account”,“userAgent”:“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36”,“version”:“20.0.8.1”}
{“reqId”:“xQTou2La7xAHbk6ZV8GD”,“level”:0,“time”:“2021-03-04T13:01:40+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“fe9a1222-a073-1032-8008-63885659c292”,“app”:“mail”,“method”:“POST”,“url”:"/index.php/apps/mail/api/accounts",“message”:“Connecting to account email@domain.de”,“userAgent”:“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36”,“version”:“20.0.8.1”}
{“reqId”:“xQTou2La7xAHbk6ZV8GD”,“level”:3,“time”:“2021-03-04T13:01:40+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“fe9a1222-a073-1032-8008-63885659c292”,“app”:“mail”,“method”:“POST”,“url”:"/index.php/apps/mail/api/accounts",“message”:“Creating account failed: Could not connect to IMAP host sub.domain.de:993: Error connecting to mail server.”,“userAgent”:“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36”,“version”:“20.0.8.1”}
{“reqId”:“6p5mhCQ8neikeYJoX1xR”,“level”:0,“time”:“2021-03-04T13:02:06+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“fe9a1222-a073-1032-8008-63885659c292”,“app”:“contacts”,“method”:“GET”,“url”:"/ocs/v2.php/apps/notifications/api/v2/notifications",“message”:"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.",“userAgent”:“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36”,“version”:“20.0.8.1”}
{“reqId”:“6p5mhCQ8neikeYJoX1xR”,“level”:0,“time”:“2021-03-04T13:02:06+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“fe9a1222-a073-1032-8008-63885659c292”,“app”:“groupfolders”,“method”:“GET”,“url”:"/ocs/v2.php/apps/notifications/api/v2/notifications",“message”:"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.",“userAgent”:“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36”,“version”:“20.0.8.1”}
{“reqId”:“6p5mhCQ8neikeYJoX1xR”,“level”:0,“time”:“2021-03-04T13:02:06+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“fe9a1222-a073-1032-8008-63885659c292”,“app”:“richdocuments”,“method”:“GET”,“url”:"/ocs/v2.php/apps/notifications/api/v2/notifications",“message”:"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.",“userAgent”:“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36”,“version”:“20.0.8.1”}
{“reqId”:“6p5mhCQ8neikeYJoX1xR”,“level”:0,“time”:“2021-03-04T13:02:06+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“fe9a1222-a073-1032-8008-63885659c292”,“app”:“files_retention”,“method”:“GET”,“url”:"/ocs/v2.php/apps/notifications/api/v2/notifications",“message”:"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.",“userAgent”:“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36”,“version”:“20.0.8.1”}
{“reqId”:“6p5mhCQ8neikeYJoX1xR”,“level”:0,“time”:“2021-03-04T13:02:06+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“fe9a1222-a073-1032-8008-63885659c292”,“app”:“files_sharing”,“method”:“GET”,“url”:"/ocs/v2.php/apps/notifications/api/v2/notifications",“message”:"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.",“userAgent”:“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36”,“version”:“20.0.8.1”}
{“reqId”:“UwWfjKwBnuA5MxcEoSYv”,“level”:3,“time”:“2021-03-04T13:04:32+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“fe9a1222-a073-1032-8008-63885659c292”,“app”:“mail”,“method”:“POST”,“url”:"/index.php/apps/mail/api/accounts",“message”:“Creating account failed: Could not connect to IMAP host sub.domain.de:993: Error connecting to mail server.”,“userAgent”:“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36”,“version”:“20.0.8.1”}
{“reqId”:“fcz7tvsRk0Mynvblv0dt”,“level”:0,“time”:“2021-03-04T13:05:02+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“admin”,“app”:“contacts”,“method”:“GET”,“url”:"/index.php/apps/logreader/poll?lastReqId=UwWfjKwBnuA5MxcEoSYv",“message”:"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.",“userAgent”:“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0”,“version”:“20.0.8.1”}
{“reqId”:“fcz7tvsRk0Mynvblv0dt”,“level”:0,“time”:“2021-03-04T13:05:02+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“admin”,“app”:“groupfolders”,“method”:“GET”,“url”:"/index.php/apps/logreader/poll?lastReqId=UwWfjKwBnuA5MxcEoSYv",“message”:"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.",“userAgent”:“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0”,“version”:“20.0.8.1”}
{“reqId”:“fcz7tvsRk0Mynvblv0dt”,“level”:0,“time”:“2021-03-04T13:05:02+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“admin”,“app”:“richdocuments”,“method”:“GET”,“url”:"/index.php/apps/logreader/poll?lastReqId=UwWfjKwBnuA5MxcEoSYv",“message”:"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.",“userAgent”:“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0”,“version”:“20.0.8.1”}
{“reqId”:“fcz7tvsRk0Mynvblv0dt”,“level”:0,“time”:“2021-03-04T13:05:02+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“admin”,“app”:“files_retention”,“method”:“GET”,“url”:"/index.php/apps/logreader/poll?lastReqId=UwWfjKwBnuA5MxcEoSYv",“message”:"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.",“userAgent”:“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0”,“version”:“20.0.8.1”}
{“reqId”:“fcz7tvsRk0Mynvblv0dt”,“level”:0,“time”:“2021-03-04T13:05:02+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“admin”,“app”:“files_sharing”,“method”:“GET”,“url”:"/index.php/apps/logreader/poll?lastReqId=UwWfjKwBnuA5MxcEoSYv",“message”:"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.",“userAgent”:“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0”,“version”:“20.0.8.1”}
{“reqId”:“zoNSAO3pShMasCJawUuH”,“level”:0,“time”:“2021-03-04T13:05:02+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“admin”,“app”:“contacts”,“method”:“GET”,“url”:"/index.php/apps/logreader/poll?lastReqId=fcz7tvsRk0Mynvblv0dt",“message”:"/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.",“userAgent”:“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0”,“version”:“20.0.8.1”}
{“reqId”:“zoNSAO3pShMasCJawUuH”,“level”:0,“time”:“2021-03-04T13:05:02+00:00”,“remoteAddr”:“123.123.123.123”,“user”:“admin”,“app”:“groupfolders”,“method”:“GET”,“url”:"/index.php/apps/logreader/poll?lastReqId=fcz7tvsRk0Mynvblv0dt",“message”:

I need the IMAP logs …

so now it work with imap (Port 143) Ports with SSL/TLS won’t work. So i think, there has to be a configuration change to accept old connections to my server. In Thunderbird i have to change the “min tls value to 1” that works.
The already reading option “app.mail.verify-tls-peer = false” won’t work.

And i havn’t a imap.log in data. There is nextcloud.log and update.log

if you have no imap logs then you didn’t enable debug mode

I dont have imap.log but i have 'loglevel' => 0,

see mail/admin.md at master · nextcloud/mail · GitHub

hmm, okay, i’ve debug on.
But:
after changing my imapsettings from 143 (none ssl) to 993 (ssl/tls) it works. So switching from non secure to secure works for me, but configuring in first step with secure it doesn’t work. I use the same login data…
Thanks @ChristophWurst

1 Like