Ticket #178 (closed Bugs: fixed)

Opened 2 years ago

Last modified 21 months ago

Not handling the "literal string" format for folder names in LIST responses

Reported by: resnick Owned by: octo
Priority: blocker Milestone: 2.0
Component: LogicMail Version: 1.1
Keywords: Cc:
Blocked By: Blocking:

Description

Looks like you're failing to deal with spaces in IMAP folder names when LISTing subfolders. In the below log, you should be looking for "Old Inboxes", but instead you look for "Old". Here's the log:

E LogicMail - org.logicprobe.LogicMail.mail.MailException: NO folder not found - 2/13 17:03:35 E LogicMail - org.logicprobe.LogicMail.mail.MailException: NO folder not found - 2/13 16:58:48 i LogicMail - Connection closed - 2/13 16:55:17 d LogicMail - [RECV] A7 OK LOGOUT complete - 2/13 16:55:17 d LogicMail - [RECV] * BYE server logging out - 2/13 16:55:17 d LogicMail - [SEND CMD] A7 LOGOUT - 2/13 16:55:15 d LogicMail - ImapProtocol.executeLogout() - 2/13 16:55:15 E LogicMail - org.logicprobe.LogicMail.mail.MailException: NO folder not found - 2/13 16:55:00 d LogicMail - [RECV] A6 NO folder not found - 2/13 16:55:00 d LogicMail - [SEND CMD] A6 LIST "Old:" "%" - 2/13 16:54:59 d LogicMail - ImapProtocol.executeList("Old:", "%") - 2/13 16:54:59 d LogicMail - [RECV] A5 OK LIST complete - 2/13 16:54:59 d LogicMail - [RECV] Marya:marya-out - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noinferiors) ":" {15} - 2/13 16:54:59 d LogicMail - [RECV] Marya:marya-archive - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noinferiors) ":" {19} - 2/13 16:54:59 d LogicMail - [SEND CMD] A5 LIST "Marya:" "%" - 2/13 16:54:59 d LogicMail - ImapProtocol.executeList("Marya:", "%") - 2/13 16:54:59 d LogicMail - [RECV] A4 OK LIST complete - 2/13 16:54:59 d LogicMail - [RECV] Trash - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noinferiors) ":" {5} - 2/13 16:54:59 d LogicMail - [RECV] test - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noinferiors) ":" {4} - 2/13 16:54:59 d LogicMail - [RECV] tempIn - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noinferiors) ":" {6} - 2/13 16:54:59 d LogicMail - [RECV] temp - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noinferiors) ":" {4} - 2/13 16:54:59 d LogicMail - [RECV] sunday-sing-outgoing - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noinferiors) ":" {20} - 2/13 16:54:59 d LogicMail - [RECV] SmartFriends Folder - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noselect) ":" {19} - 2/13 16:54:59 d LogicMail - [RECV] reading - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noinferiors) ":" {7} - 2/13 16:54:59 d LogicMail - [RECV] Pre-filtered Junk - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noinferiors) ":" {17} - 2/13 16:54:59 d LogicMail - [RECV] Old Inboxes - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noselect) ":" {11} - 2/13 16:54:59 d LogicMail - [RECV] non-sing-archive - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noinferiors) ":" {16} - 2/13 16:54:59 d LogicMail - [RECV] Marya - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noselect) ":" {5} - 2/13 16:54:59 d LogicMail - [RECV] macjordomo - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noinferiors) ":" {10} - 2/13 16:54:59 d LogicMail - [RECV] Junk (Pete) - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noinferiors) ":" {11} - 2/13 16:54:59 d LogicMail - [RECV] Junk - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noinferiors) ":" {4} - 2/13 16:54:59 d LogicMail - [RECV] Inbox - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noinferiors) ":" {5} - 2/13 16:54:59 d LogicMail - [RECV] fpcs - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noinferiors) ":" {4} - 2/13 16:54:59 d LogicMail - [RECV] expert - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noselect) ":" {6} - 2/13 16:54:59 d LogicMail - [RECV] Deleted Messages - 2/13 16:54:59 d LogicMail - [RECV] * LIST (\Noinferiors) ":" {16} - 2/13 16:54:59 d LogicMail - [SEND CMD] A4 LIST "" "%" - 2/13 16:54:58 d LogicMail - ImapProtocol.executeList("", "%") - 2/13 16:54:58 d LogicMail - [RECV] A3 OK NAMESPACE completed - 2/13 16:54:58 d LogicMail - [RECV] * NAMESPACE (("" ":")) NIL NIL - 2/13 16:54:58 d LogicMail - [SEND CMD] A3 NAMESPACE - 2/13 16:54:58 d LogicMail - ImapProtocol.executeNamespace() - 2/13 16:54:58 d LogicMail - [RECV] A2 OK CAPABILITY completed - 2/13 16:54:58 d LogicMail - [RECV] * CAPABILITY IMAP4rev1 AUTH=CRAM-MD5 AUTH=DIGEST-MD5 AUTH=NTLM UIDPLUS IDLE QUOTA NAMESPACE - 2/13 16:54:58 d LogicMail - [SEND CMD] A2 CAPABILITY - 2/13 16:54:57 d LogicMail - ImapProtocol.executeCapability() - 2/13 16:54:57 d LogicMail - [RECV] A1 OK login successful - 2/13 16:54:57

