if (!strncasecmp(which_fields, "HEADER.FIELDS.NOT", 17))
headers_not = 1;
- for (i=0; !IsEmptyStr(&which_fields[i]); ++i) {
+ for (i=0; which_fields[i]; ++i) {
if (which_fields[i]=='(')
strcpy(which_fields, &which_fields[i+1]);
}
- for (i=0; !IsEmptyStr(&which_fields[i]); ++i) {
+ for (i=0; which_fields[i]; ++i) {
if (which_fields[i]==')') {
which_fields[i] = 0;
break;
lprintf(CTDL_DEBUG, "Section is: %s%s\n",
section,
IsEmptyStr(section) ? "(empty)" : "");
- if (!strncasecmp(section, "HEADER", 6)) {
- need_body = 0;
- }
+
+ /*
+ * We used to have this great optimization in place that would avoid
+ * fetching the entire RFC822 message from disk if the client was only
+ * asking for the headers. Unfortunately, fetching only the Citadel
+ * headers omits "Content-type:" and this behavior breaks the iPhone
+ * email client. So we have to fetch the whole message from disk. The
+ *
+ * if (!strncasecmp(section, "HEADER", 6)) {
+ * need_body = 0;
+ * }
+ *
+ */
/* Burn the cache if we don't have the same section of the
* same message again.
size_t i;
char cbmaintype[128];
char cbsubtype[128];
+ char iteration[128];
if (cbtype != NULL) if (!IsEmptyStr(cbtype)) have_cbtype = 1;
if (have_cbtype) {
strcpy(cbsubtype, "PLAIN");
}
+ /* If this is the second or subsequent part of a multipart sequence,
+ * we need to output another space here. We do this by obtaining the
+ * last subpart token of the partnum and converting it to a number.
+ */
+ if (strrchr(partnum, '.')) {
+ safestrncpy(iteration, (strrchr(partnum, '.')+1), sizeof iteration);
+ }
+ else {
+ safestrncpy(iteration, partnum, sizeof iteration);
+ }
+ if (atoi(iteration) > 1) {
+ cprintf(" ");
+ }
+
+
+ /* output loop */
+
cprintf("(");
imap_strout(cbmaintype);
cprintf(" ");
int i;
int nest = 0;
- for (i=0; !IsEmptyStr(&str[i]); ++i) {
+ for (i=0; str[i]; ++i) {
if (str[i]=='(') ++nest;
if (str[i]=='[') ++nest;
if (str[i]=='<') ++nest;
long initial_len;
/* Convert all whitespace to ordinary space characters. */
- for (i=0; !IsEmptyStr(&items[i]); ++i) {
+ for (i=0; items[i]; ++i) {
if (isspace(items[i])) items[i]=' ';
}