MailCore / mailcore2

MailCore 2 provide a simple and asynchronous API to work with e-mail protocols IMAP, POP and SMTP. The API has been redesigned from ground up.
Other
2.59k stars 623 forks source link

[Bug] - Unknown mailsmtp error 27 (SSL Error) when adding IMAP/SMTP account #2004

Open zeph opened 2 months ago

zeph commented 2 months ago

duplicating/reopening here as it seems to be the core of this issue https://github.com/Foundry376/Mailspring/issues/341

Summary Mailspring, which is using this library, is failing in negotiating TLS to some servers. An example, as it is the one I stumbled on ... is the one provided by the Free Software Foundation Europe to its fellows https://wiki.fsfe.org/action/login/TechDocs/SMTP

Connection Logs

----------SMTP----------
connect mail.fsfe.org 587
220 mail1.fsfe.org ESMTP Postfix (Debian/GNU)
init
EHLO fluffy.local
250-mail1.fsfe.org
250-PIPELINING
250-SIZE 20971520
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250 CHUNKING
start TLS
STARTTLS
220 2.0.0 Ready to start TLS
QUIT

SASL_PATH: 

SMTP Last Response Code: 220
SMTP Last Response: 2.0.0 Ready to start TLS

mailsmtp Last Error Code: 27
mailsmtp Last Error Explanation: MAILSMTP_ERROR_SSL
mailsmtp Last Error Location: 3
mailsmtp Last Auth Type: 0

I see if I can create a unittest for it... BRB

zeph commented 2 months ago

wait... is this related to https://github.com/MailCore/mailcore2/issues/2002 ? ...as I see this statement https://community.getmailspring.com/t/mailspring-doesnt-support-tlsv1-3/4914

the endpoint I'm having issues with is indeed TLSv1.3

Post-Handshake New Session Ticket arrived:
SSL-Session:
    Protocol  : TLSv1.3
    Cipher    : TLS_AES_256_GCM_SHA384
zeph commented 2 months ago

(thoughts/investigation/notes) ok, seems to be al going around https://github.com/Foundry376/Mailspring-Sync ...let me see if it is using a too old version of mailcore2 or this is really a bug