3

I am facing a weird issue where a mailbox is being shown in the LIST command but when I select it, it says "Mailbox doesn't exist". I am also allowed to select the child folder.

x login <email> <pwd>
x OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY NOTIFY METADATA QUOTA] Logged in
x list "" "*"
* LIST (\HasChildren) "/" ABC
* LIST (\HasNoChildren \UnMarked) "/" ABC/aaa
* LIST (\HasChildren \UnMarked) "/" Spam
* LIST (\HasChildren) "/" INBOX
* ... other mailboxes
x OK List completed (0.026 + 0.000 + 0.025 secs).

Selecting ABC mailbox gives mailbox doesn't exist, but not for it's child folder:

x SELECT "ABC"
x NO Mailbox doesn't exist: ABC (0.006 + 0.000 + 0.005 secs).

x SELECT "ABC/aaa"
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANEN....

Selecting Spam or INBOX or any other folder works:

x SELECT "Spam"
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Delete

x SELECT "INBOX"
* OK [CLOSED] Previous mailbox closed.
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft $Forwarded $cl_1 $cl_2)
* OK [PERMANENTFLAG...

Can someone help me to understand what is happening?

Abhishek Kumar
  • 3,328
  • 2
  • 18
  • 31
  • It looks like it might be a folder than only exists to have children. Nornally these are annotated \NoSelect though. Can you access it with any other client? – Max Aug 19 '18 at 17:02
  • I can't see "ABC" or "ABC/aaa" folder from OpenXchange client – Abhishek Kumar Aug 20 '18 at 00:51
  • As suggested [here](https://www.imapwiki.org/ClientImplementation/MailboxList#preview), it is better to use `%` instead of `*`: `LIST "" %` . Can you try this? – Ghasem Naddaf Aug 29 '18 at 00:56

1 Answers1

0

As shown on imapwiki.org, you should avoid using the * wildcard, so you should use 1 LIST "" % instead of 1 LIST "" * As well as this, LIST is a loosely defined command, and will often produce duplicates when using 1 LIST "" *. Using 1 LIST "" % fixes this issue.

Pranav Sharma
  • 232
  • 2
  • 8