[Bug 160263] New: KMail does parse LIST responses where the INBOX is not first correctly

Ladar Levison ladar at lavabit.com
Wed Apr 2 15:12:01 BST 2008

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
           Summary: KMail does parse LIST responses where the INBOX is not
                    first correctly
           Product: kmail
           Version: unspecified
          Platform: Ubuntu Packages
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: kdepim-bugs kde org
        ReportedBy: ladar lavabit com

Version:            (using KDE 3.5.8)
Installed from:    Ubuntu Packages
OS:                Linux

When processing the response to the command:

10 LIST "" "%"

KMail requires that the Inbox be listed first. However technically speaking, the folders, including the Inbox can be listed in any order. This causes very weird behavior. Here is a sample response:

* LIST () "." "Cocoa"
* LIST () "." "Drafts"
* LIST (\Noinferiors) "." "Inbox"
* LIST () "." "One"
* LIST () "." "Sent"
* LIST () "." "Special"
* LIST () "." "Spoofed"
* LIST () "." "Trash"
10 OK LIST Complete.

If this is the response, KMail will store the name of the Drafts folder as INBOX. As a result, on a subsequent login the commands will look like:

8 STATUS "One.Two.Three" (UNSEEN)
10 STATUS "Special" (UNSEEN)
11 STATUS "Spoofed" (UNSEEN)
12 STATUS "Trash" (UNSEEN)
13 LIST "" "%"
14 LIST "" "Cocoa.%"
15 LIST "" "Drafts.%"
16 LIST "" "One.%"
17 LIST "" "Sent.%"
18 LIST "" "Special.%"
19 LIST "" "Spoofed.%"
20 LIST "" "Trash.%"
21 LIST "" "One.Two.%"
22 LIST "" "One.Two.Three.%"

Note how the status for the folder INBOX is requested twice (commands 4 & 5). Furthermore, if the user were to select the Drafts folder, the inbox will actually be selected, resulting in all of the messages in the inbox folder appearing in the drafts folder. 

On a side note, KMail does not appear to parse the folder flags insensitive to case. So, for example, KMail will detect \Noinferiors, it will NOT detect \NoInferiors. If memory serves this causes a serious issue with LIST "" "", if the flag returned is \NoSelect.

More information about the Kdepim-bugs mailing list