! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Failure to load folder list if there exist sub-folders
Status:
RESOLVED: FIXED
Product:
Xfce4-mailwatch-plugin

Comments

Description agmaviar 2012-09-11 12:35:17 CEST
I am using XFCE 4.8, xubuntu 12.04

* There seems to be a problem with the way mailwatch tries to get the folder list when connected to IMAP accounts.

* I experience it with two of my mail accounts added to the mailwatch plugin.
Both accounts work well with Thunderbird.
On server 1, the folder list remains empty and 'connection timed out' is logged.
On server 2, the folder list is loaded except it is incomplete: the subfolder I created on the account is not in the list that is returned.

People of server 1 traced the connections made by mailwatch.
It sends:

LIST "INBOX." "%"

When folder 'Archives' has children, it should send:

LIST "INBOX.Archives." "%"

but it doesn't appear to be doing so.

So the observation made by support at server 1 is "The behaviour of our server looks fine to me reading the protocol information... but it's just disconnecting without even sending a logout command acccording to the transcripts I'm seeing - and it's not trying to look at the sub folders at all."


* A more general note:
----------------------- 
Apparently the mailwatch-plugin code tries to make up its own implementation of IMAP instead of relying on a library.
Comment 1 Bron Gondwana 2012-09-13 00:08:44 CEST
I am the admin who looked at this.  I read through the IMAP support code - very "little bobby tables" with random strings being interpolated between quotes.  In particular a password with a " in it will break horribly.

I'm happy to help out a bit with this.  I'm going to pull a git copy and build it for my own computer so I can debug locally.

Bron.
Comment 2 Bron Gondwana 2012-09-14 22:23:28 CEST
Created attachment 4629 
Increase buffer size


The title of this bug is incorrect - it has nothing to do with subfolders after all.  I had to compile up my own copy and sprinkle a few more debug statements to prove what you're doing wrong, but here it is:

xfce_mailwatch_net_conn_recv_internal

    ret = select(FD_SETSIZE, &rfd, NULL, NULL, &tv);
    if(ret > 0 && FD_ISSET(net_conn->fd, &rfd))
        break;

It ALWAYS tests if the fd still has more to read.  But it doesn't, because a full TLS packet got read off the wire - so we never get to the later:

    gret = gnutls_record_recv(net_conn->gt_session, buf, buf_len);

Unfortunately, the buffer is 1024 bytes long - so if the listing is longer than 1024 but shorter than a single packet, this will break.  Mine is about 1280.

There's a bunch of real fixes you could make here - or you could just cheat with the attached awful workaround, which is also available at:

https://github.com/brong/xfce4-mailwatch-plugin/commit/51fc1cccbda2387f33ab5d651b9d16a3510db418

Confirmed to fix the issue for me.
Comment 3 Ján Sučan editbugs 2013-08-31 13:31:20 CEST
We believe that this bug is fixed.

Bug #9284

Reported by:
agmaviar
Reported on: 2012-09-11
Last modified on: 2013-08-31

People

Assignee:
Florian Rivoal
CC List:
2 users

Version

Version:
1.1.0 or older

Attachments

Increase buffer size (1.29 KB, patch)
2012-09-14 22:23 CEST , Bron Gondwana
no flags

Additional information