cprintf("BODYSTRUCTURE (\"TEXT\" \"PLAIN\" "
"(\"CHARSET\" \"US-ASCII\") NIL NIL "
- "\"7BIT\" %ld %ld) ", bytes, lines);
+ "\"7BIT\" %ld %ld)", bytes, lines);
return;
}
/* For messages already stored in RFC822 format, we have to parse. */
- cprintf("BODYSTRUCTURE (");
+ cprintf("BODYSTRUCTURE ");
mime_parser(msg->cm_fields['M'],
NULL,
*imap_fetch_bodystructure_part, /* part */
*imap_fetch_bodystructure_post, /* post-multi */
NULL,
0);
- cprintf(") ");
}
/* If this part is not encoded, send as-is */
if ( (strlen(encoding) == 0) || (dont_decode)) {
- CallBack(name, filename, partnum, disposition, part_start,
- content_type, length, encoding, userdata);
+ if (CallBack != NULL) {
+ CallBack(name, filename, partnum,
+ disposition, part_start,
+ content_type, length, encoding, userdata);
+ }
return;
}
if ((strcasecmp(encoding, "base64"))
bytes_recv = bytes_recv + blocksize;
}
- if (bytes_recv > 0)
+ if (bytes_recv > 0) if (CallBack != NULL) {
CallBack(name, filename, partnum, disposition, decoded,
content_type, bytes_recv, "binary", userdata);
+ }
phree(decoded);
}
if (is_multipart) {
/* Tell the client about this message's multipartedness */
- PreMultiPartCallBack("", "", partnum, "", NULL, content_type,
+ if (PreMultiPartCallBack != NULL) {
+ PreMultiPartCallBack("", "", partnum, "",
+ NULL, content_type,
0, encoding, userdata);
+ }
/*
- CallBack("", "", partnum, "", NULL, content_type,
+ if (CallBack != NULL) {
+ CallBack("", "", partnum, "", NULL, content_type,
0, encoding, userdata);
+ }
*/
/* Figure out where the boundaries are */
part_start = ptr;
}
} while (strcasecmp(buf, endary));
-END_MULTI: PostMultiPartCallBack("", "", partnum, "", NULL, content_type,
- 0, encoding, userdata);
+END_MULTI: if (PostMultiPartCallBack != NULL) {
+ PostMultiPartCallBack("", "", partnum, "", NULL,
+ content_type, 0, encoding, userdata);
+ }
return;
}