if (!strcasecmp(buf, MAILROOM)) strcpy(buf, "INBOX");
}
}
+
+
+/*
+ * Parse a parenthesized list of items (as with the FETCH command)
+ */
+int imap_extract_data_items(char *items) {
+ int num_items = 0;
+ int i;
+
+ /* First, convert all whitespace to ordinary space characters */
+ for (i=0; i<strlen(items); ++i) {
+ if (isspace(items[i])) items[i] = ' ';
+ }
+
+ return num_items;
+}
+
+
strcpy(towhere, parms[2]);
/* IMAP uses the reserved name "INBOX" for the user's default incoming
- * mail folder. Convert this to Citadel's reserved name "_MAIL_".
+ * mail folder. Convert this to whatever Citadel is using for the
+ * default mail room name (usually "Mail>").
*/
- if (!strcasecmp(towhere, "INBOX"))
+ if (!strcasecmp(towhere, "INBOX")) {
strcpy(towhere, MAILROOM);
+ }
/* First try a regular match */
c = getroom(&QRscratch, towhere);
ra = CtdlRoomAccess(&QRscratch, &CC->usersupp);
/* normal clients have to pass through security */
- if (ra & UA_KNOWN)
+ if (ra & UA_KNOWN) {
ok = 1;
+ }
}
/* Fail here if no such room */
cprintf("* lo=%d hi=%d items=<%s>\r\n", lo, hi, items);
}
-
/*
* Mark Crispin is a fscking idiot.
*/
strcat(items, parms[i]);
if (i < (num_parms-1)) strcat(items, " ");
}
- for (i=0; i<strlen(items); ++i) {
- if (isspace(items[i])) items[i] = ' ';
- }
+
+ imap_extract_data_items(items);
imap_do_fetch(lo, hi, items);
cprintf("%s OK FETCH completed\r\n", parms[0]);