Bug 2402 - GnuTLS change breaks socket communication
Summary: GnuTLS change breaks socket communication
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: POP3 (show other bugs)
Version: 3.7.9
Hardware: PC Linux
: P3 normal
Assignee: users
URL:
: 2473 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-04-12 15:59 UTC by Atanas Zhelev
Modified: 2011-08-31 13:00 UTC (History)
1 user (show)

See Also:


Attachments
Possible real fix (3.36 KB, patch)
2011-08-30 09:02 UTC, Colin Leroy
no flags Details | Diff

Description Atanas Zhelev 2011-04-12 15:59:42 UTC
Hello,

i can't download mail from a POP3 server with the latest claws-mail 3.7.9

* Connecting to POP3 server: mail.opencode.com...
[16:33:08] POP3< +OK Hello there.
[16:33:08] POP3> STLS
[16:33:08] POP3< +OK Begin SSL/TLS negotiation now.
[16:33:12] POP3> USER ****************@opencode.com
[16:33:12] POP3< +OK Password required.
[16:33:12] POP3> PASS ********
[16:33:12] POP3< +OK logged in.
[16:33:12] POP3> STAT
[16:33:12] POP3< +OK 79 269787
[16:33:12] POP3> UIDL
[16:33:12] POP3< +OK
[16:33:12] POP3> LIST
[16:33:12] POP3< +OK POP3 clients that break here, they violate STD53.
[16:33:12] POP3> RETR 1
[16:33:13] POP3< +OK 3072 octets follow.
[16:33:13] POP3> RETR 2
[16:33:13] POP3< +OK 4693 octets follow.
[16:33:13] POP3> RETR 3
[16:33:13] POP3< +OK 3119 octets follow.
[16:33:13] POP3> RETR 4
[16:33:13] POP3< +OK 3257 octets follow.
[16:33:13] POP3> RETR 5
[16:33:13] POP3< +OK 3049 octets follow.
[16:33:13] POP3> RETR 6
[16:33:13] POP3< +OK 3126 octets follow.
[16:33:13] POP3> RETR 7
[16:33:14] POP3< +OK 3094 octets follow.
[16:33:14] POP3> RETR 8
[16:33:14] POP3< +OK 3161 octets follow.
[16:33:14] POP3> RETR 9
[16:33:14] POP3< +OK 3358 octets follow.
[16:33:14] POP3> RETR 10
[16:33:14] POP3< +OK 2940 octets follow.
[16:33:14] POP3> RETR 11
[16:33:14] POP3< +OK 3804 octets follow.
[16:33:14] POP3> RETR 12
[16:33:14] POP3< +OK 3235 octets follow.
[16:33:14] POP3> RETR 13
[16:33:14] POP3< +OK 3100 octets follow.
[16:33:14] POP3> RETR 14
[16:33:15] POP3< +OK 3531 octets follow.
[16:33:15] POP3> RETR 15
[16:33:15] POP3< +OK 3114 octets follow.
[16:33:15] POP3> RETR 16
[16:33:15] POP3< +OK 3009 octets follow.
[16:33:15] POP3> RETR 17
[16:33:15] POP3< +OK 4120 octets follow.
** Session timed out. You may be able to recover by increasing the timeout value in Preferences/Other/Miscellaneous.
* Connecting to POP3 server: mail.opencode.com...
[16:38:57] POP3< +OK Hello there.
[16:38:57] POP3> STLS
[16:38:58] POP3< +OK Begin SSL/TLS negotiation now.
[16:38:58] POP3> USER ******************@opencode.com
[16:38:58] POP3< +OK Password required.
[16:38:58] POP3> PASS ********
[16:38:58] POP3< +OK logged in.
[16:38:58] POP3> STAT
[16:38:59] POP3< +OK 82 797127
[16:38:59] POP3> UIDL
[16:38:59] POP3< +OK
[16:38:59] POP3> LIST
[16:38:59] POP3< +OK POP3 clients that break here, they violate STD53.
[16:38:59] POP3> RETR 17
[16:38:59] POP3< +OK 4120 octets follow.
** Session timed out. You may be able to recover by increasing the timeout value in Preferences/Other/Miscellaneous.


Tried playing with the timeout value but id didn't help. Used another client (Opera Mail 11.01/Linux) and mail was downloaded without any trouble.

I deleted may accounts (removed directories Mail and .claws-mail) and recreated again - no change, it still chokes on the same mail message.

I can delete the message from the server through a web interface or another mail client and the rest of the messages will be downloaded without a hiccup until the problem happens again few hours later.

Other users of this mail server (with Opera Mail, Kmail, Thunderbird, Evolution, MS Outlook) do not have any complaints so i'm thinking the problem may be in Claws.

--
BRS
Atanas Zhelev
Comment 1 Guilherme de Sousa 2011-04-13 02:19:16 UTC
Same problem here... first I had the time-out problem.. then I changed the time-out value to something a lot bigger and started to have the following message:

* Connecting to POP3 server: pop3.live.com...
[01:14:37] POP3< +OK snt0-pop180 POP3 server ready
[01:14:37] POP3> USER **********@hotmail.com
[01:14:38] POP3< +OK password required
[01:14:38] POP3> PASS ********
[01:14:39] POP3< +OK mailbox has 17941 messages
[01:14:39] POP3> STAT
[01:14:39] POP3< +OK 17941 1343723662
[01:14:39] POP3> UIDL
[01:14:39] POP3< +OK 17941 message(s)
[01:15:46] POP3> LIST
*** Error occurred while processing mail.

I'm using POP3 with hotmail, and everything was working just fine, until it wasn't. 
Setup: ArchLinux x86_64
Claws-Mail version: 3.7.9

I also tried to create a new account in claws, but it did not work.

best regards
Comment 2 Guilherme de Sousa 2011-04-15 15:12:45 UTC
The problem is in gnutls!

The update to 2.12 broke the connection.. so it isn't claws-mail bug.

Best regards
Comment 3 Colin Leroy 2011-04-15 15:29:25 UTC
Hi,

Thanks for the update. Closing the bug as INVALID, then.
Comment 4 Marcin Kosiba 2011-08-09 08:01:11 UTC
I believe the bug should be reactivated per these threads:
https://bugs.archlinux.org/task/23678
https://savannah.gnu.org/support/index.php?107660

There is an intended breaking change in gnutls 2.12, so all distros with a newer version of the package will be broken.
Comment 5 Paul 2011-08-20 15:58:38 UTC
*** Bug 2473 has been marked as a duplicate of this bug. ***
Comment 6 unsuspicious.fakename+computer 2011-08-20 16:18:28 UTC
I don't understand... does that mean this will never get fixes?


Sounds to me like this is the status of this problem:
gnutls: won't fix, this is an intended change
claws-mail: This is not a bug in claws-mail, this is a but in gnutls

Which part did I get wrong? Or am I in the wrong place again (sry)?
Comment 7 Paul 2011-08-20 16:21:05 UTC
ypu didn't miss anything.
this should have been set as re-opened before but wasn't.
Comment 8 Ricardo Mones 2011-08-22 14:04:27 UTC
FYI, this has been also reported to the Debian BTS.
See details at: http://bugs.debian.org/638823
Comment 9 users 2011-08-23 20:52:34 UTC
Changes related to this bug have been committed.
Please check latest CVS and update the bug accordingly.
You can also get the patch from:
http://www.colino.net/claws-mail/

2011-08-23 [paul]	3.7.9cvs50

	* src/common/ssl.c
		probable/possible fix/workaround for bug 2402,
		'can't download message from pop3 server'
Comment 10 Colin Leroy 2011-08-30 08:26:33 UTC
Can any of you who has GnuTLS 2.12 test with an SSL IMAP account ?

Thanks!
Comment 11 Ricardo Mones 2011-08-30 08:51:53 UTC
FWIW it works fine here (3.7.10cvs1, IMAP SSL gmail account).

$ ldd /usr/bin/claws-mail |grep tls
        libgnutls.so.26 => /usr/lib/x86_64-linux-gnu/libgnutls.so.26 (0x00007f1267256000)
        libcurl-gnutls.so.4 => /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 (0x00007f1262657000)

$ dpkg -l libgnutls26 | grep ii
ii  libgnutls26                           2.12.7-4                         GNU TLS library - runtime library
Comment 12 Colin Leroy 2011-08-30 09:02:07 UTC
Created attachment 1003 [details]
Possible real fix

Hi,

From what I understand from https://savannah.gnu.org/support/index.php?107660 the current fix will only last for so long. 

Can you guys check that Claws Mail still works with this patch and gnutls 2.12 ?

Thanks
Comment 13 Colin Leroy 2011-08-30 09:03:08 UTC
Thanks Ricardo. Can you check whether your libetpan is built against gnutls ?
Comment 14 Ricardo Mones 2011-08-30 10:20:16 UTC
Yep, seems so:

$ ldd /usr/lib/libetpan.so.15|grep tls
        libcurl-gnutls.so.4 => /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 (0x00007f6bbf365000)
        libgnutls.so.26 => /usr/lib/x86_64-linux-gnu/libgnutls.so.26 (0x00007f6bbe8de000)
Comment 15 unsuspicious.fakename+computer 2011-08-30 10:44:07 UTC
First of all: I have no idea what I'm doing, so be careful with that info:

claws-mail-3.7.10cvs7 did *look* as if it worked at first, and broke again later after successfully retrieving mails a few times, just like it happened when I tried to fix it by manually removing the "broken mails" on the server some time ago.

At the moment the "Possible real fix" patch, using gnutls 3.0.1 seems to work fine. Have only been using it for a while now though. 

After downgrading to gnutls-2.12.2:
claws-mail --debug
claws-mail: error while loading shared libraries: libgnutls.so.28: cannot open shared object file: No such file or directory

After recompiling [claws-mail-3.7.10cvs7 +  "Possible real fix" patch]: seems to work fine with gnutls-2.12.2 too. 

Not sure if that's of any use, but my shared library thingy says nothing with tls for libetpan: 
ldd /usr/lib/libetpan.so.15 | grep t
	libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0x00007f56039ec000)
	libcrypt.so.1 => /lib/libcrypt.so.1 (0x00007f5602fee000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f5602acd000)
	libpthread.so.0 => /lib/libpthread.so.0 (0x00007f5601e9d000)
Comment 16 Colin Leroy 2011-08-30 11:30:42 UTC
Hi Unsuspiscious Fakename :)

Your report are based on an IMAP or POP3 account ?

I'm also interested on reports from Guilherme and Atanas (pretty please :))

Thanks!
Comment 17 Oleg 2011-08-30 14:04:33 UTC
Hi.

I have the same problem with CommuniGate Mail server via POP3s.

I'm using Arch i686 with gnutls 3.0.1-1 and claws-mail 3.7.10-1.

Here is claws-mail --debug output:
----------------------------------------------
progressdialog.c:61:Creating progress dialog...
inc.c:775:getting new messages of account user@domain.com...
** Message: Account 'user@domain.com': Connecting to POP3 server: mail.domain.com...

ssl.c:211:waiting for SSL_connect thread...
ssl.c:229:SSL_connect thread returned 0
ssl_certificate.c:443:got /home/user/.claws-mail/certs/mail.domain.com.995.cert first try
ssl_certificate.c:282:got cert! 0xa7c3518
ssl_certificate.c:454:got cert 0xa7bf160
session.c:184:session (0xa5f1600): connected
[15:55:25] POP3< +OK CommuniGate Pro POP3 Server 5.1.16 ready <96539.1311705325@mail.domain.com>
[15:55:25] POP3> USER user@domain.com
[15:55:25] POP3< +OK please send the PASS
[15:55:25] POP3> PASS ********
[15:55:25] POP3< +OK 1908 messages (19812016 bytes)
[15:55:25] POP3> STAT
[15:55:25] POP3< +OK 1908 19812016
[15:55:25] POP3> UIDL
[15:55:25] POP3< +OK 1908 messages

** (claws-mail:12591): WARNING **: session timeout.

session.c:353:session (0xa5f1600): closed
folder.c:4267:tmpparentroot /home/user/.claws-mail/tempfolder
folder.c:4287:*TMP* already created
folder.c:2147:Scanning folder processing for cache changes.
mh.c:289:mh_get_num_list(): Scanning processing ...
current dir: /home/user/work/.claws-mail/tempfolder/processing
mh.c:1369:MH: forced mtime of processing to 1314704855
msgcache.c:602:	Reading swapped message cache from /home/user/.claws-mail/tempfolder/processing/.claws_cache...
msgcache.c:618:using Noop Converter
msgcache.c:790:done. (0 items read)
msgcache.c:791:Cache size: 0 messages, 0 bytes
msgcache.c:821:reading swapped mark file.
msgcache.c:907:reading swapped tags file.
folder.c:2705:TIMING folder_item_read_cache : 0s001ms
folder.c:2566:Total cache memory usage: 0
msgcache.c:274:TIMING msgcache_get_msg_list : 0s000ms
msgcache.c:274:TIMING msgcache_get_msg_list : 0s000ms
filtering.c:189:checking 0 messages

** (claws-mail:12591): WARNING **: [15:56:26] Session timed out. You may be able to recover by increasing the timeout value in Preferences/Other/Miscellaneous.

alertpanel.c:252:Creating alert panel dialog...
alertpanel.c:211:called inc_lock (lock count 1)
alertpanel.c:221:called inc_unlock (lock count 0)
alertpanel.c:106:return value = 0
mh.c:231:MH scan not required: /home/user/.claws-mail/tempfolder/processing (1314704855 <= 1314704855)
folder.c:2730:Save cache for folder #mh/TEMP_FOLDER/processing
msgcache.c:1169:	Writing message cache to (null) and (null)...
msgcache.c:1250:done.
msgcache.c:1251:TIMING msgcache_write : 0s000ms
mh.c:1369:MH: forced mtime of processing to 1314704855
session.c:225:session (0xa5f1600): destroyed
inc.c:1503:added timer = 252
----------------------------------------------

gnutls 2.10.5-1 and claws-mail 3.7.9-4 works fine.
Comment 18 Colin Leroy 2011-08-30 14:42:41 UTC
Hi, can you check with the patch attached to this bug?
Thanks.
Comment 19 Oleg 2011-08-30 16:44:45 UTC
Colin, I've applied gnutls_possible_fix_1.patch to claws-mail 3.7.10 and I think it works with gnutls 3.0.1-1. It can receive emails. Thank you so much!
If it fails I'll write here.
Comment 20 users 2011-08-30 18:44:42 UTC
Changes related to this bug have been committed.
Please check latest CVS and update the bug accordingly.
You can also get the patch from:
http://www.colino.net/claws-mail/

2011-08-30 [colin]	3.7.10cvs10

	* src/common/socket.c
	* src/common/ssl.c
		Long-term fix for bug #2402, "GnuTLS change breaks socket
		communication", as per http://savannah.gnu.org/support/?107660

Note You need to log in before you can comment on or make changes to this bug.