Bug 3941

Summary: Connecting to IMAP server: SSL/TLS handshake failed
Product: Claws Mail (GTK 2) Reporter: r.pretki
Component: Folders/IMAPAssignee: users
Status: RESOLVED INVALID    
Severity: normal CC: psychonaut
Priority: P3    
Version: 3.15.1   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Log file [claws-mail --debug > /home/[name]/LOG.txt]
none
LOG-2 file [claws-mail --debug] none

Description r.pretki 2018-01-05 14:09:10 UTC
Created attachment 1831 [details]
Log file [claws-mail --debug > /home/[name]/LOG.txt]

I'm reporting an error related to signing in to IMAP.

When I try to open any IMAP folder, the claws mail returns the following error:

	* Account '[wycięte]': Connecting to IMAP server: imap.[wycięte].com:993...
	*** SSL/TLS handshake failed

This applies to all IMAP folders I have. Regardless of the email service provider. I do not have e-mail set to POP.

Using the claws-mail --debug > /home/[name]/LOG.txt  option returns the following result:

	** Message: filtering log disabled
	** Message: Account '[hidden address]': Connecting to IMAP server: imap.kolabnow.com:993...
	** (claws-mail:7228): WARNING **: [13:26:09] SSL/TLS handshake failed
	(claws-mail:7228): Claws-Mail-CRITICAL **: imap_scan_required: assertion 'session != NULL' failed
	** Message: Account '[hidden address]': Connecting to IMAP server: imap.gmail.com:993...
	** (claws-mail:7228): WARNING **: [13:26:13] SSL/TLS handshake failed
	(claws-mail:7228): Claws-Mail-CRITICAL **: imap_scan_required: assertion 'session != NULL' failed
	
Fresh installation does not help. Removing the ".claws-mail" directory and clean launch also does not help.

My environment:
Claws Mail 3.15.1-dirty
openSUSE Tumbleweed 20171230 + KDE
Linux version 4.14.10-1.ga9b9f85-default (geeko@buildhost) (gcc version 7.2.1 20171020 [gcc-7-branch revision 253932] (SUSE Linux))

Reproducible: always
Comment 1 Paul 2018-01-05 14:36:24 UTC
the attached log file does not include a connection attempt so is of "limited use".
Comment 2 Michael Rasmussen 2018-01-05 15:33:03 UTC
Have you tried using STARTTLS instead?
Comment 3 r.pretki 2018-01-05 19:22:07 UTC
Created attachment 1832 [details]
LOG-2 file [claws-mail --debug]
Comment 4 r.pretki 2018-01-05 19:22:25 UTC
@Paul
I did not exclude any login items.
I'm adding a new log. I used "claws-mail --debug" option.

@Michael Rasmussen
Yes. I also tried this before reporting the bug. Setting STARTTLS does not help.
Comment 5 Paul 2018-01-05 19:41:24 UTC
what is the output of these 2 commands?:

$ libetpan-config --libs
$ libetpan-config --version
Comment 6 r.pretki 2018-01-05 21:55:19 UTC
Thank you very much for your interest in my problem!

Zypper shows that I have libetpan17 (1.6-1.11), but the effect of using the commands indicated by you is empty:

name@hostname:~> libetpan-config --libs
bash: /usr/bin/libetpan-config: No such file or directory
name@hostname:~> libetpan-config --version
bash: /usr/bin/libetpan-config: No such file or directory

name@hostname:~> sudo libetpan-config --libs
sudo: libetpan-config: command not found
name@hostname:~> sudo libetpan-config --version
sudo: libetpan-config: command not found

I decided to additionally install libetpan-devel (1.6-1.11) (and two dependencies: cyrus-sasl-devel and libdb-4_8-devel):

Installing cyrus-sasl-devel-2.1.26-16.1.x86_64.rpm (installed size 1,25 MiB)
Installing libdb-4_8-devel-4.8.30-33.1.x86_64.rpm (installed size 154,1 KiB)
Installing libetpan-devel-1.6-1.11.x86_64.rpm (installed size 1,13 MiB)

The effect of using commands you specify is as follows:

name@hostname:~> libetpan-config --libs
-L/usr/lib64 -letpan -lz -ldb-4.8 -lz -pthread -lsasl2

name@hostname:~> libetpan-config --version
1.6

I tried to run claws-mail. The error still occurs. No changes.

Below you can find information about packages:

name@hostname:~> sudo zypper se libetpan
Loading repository data...
Reading installed packages...

libetpan-debugsource | Debug sources for package libetpan | package
libetpan-devel | Mail handling library | package
libetpan17 | Mail handling library | package
libetpan17-debuginfo | Debug information for package libetpan17 | package

name@hostname:~> sudo zypper if libetpan17
Loading repository data...
Reading installed packages...
Information for package libetpan17:
-----------------------------------
Repository     : openSUSE-Tumbleweed-Oss
Name           : libetpan17             
Version        : 1.6-1.11               
Arch           : x86_64                 
Vendor         : openSUSE               
Installed Size : 982,7 KiB              
Installed      : Yes (automatically)    
Status         : up-to-date             
Source package : libetpan-1.6-1.11.src  
Summary        : Mail handling library  
Description    :                        
    libEtPan is a mail purpose library. It will be used for low-level mail
    handling : network protocols (IMAP/NNTP/POP3/SMTP over TCP/IP and
    SSL/TCP/IP, already implemented), local storage (mbox/MH/maildir),
    message / MIME parse

name@hostname:~> sudo zypper if libetpan-devel
Loading repository data...
Reading installed packages...
Information for package libetpan-devel:
---------------------------------------
Repository     : openSUSE-Tumbleweed-Oss
Name           : libetpan-devel         
Version        : 1.6-1.11               
Arch           : x86_64                 
Vendor         : openSUSE               
Installed Size : 1,1 MiB                
Installed      : Yes                    
Status         : up-to-date             
Source package : libetpan-1.6-1.11.src  
Summary        : Mail handling library  
Description    :                        
    libEtPan is a mail purpose library. It will be used for low-level mail
    handling : network protocols (IMAP/NNTP/POP3/SMTP over TCP/IP and
    SSL/TCP/IP, already implemented), local storage (mbox/MH/maildir),
    message / MIME parse
Comment 7 Paul 2018-01-05 23:31:37 UTC
(In reply to comment #6)
> name@hostname:~> libetpan-config --libs
> -L/usr/lib64 -letpan -lz -ldb-4.8 -lz -pthread -lsasl2

That looks suspect. Here is the output on my system:

$ libetpan-config --libs
-L/usr/lib64 -letpan -lcurl -lexpat -lz -lgnutls -lgcrypt -lgpg-error -lz -ldb-5.3 -lz -llockfile -pthread -lsasl2

It looks like your libetpan is not compiled with gnutls support, and that would explain the failure it has in attempting the encrypted connection.
Comment 8 r.pretki 2018-01-06 10:39:15 UTC
I think you're right.

I replaced the repository with claws-mail and libetpan:

from: https://download.opensuse.org/tumbleweed/repo/oss/suse/x86_64/
claws-mail-3.15.1-2.1.x86_64.rpm
libetpan17-1.6-1.11.x86_64.rpm

to: https://download.opensuse.org/repositories/server:/mail/openSUSE_Tumbleweed/x86_64/
claws-mail-3.16.0-1.2.x86_64.rpm
libetpan20-1.8-28.1.x86_64.rpm

Unfortunately, I did not find the right libetpan to substitute, which would allow full verification (without changing the claws-mail version). Claws-mail 3.15 did not work with libetpan 1.8.

Currently the problem has disappeared. Everything is working properly.

Thank you very much for help. I think that this bug reporting can be closed.

If you want to take a look at my RPMs files, in the links above you will find RPMs that I have installed (previously and now). Because of the size, the first repository loads in the web browser a bit longer. Below you will find direct links:
https://download.opensuse.org/tumbleweed/repo/oss/suse/x86_64/claws-mail-3.15.1-2.1.x86_64.rpm
https://download.opensuse.org/tumbleweed/repo/oss/suse/x86_64/libetpan17-1.6-1.11.x86_64.rpm
Comment 9 Tristan Miller 2018-01-14 14:26:18 UTC
Problem is reproducible for me with openSUSE Tumbleweed using the default repositories.  I think we've established that this a downstream problem with the openSUSE packages.  Is there a downstream bug report?  If so, please let me know the URL.  Otherwise, I will report it myself.
Comment 10 Tristan Miller 2018-01-22 12:58:23 UTC
No answer to my last comment, so I opened an openSUSE Tumbleweed bug myself: <https://bugzilla.novell.com/show_bug.cgi?id=1077025>
Comment 11 Paul 2018-01-22 13:03:50 UTC
you could have been a little more specific in your suse bug report. The problem is with the libetpan package.
Comment 12 Tristan Miller 2018-01-22 14:17:09 UTC
(In reply to comment #11)
> you could have been a little more specific in your suse bug report. The
> problem is with the libetpan package.

Fair enough; I've updated the report to mention your diagnosis.