Change History

comment:1 Changed 2 years ago by octo

Repost of log with a more readable order and correct formatting:

d LogicMail - [RECV] A1 OK login successful - 2/13 16:54:57
d LogicMail - ImapProtocol.executeCapability() - 2/13 16:54:57
d LogicMail - [SEND CMD] A2 CAPABILITY - 2/13 16:54:57
d LogicMail - [RECV] * CAPABILITY IMAP4rev1 AUTH=CRAM-MD5 AUTH=DIGEST-MD5 AUTH=NTLM UIDPLUS IDLE QUOTA NAMESPACE - 2/13 16:54:58
d LogicMail - [RECV] A2 OK CAPABILITY completed - 2/13 16:54:58
d LogicMail - ImapProtocol.executeNamespace() - 2/13 16:54:58
d LogicMail - [SEND CMD] A3 NAMESPACE - 2/13 16:54:58
d LogicMail - [RECV] * NAMESPACE (("" ":")) NIL NIL - 2/13 16:54:58
d LogicMail - [RECV] A3 OK NAMESPACE completed - 2/13 16:54:58
d LogicMail - ImapProtocol.executeList("", "%") - 2/13 16:54:58
d LogicMail - [SEND CMD] A4 LIST "" "%" - 2/13 16:54:58
d LogicMail - [RECV] * LIST (\Noinferiors) ":" {16} - 2/13 16:54:59
d LogicMail - [RECV] Deleted Messages - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noselect) ":" {6} - 2/13 16:54:59
d LogicMail - [RECV] expert - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noinferiors) ":" {4} - 2/13 16:54:59
d LogicMail - [RECV] fpcs - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noinferiors) ":" {5} - 2/13 16:54:59
d LogicMail - [RECV] Inbox - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noinferiors) ":" {4} - 2/13 16:54:59
d LogicMail - [RECV] Junk - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noinferiors) ":" {11} - 2/13 16:54:59
d LogicMail - [RECV] Junk (Pete) - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noinferiors) ":" {10} - 2/13 16:54:59
d LogicMail - [RECV] macjordomo - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noselect) ":" {5} - 2/13 16:54:59
d LogicMail - [RECV] Marya - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noinferiors) ":" {16} - 2/13 16:54:59
d LogicMail - [RECV] non-sing-archive - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noselect) ":" {11} - 2/13 16:54:59
d LogicMail - [RECV] Old Inboxes - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noinferiors) ":" {17} - 2/13 16:54:59
d LogicMail - [RECV] Pre-filtered Junk - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noinferiors) ":" {7} - 2/13 16:54:59
d LogicMail - [RECV] reading - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noselect) ":" {19} - 2/13 16:54:59
d LogicMail - [RECV] SmartFriends Folder - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noinferiors) ":" {20} - 2/13 16:54:59
d LogicMail - [RECV] sunday-sing-outgoing - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noinferiors) ":" {4} - 2/13 16:54:59
d LogicMail - [RECV] temp - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noinferiors) ":" {6} - 2/13 16:54:59
d LogicMail - [RECV] tempIn - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noinferiors) ":" {4} - 2/13 16:54:59
d LogicMail - [RECV] test - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noinferiors) ":" {5} - 2/13 16:54:59
d LogicMail - [RECV] Trash - 2/13 16:54:59
d LogicMail - [RECV] A4 OK LIST complete - 2/13 16:54:59
d LogicMail - ImapProtocol.executeList("Marya:", "%") - 2/13 16:54:59
d LogicMail - [SEND CMD] A5 LIST "Marya:" "%" - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noinferiors) ":" {19} - 2/13 16:54:59
d LogicMail - [RECV] Marya:marya-archive - 2/13 16:54:59
d LogicMail - [RECV] * LIST (\Noinferiors) ":" {15} - 2/13 16:54:59
d LogicMail - [RECV] Marya:marya-out - 2/13 16:54:59
d LogicMail - [RECV] A5 OK LIST complete - 2/13 16:54:59
d LogicMail - ImapProtocol.executeList("Old:", "%") - 2/13 16:54:59
d LogicMail - [SEND CMD] A6 LIST "Old:" "%" - 2/13 16:54:59
d LogicMail - [RECV] A6 NO folder not found - 2/13 16:55:00
E LogicMail - org.logicprobe.LogicMail.mail.MailException: NO folder not found - 2/13 16:55:00
d LogicMail - ImapProtocol.executeLogout() - 2/13 16:55:15
d LogicMail - [SEND CMD] A7 LOGOUT - 2/13 16:55:15
d LogicMail - [RECV] * BYE server logging out - 2/13 16:55:17
d LogicMail - [RECV] A7 OK LOGOUT complete - 2/13 16:55:17
i LogicMail - Connection closed - 2/13 16:55:17
E LogicMail - org.logicprobe.LogicMail.mail.MailException: NO folder not found - 2/13 16:58:48
E LogicMail - org.logicprobe.LogicMail.mail.MailException: NO folder not found - 2/13 17:03:35

