char buf[LONG_STRING*2];
char mbox[LONG_STRING];
char munged_mbox[LONG_STRING];
- char list_cmd[18];
+ const char *list_cmd;
int len;
int n;
int nsup;
if (option (OPTIMAPLSUB))
{
- const char *lsub_cmd = "LSUB";
-
/* RFC3348 section 3 states LSUB is unreliable for hierarchy information.
* The newer LIST extensions are designed for this.
*/
if (mutt_bit_isset (idata->capabilities, LIST_EXTENDED))
- lsub_cmd = "LIST (SUBSCRIBED)";
- strfcpy (list_cmd, lsub_cmd, sizeof (list_cmd));
+ list_cmd = "LIST (SUBSCRIBED RECURSIVEMATCH)";
+ else
+ list_cmd = "LSUB";
}
else
{
- strfcpy (list_cmd, "LIST", sizeof (list_cmd));
+ list_cmd = "LIST";
}
mutt_message _("Getting folder list...");
{
if (!ascii_strncasecmp (s, "\\NoSelect", 9))
list->noselect = 1;
+ else if (!ascii_strncasecmp (s, "\\NonExistent", 12)) /* rfc5258 */
+ list->noselect = 1;
else if (!ascii_strncasecmp (s, "\\NoInferiors", 12))
list->noinferiors = 1;
- /* See draft-gahrns-imap-child-mailbox-?? */
- else if (!ascii_strncasecmp (s, "\\HasNoChildren", 14))
+ else if (!ascii_strncasecmp (s, "\\HasNoChildren", 14)) /* rfc5258*/
list->noinferiors = 1;
s = imap_next_word (s);
idata->status = IMAP_FATAL;
return;
}
+
+ if (strlen(idata->buf) < litlen)
+ {
+ dprint (1, (debugfile, "Error parsing LIST mailbox\n"));
+ return;
+ }
+
list->name = idata->buf;
+ s = list->name + litlen;
+ if (*s)
+ {
+ *s = '\0';
+ s++;
+ SKIPWS(s);
+ }
}
else
{
- imap_unmunge_mbox_name (idata, s);
list->name = s;
+ /* Exclude rfc5258 RECURSIVEMATCH CHILDINFO suffix */
+ s = imap_next_word (s);
+ if (*s)
+ *(s - 1) = '\0';
+ imap_unmunge_mbox_name (idata, list->name);
}
if (list->name[0] == '\0')