Mail: Can't add self-hosted mail

Created on 19 Oct 2020  路  16Comments  路  Source: nextcloud/mail

Expected behavior

Tell us what should happen
Add mail adress in the mail app

Actual behavior

Tell us what happens instead
Not working

Mail app

Mail app version: 1.5.0

Mailserver or service: Self-hosted -with onlyoffice mail server

Server configuration

Operating system: Debian 10

Web server: Nginx

Database: ?

PHP version: ?

Nextcloud Version: 20.0.0 (docker)

Client configuration

Browser: Chrome latest

Operating system: Windows

Hi,

When adding a new mail adress in the mail app, it doesn't work. I'm using params which are functionning in other mail clients.
I set the prop 'app.mail.verify-tls-peer' => false in the config.php file but it doesn't work.

Logs from nextcloud.log:

{"reqId":"9wD3DU9UuuR8sx6sFn1l","level":4,"time":"2020-10-18T23:12:04+00:00","remoteAddr":"XX.XXX.XXX.XXX","user":"XXXX","app":"mail","method":"POST","url":"/apps/mail/api/accounts","message":"Creating account failed: Could not connect to IMAP: Could not open secure TLS connection to the IMAP server.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36","version":"20.0.0.9"}

Logs from horde_imap.log:

Sun, 18 Oct 2020 22:21:42 +0000
Connection to: imap://yohann-cros.fr/
Server connection took 0.0011 seconds.
S: * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS LOGINDISABLED] Dovecot ready.
C: 1 STARTTLS
S: 1 OK Begin TLS negotiation now.
Command 1 took 0.0005 seconds.

Logs from dovecot (mailserver):

Oct 18 23:12:04 imap-login: Info: Disconnected (no auth attempts in 0 secs): user=<>, rip=172.21.0.1, lip=172.21.0.4, TLS handshaking: SSL_accept() failed: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure: SSL alert number 40, session=<7j89IPqxggCsFQAB>

Thanks for your help!

0. to triage bug

All 16 comments

Hi,

thanks for all the logs. Great bug report!

So the connection is established but as soon as the TLS handshake starts, the connection fails.

https://serverfault.com/questions/656488/imap-tls-connection-to-dovecot-fails

What version of TLS do you have enabled right now?

Hi,

Thanks for your prompt response!

Sorry, I don't know were to find the enabled version... The 10-ssl.conf dovecot file has the ssl lines commented!

Mind manually applying the path from https://github.com/horde/Socket_Client/pull/4 in your local copy of the Mail app? Use find to locate the file. This patch might help.

Doesn't work, exactly same logs...

Is it about the host name maybe? https://stackoverflow.com/a/59372624/2239067

The hostname is correct, I use the full hostname (and not localhost or an IP)

I'm out of ideas unfortunately

Viewing dovecot.log in my mail server, I can see these differeces:

  • Oct 19 09:24:59 imap-login: Info: Login: user=<[email protected]>, method=PLAIN, rip=172.21.0.1, lip=172.21.0.4, mpid=2323, TLS, session=<B0QusAKyogCsFQAB> => Connection OK from another client

  • Oct 19 09:25:15 imap-login: Info: Disconnected (no auth attempts in 0 secs): user=<>, rip=172.21.0.1, lip=172.21.0.4, TLS handshaking: SSL_accept() failed: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure: SSL alert number 40, session=<udApsQKyDACsFQAB> => Connection KO from Nextcloud

The user seems to be empty with Nextcloud

Interesting. What did you set as Email during the setup?

The setup dosen't ask for an Email, but I've set my email adress in my profile, and I have configured mail server (same server which I'm trying to connect with mail app) for sending email (it works)

The setup dosen't ask for an Email

Please share a screenshot. It certainly does.

but I've set my email adress in my profile

That will only be used as a prefil.

Sorry, you're meaning by 'setup' the form for configuring the mail app, or setup the Nextcloud env at the first launch?

in the mail app.

Oh ok. I'm filling out all the input with informations that works with 3rd party app. I put my email in the Email input.

Found that SSLv2 and SSLv3 are disabled in my dovecot server. Try playing with this but same result.

Ok, found how to make it working.
Had to put the mail and the nextcloud containers on the same docker network, and add "IP hostmail" on the /etc/hosts file ont the nextcloud container. Now it's working with host=hostname and TLS connection.

Was this page helpful?
0 / 5 - 0 ratings