void imap_ial_out(struct internet_address_list *ialist);
int imap_roomname(char *buf, int bufsize, char *foldername);
int imap_is_message_set(char *);
-
+int imap_mailbox_matches_pattern(char *pattern, char *mailboxname);
/*
* Flags that may be returned by imap_roomname()
ra = CtdlRoomAccess(qrbuf, &CC->usersupp);
if (ra & UA_KNOWN) {
imap_mailboxname(buf, sizeof buf, qrbuf);
- cprintf("* LSUB () \"|\" ");
- imap_strout(buf);
- cprintf("\r\n");
+ if (imap_mailbox_matches_pattern(pattern, buf)) {
+ cprintf("* LSUB () \"|\" ");
+ imap_strout(buf);
+ cprintf("\r\n");
+ }
}
}
return;
}
sprintf(pattern, "%s%s", parms[2], parms[3]);
- imap_list_floors("LSUB");
- ForEachRoom(imap_lsub_listroom, pattern);
+
+ if (strlen(parms[3])==0) {
+ cprintf("* LIST (\\Noselect) \"|\" \"\"\r\n");
+ }
+
+ else {
+ imap_list_floors("LSUB");
+ ForEachRoom(imap_lsub_listroom, pattern);
+ }
+
cprintf("%s OK LSUB completed\r\n", parms[0]);
}
if ( (ra & UA_KNOWN)
|| ((ra & UA_GOTOALLOWED) && (ra & UA_ZAPPED))) {
imap_mailboxname(buf, sizeof buf, qrbuf);
- cprintf("* LIST () \"|\" ");
- imap_strout(buf);
- cprintf("\r\n");
+ if (imap_mailbox_matches_pattern(pattern, buf)) {
+ cprintf("* LIST () \"|\" ");
+ imap_strout(buf);
+ cprintf("\r\n");
+ }
}
}
return;
}
sprintf(pattern, "%s%s", parms[2], parms[3]);
- imap_list_floors("LIST");
- ForEachRoom(imap_list_listroom, pattern);
+
+ if (strlen(parms[3])==0) {
+ cprintf("* LIST (\\Noselect) \"|\" \"\"\r\n");
+ }
+
+ else {
+ imap_list_floors("LIST");
+ ForEachRoom(imap_list_listroom, pattern);
+ }
+
cprintf("%s OK LIST completed\r\n", parms[0]);
}