Malformed XLIST replies

Bogdan Szczurek thebodzio at gmail.com
Mon Jun 20 17:23:16 UTC 2022


Hi!

Some (considerable) time ago, I, as one of the Mailspring 
(https://getmailspring.com/) users, had a problem with setting up IMAP 
email account hosted on home.pl. I was able to narrow down the problem 
to how the Mailspring handles server response regarding folder list. The 
problem is twofold: a) how the response is handled by Mailspring's IMAP 
libraries, b) how the server itself responds. As to the first part of 
the problem I submitted relevant bug reports 
(https://github.com/MailCore/mailcore2/issues/1908 and 
https://github.com/dinhvh/libetpan/issues/403) and but the second part 
appears to belong here, since home.pl uses Dovecot as their IMAP server.

Now about the problem.

When XLIST is used to get the list of the folders, I get, for example:

3 XLIST "" "*"
* XLIST (\HasNoChildren \) "." "Archive"
* XLIST (\HasNoChildren \) "." "Courses"
* XLIST (\HasNoChildren \Draft) "." "DRAFTS"
* XLIST (\HasNoChildren \Inbox) "." "INBOX"
* XLIST (\HasChildren \) "." "PhD"
* XLIST (\HasNoChildren \) "." "PhD.Advisor"
* XLIST (\HasNoChildren \) "." "PhD.Archive"
* XLIST (\HasNoChildren \) "." "PhD.Articles"
* XLIST (\HasNoChildren \) "." "PhD.Conferences"
* XLIST (\HasNoChildren \) "." "PhD.Journals"
* XLIST (\HasNoChildren \) "." "PhD.Thesis"
3 OK Completed

Compare this with the LIST output:

4 LIST "" "*"
* LIST (\HasNoChildren) "." "Archive"
* LIST (\HasNoChildren) "." "Courses"
* LIST (\HasNoChildren \Drafts) "." "DRAFTS"
* LIST (\HasNoChildren) "." "INBOX"
* LIST (\HasChildren) "." "PhD"
* LIST (\HasNoChildren) "." "PhD.Advisor"
* LIST (\HasNoChildren) "." "PhD.Archive"
* LIST (\HasNoChildren) "." "PhD.Articles"
* LIST (\HasNoChildren) "." "PhD.Conferences"
* LIST (\HasNoChildren) "." "PhD.Journals"
* LIST (\HasNoChildren) "." "PhD.Thesis"
4 OK Completed

Notice, how in the XLIST example, every item has an additional “empty” 
flag (“\”). This part causes libetpan to fail. While ignoring the 
problem as a library's problem would be perfectly understandable, I 
think it should be also considered if something shouldn't be done on 
Dovecot's end. Granted, XLIST has been long depreceated, however it 
still is implemented and it should be implemented properly. Perhaps I'm 
mistaken, but I failed to find any mention of a thing like “empty flag”. 
It might not be prohibited, but it strikes me as something bizarre.

I am unable to get the information about the Dovecot version used by 
home.pl, but I suspect this problem may still be present up to the 
newest version. Also, if someone is willing to take a closer look at the 
problem, I can provide you with an email account for testing purposes.

Best regards!
Bogdan



More information about the dovecot mailing list