Added message-id to the list of fields CtdlOutputMsg() can potentially return to...
[citadel.git] / citadel / modules / imap / imap_fetch.c
index f9998937183a50652b1030986ec98440947497f7..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 */
@@ -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 */
 }