Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>UPDATE June 2016</strong></p> <p>Bear in mind that <code>XLIST</code> in Gmail IMAP <a href="https://developers.google.com/gmail/imap_extensions#xlist_is_deprecated" rel="nofollow noreferrer">was deprecated in 2013</a> and will eventually be removed.</p> <p>You will need to use the <a href="https://tools.ietf.org/html/rfc6154" rel="nofollow noreferrer">SPECIAL-USE mailboxes</a> instead. </p> <p>Unfortunately, Gmail doesn't advertise this capability as per the spec, but it is implemented and works correctly (tested on 09/09/2016) - note the \Trash flag:</p> <pre><code>C: 55535a988a074191 LIST "" * RETURN (SPECIAL-USE) S: ... S: * LIST (\HasNoChildren \Trash) "/" "[Gmail]/Bin" </code></pre> <p>Regular LIST returns the same response as well (I'd say this is Gmail's bug).</p> <hr> <p><strong>Original Answer</strong></p> <p>There is a better way: <strong>XLIST</strong> command.</p> <p>Google and Apple developed a special IMAP command XLIST to address this issue.</p> <p>IMAP XLIST command <strong>returns a list of folders and their well-know flags</strong> (\Inbox, \Drafts, \Trash, \Sent, \Spam):</p> <pre><code>* XLIST (\HasNoChildren \Inbox) "/" "Inbox" </code></pre> <p><a href="https://www.limilabs.com/mail" rel="nofollow noreferrer">Mail.dll IMAP client</a> (Commercial product I've created) supports XLIST command. It is used automatically when server advertises support for this feature. You can read more here: <a href="https://www.limilabs.com/blog/localized-gmail-imap-folders" rel="nofollow noreferrer">https://www.limilabs.com/blog/localized-gmail-imap-folders/</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload