fseek(tmp, 0L, SEEK_END);
total_size = ftell(tmp);
text_size = total_size - headers_size;
- lprintf(CTDL_DEBUG, "RFC822: headers=%ld, text=%ld, total=%ld\n",
- headers_size, text_size, total_size);
+ /* lprintf(CTDL_DEBUG, "RFC822: headers=%ld, text=%ld, total=%ld\n",
+ headers_size, text_size, total_size); */
if (!strcasecmp(whichfmt, "RFC822.SIZE")) {
cprintf("RFC822.SIZE %ld", total_size);
if (strchr(section, '[') != NULL) {
stripallbut(section, '[', ']');
}
- lprintf(CTDL_DEBUG, "Section is: %s%s\n", section, ((strlen(section)==0) ? "(empty)" : "") );
+ /* lprintf(CTDL_DEBUG, "Section is: %s%s\n", section, ((strlen(section)==0) ? "(empty)" : "") ); */
/* Burn the cache if we don't have the same section of the
* same message again.
is_partial = 1;
}
if (is_partial == 0) strcpy(partial, "");
- if (strlen(partial) > 0) lprintf(CTDL_DEBUG, "Partial is %s\n", partial);
+ /* if (strlen(partial) > 0) lprintf(CTDL_DEBUG, "Partial is %s\n", partial); */
if (IMAP->cached_body == NULL) {
tmp = tmpfile();
else if (!strcmp(section, "")) {
CtdlRedirectOutput(tmp, -1);
- lprintf(CTDL_DEBUG, "calling CtdlOutputPreLoadedMsg()\n");
+ /* lprintf(CTDL_DEBUG, "calling CtdlOutputPreLoadedMsg()\n");
lprintf(CTDL_DEBUG, "msg %s null\n", ((msg == NULL) ? "is" : "is not") );
- lprintf(CTDL_DEBUG, "msgnum is %ld\n", msgnum);
+ lprintf(CTDL_DEBUG, "msgnum is %ld\n", msgnum); */
CtdlOutputPreLoadedMsg(msg, msgnum, MT_RFC822,
HEADERS_ALL, 0, 1);
CtdlRedirectOutput(NULL, -1);
*/
else if (!strncasecmp(section, "HEADER", 6)) {
CtdlRedirectOutput(tmp, -1);
- lprintf(CTDL_DEBUG, "calling CtdlOutputPreLoadedMsg()\n");
+ /* lprintf(CTDL_DEBUG, "calling CtdlOutputPreLoadedMsg()\n");
lprintf(CTDL_DEBUG, "msg %s null\n", ((msg == NULL) ? "is" : "is not") );
- lprintf(CTDL_DEBUG, "msgnum is %ld\n", msgnum);
+ lprintf(CTDL_DEBUG, "msgnum is %ld\n", msgnum); */
CtdlOutputPreLoadedMsg(msg, msgnum, MT_RFC822,
HEADERS_ONLY, 0, 1);
CtdlRedirectOutput(NULL, -1);
*/
else if (!strncasecmp(section, "TEXT", 4)) {
CtdlRedirectOutput(tmp, -1);
- lprintf(CTDL_DEBUG, "calling CtdlOutputPreLoadedMsg()\n");
+ /* lprintf(CTDL_DEBUG, "calling CtdlOutputPreLoadedMsg()\n");
lprintf(CTDL_DEBUG, "msg %s null\n", ((msg == NULL) ? "is" : "is not") );
- lprintf(CTDL_DEBUG, "msgnum is %ld\n", msgnum);
+ lprintf(CTDL_DEBUG, "msgnum is %ld\n", msgnum); */
CtdlOutputPreLoadedMsg(msg, msgnum, MT_RFC822,
HEADERS_NONE, 0, 1);
CtdlRedirectOutput(NULL, -1);
int i;
struct CtdlMessage *msg = NULL;
- lprintf(CTDL_DEBUG, "imap_do_fetch_msg(%d, %d)\n", seq, num_items);
- for (i=0; i<num_items; ++i) {
- lprintf(CTDL_DEBUG, " %s\n", itemlist[i]);
- }
-
cprintf("* %d FETCH (", seq);
for (i=0; i<num_items; ++i) {
return;
}
+ /* if (num_parms >= 5) {
+ FIXME add flags: parms[3]
+ } */
+
+ /* if (num_parms >= 6) {
+ FIXME add internaldate: parms[4]
+ } */
+
literal_length = atol(&parms[num_parms-1][1]);
if (literal_length < 1) {
cprintf("%s BAD Message length must be at least 1.\r\n",
IMAP->transmitted_length = literal_length;
cprintf("+ Transmit message now.\r\n");
- lprintf(CTDL_DEBUG, "imap_append() expecting %ld bytes\n",
- literal_length);
bytes_transferred = 0;
else {
bytes_transferred += blksize; /* keep going */
}
- lprintf(CTDL_DEBUG, "Received %ld of %ld bytes (%ld%%)\n",
- bytes_transferred,
- literal_length,
- ((bytes_transferred * 100) / literal_length)
- );
} while (bytes_transferred < literal_length);
IMAP->transmitted_message[literal_length] = 0;
cprintf("%s NO Read failed.\r\n", parms[0]);
return;
}
- lprintf(CTDL_DEBUG, "imap_append() finished reading message\n");
/* I think there's supposed to be a trailing CRLF after the
* literal (the message text) is received. This call to
*/
flush_output();
client_getln(buf, sizeof buf);
- lprintf(CTDL_DEBUG, "Trailing CRLF: %s\n", buf);
/* Convert RFC822 newlines (CRLF) to Unix newlines (LF) */
- lprintf(CTDL_DEBUG, "Converting newline format\n");
stripped_length = 0;
for (i=0; i<literal_length; ++i) {
if (strncmp(&IMAP->transmitted_message[i], "\r\n", 2)) {