comment:2 Changed 2 years ago by octo

  • Status changed from new to accepted
  • Owner set to octo
  • Priority changed from 1 to 5
  • Summary changed from Not dealing with spaces in IMAP folder names to Not handling the "literal string" format for folder names in LIST responses

This was originally reported as: "Not dealing with spaces in IMAP folder names"

Upon investigation of the log, it appears the reporter's mail server is sending folder names using the "literal string" format as defined in the IMAP RFC 3501's formal syntax:

literal         = "{" number "}" CRLF *CHAR8
                    ; Number represents the number of CHAR8s
CHAR8           = %x01-ff
                    ; any OCTET except NUL, %x00

Based on the protocol specification in the RFC, either this "literal" format or the more common quoted string is allowed for the LIST (or LSUB) response.

This is the first time I've seen a mail server behave this way, which explains why the issue has persisted in LogicMail. I am curious as to which mail server the reporter is using. Regardless, this is a far more serious issue than implied by the original title, and needs to be fixed.

comment:3 Changed 2 years ago by resnick

The server is EIMS. Glad to give you a test account on my server if you need.

comment:4 Changed 2 years ago by octo

  • Milestone set to 1.1

comment:5 Changed 21 months ago by octo

  • Milestone changed from 1.1 to 2.0

comment:6 Changed 21 months ago by octo

  • Status changed from accepted to closed
  • Resolution set to fixed

As it turns out, LogicMail was already handling literal-string folder names, sort of. It just wasn't correctly handling them when they contained spaces. This has now been fixed in changeset [645].

Note: See TracTickets for help on using tickets.