]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/imap/imap_fetch.c
Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
[citadel.git] / citadel / modules / imap / imap_fetch.c
index 407eed21fcbf2e2696a8c0bc5a35227eb1efcfa8..3f00d3f3f65c26380005589c3fc8d8d21bb1d37d 100644 (file)
@@ -190,7 +190,7 @@ void imap_fetch_rfc822(long msgnum, const char *whichfmt) {
                CCC->redirect_buffer = NewStrBufPlain(NULL, SIZ);
                CtdlOutputMsg(msgnum, MT_RFC822,
                        (need_body ? HEADERS_ALL : HEADERS_FAST),
-                       0, 1, NULL, SUPPRESS_ENV_TO, NULL, NULL
+                       0, 1, NULL, SUPPRESS_ENV_TO, NULL, NULL, NULL
                );
                if (!need_body) IAPuts("\r\n"); /* extra trailing newline */
                Imap->cached_rfc822 = CCC->redirect_buffer;
@@ -364,7 +364,7 @@ void imap_output_envelope_from(struct CtdlMessage *msg) {
                IPutStr(user, strlen(user));            /* mailbox name (user id) */
                IAPuts(" ");
                if (!strcasecmp(node, config.c_nodename)) {
-                       IPutStr(config.c_fqdn, strlen(config.c_fqdn));
+                       IPutStr(CFG_KEY(c_fqdn));
                }
                else {
                        IPutStr(node, strlen(node));            /* host name */
@@ -518,7 +518,7 @@ void imap_fetch_envelope(struct CtdlMessage *msg) {
        if (fieldptr != NULL) free(fieldptr);
 
        /* message ID */
-       len = strlen(msg->cm_fields[emessageId]);
+       len = msg->cm_lengths[emessageId];
        
        if ((len == 0) || (
                    (msg->cm_fields[emessageId][0] == '<') && 
@@ -752,7 +752,7 @@ void imap_fetch_body(long msgnum, ConstStr item, int is_peek) {
         * (Note value of 1 passed as 'dont_decode' so client gets it encoded)
         */
        else {
-               mime_parser(msg->cm_fields[eMesageText], NULL,
+               mime_parser(CM_RANGE(msg, eMesageText),
                            *imap_load_part, NULL, NULL,
                            section,
                            1
@@ -1017,13 +1017,12 @@ void imap_fetch_bodystructure (long msgnum, const char *item,
 
        /* For messages already stored in RFC822 format, we have to parse. */
        IAPuts("BODYSTRUCTURE ");
-       mime_parser(msg->cm_fields[eMesageText],
-                       NULL,
-                       *imap_fetch_bodystructure_part, /* part */
-                       *imap_fetch_bodystructure_pre,  /* pre-multi */
-                       *imap_fetch_bodystructure_post, /* post-multi */
-                       NULL,
-                       1);     /* don't decode -- we want it as-is */
+       mime_parser(CM_RANGE(msg, eMesageText),
+                   *imap_fetch_bodystructure_part,     /* part */
+                   *imap_fetch_bodystructure_pre,      /* pre-multi */
+                   *imap_fetch_bodystructure_post,     /* post-multi */
+                   NULL,
+                   1); /* don't decode -- we want it as-is */
 }