#include "citserver.h"
#include "support.h"
#include "config.h"
-#include "dynloader.h"
+#include "serv_extensions.h"
#include "room_ops.h"
#include "user_ops.h"
#include "policy.h"
msgdate = time(NULL);
}
- datestring(buf, msgdate, DATESTRING_IMAP);
+ datestring(buf, sizeof buf, msgdate, DATESTRING_IMAP);
cprintf("INTERNALDATE \"%s\"", buf);
}
* Load the message into a temp file for translation and measurement
*/
CtdlRedirectOutput(tmp, -1);
- CtdlOutputPreLoadedMsg(msg, msgnum, MT_RFC822, 0, 0, 1);
+ CtdlOutputPreLoadedMsg(msg, msgnum, MT_RFC822, HEADERS_ALL, 0, 1);
CtdlRedirectOutput(NULL, -1);
if (!is_valid_message(msg)) {
lprintf(1, "WARNING: output clobbered the message!\n");
fwrite(content, length, 1, imfp->output_fp);
}
- sprintf(mbuf2, "%s.MIME", partnum);
+ snprintf(mbuf2, sizeof mbuf2, "%s.MIME", partnum);
if (!strcasecmp(imfp->desired_section, mbuf2)) {
fprintf(imfp->output_fp, "Content-type: %s", cbtype);
}
fprintf(imfp->output_fp, "\r\n");
}
- fprintf(imfp->output_fp, "Content-Length: %d\r\n", length);
+ fprintf(imfp->output_fp, "Content-Length: %ld\r\n", (long)length);
fprintf(imfp->output_fp, "\r\n");
}
else {
msgdate = time(NULL);
}
- datestring(datestringbuf, msgdate, DATESTRING_IMAP);
+ datestring(datestringbuf, sizeof datestringbuf, msgdate, DATESTRING_IMAP);
/* Now start spewing data fields. The order is important, as it is
* defined by the protocol specification. Nonexistent fields must
/* Now figure out what the client wants, and get it */
- if (!strcmp(section, "")) { /* the whole thing */
+ if ( (!strcmp(section, "1")) && (msg->cm_format_type != 4) ) {
CtdlRedirectOutput(tmp, -1);
- CtdlOutputPreLoadedMsg(msg, msgnum, MT_RFC822, 0, 0, 1);
+ CtdlOutputPreLoadedMsg(msg, msgnum, MT_RFC822,
+ HEADERS_NONE, 0, 1);
+ CtdlRedirectOutput(NULL, -1);
+ }
+
+ else if (!strcmp(section, "")) {
+ CtdlRedirectOutput(tmp, -1);
+ CtdlOutputPreLoadedMsg(msg, msgnum, MT_RFC822,
+ HEADERS_ALL, 0, 1);
CtdlRedirectOutput(NULL, -1);
}
*/
else if (!strncasecmp(section, "HEADER", 6)) {
CtdlRedirectOutput(tmp, -1);
- CtdlOutputPreLoadedMsg(msg, msgnum, MT_RFC822, 1, 0, 1);
+ CtdlOutputPreLoadedMsg(msg, msgnum, MT_RFC822,
+ HEADERS_ONLY, 0, 1);
CtdlRedirectOutput(NULL, -1);
imap_strip_headers(tmp, section);
}
}
cprintf(" ");
- cprintf("%ld ", length); /* bytes */
+ cprintf("%ld ", (long)length); /* bytes */
cprintf("NIL) "); /* lines */
}
extract_token(lostr, setstr, 0, ':');
if (num_tokens(setstr, ':') >= 2) {
extract_token(histr, setstr, 1, ':');
- if (!strcmp(histr, "*")) sprintf(histr, "%d", INT_MAX);
+ if (!strcmp(histr, "*")) snprintf(histr, sizeof histr, "%d", INT_MAX);
}
else {
strcpy(histr, lostr);