]> code.citadel.org Git - citadel.git/blobdiff - citadel/journaling.c
* Moved the "Content-Identifer" (sic) header out of the envelope journal
[citadel.git] / citadel / journaling.c
index b1af2b9c6d63101052c03d3f95170e4395726c26..5cba32940eeecf6719815b9065d01093499e3925 100644 (file)
@@ -128,8 +128,15 @@ void JournalRunQueueMsg(struct jnlq *jmsg) {
                        sprintf(mime_boundary, "--Citadel-Journal-%08lx-%04x--", time(NULL), ++seq);
                        message_text = malloc(strlen(jmsg->rfc822) + sizeof(struct recptypes) + 1024);
 
+                       /*
+                        * Here is where we begin to compose the journalized message.
+                        * NOTE: the superfluous "Content-Identifer: ExJournalReport" header was
+                        *       requested by a paying customer, and yes, it is intentionally
+                        *       spelled wrong.  Do NOT remove or change it.
+                        */
                        sprintf(message_text,
                                "Content-type: multipart/mixed; boundary=\"%s\"\r\n"
+                               "Content-Identifer: ExJournalReport\r\n"
                                "MIME-Version: 1.0\r\n"
                                "\n"
                                "--%s\r\n"
@@ -159,27 +166,27 @@ void JournalRunQueueMsg(struct jnlq *jmsg) {
                                jmsg->msgn
                        );
 
-                       if (journal_recps->num_local > 0) {
-                               for (i=0; i<journal_recps->num_local; ++i) {
-                                       extract_token(recipient, journal_recps->recp_local,
+                       if (jmsg->recps.num_local > 0) {
+                               for (i=0; i<jmsg->recps.num_local; ++i) {
+                                       extract_token(recipient, jmsg->recps.recp_local,
                                                        i, '|', sizeof recipient);
                                        sprintf(&message_text[strlen(message_text)],
                                                "       %s\r\n", recipient);
                                }
                        }
 
-                       if (journal_recps->num_ignet > 0) {
-                               for (i=0; i<journal_recps->num_ignet; ++i) {
-                                       extract_token(recipient, journal_recps->recp_ignet,
+                       if (jmsg->recps.num_ignet > 0) {
+                               for (i=0; i<jmsg->recps.num_ignet; ++i) {
+                                       extract_token(recipient, jmsg->recps.recp_ignet,
                                                        i, '|', sizeof recipient);
                                        sprintf(&message_text[strlen(message_text)],
                                                "       %s\r\n", recipient);
                                }
                        }
 
-                       if (journal_recps->num_internet > 0) {
-                               for (i=0; i<journal_recps->num_internet; ++i) {
-                                       extract_token(recipient, journal_recps->recp_internet,
+                       if (jmsg->recps.num_internet > 0) {
+                               for (i=0; i<jmsg->recps.num_internet; ++i) {
+                                       extract_token(recipient, jmsg->recps.recp_internet,
                                                        i, '|', sizeof recipient);
                                        sprintf(&message_text[strlen(message_text)],
                                                "       %s\r\n", recipient);
@@ -220,7 +227,7 @@ void JournalRunQueueMsg(struct jnlq *jmsg) {
  * Run the queue.
  */
 void JournalRunQueue(void) {
-       struct jnlq *jptr;
+       struct jnlq *jptr = NULL;
 
        while (jnlq != NULL) {
                begin_critical_section(S_JOURNAL_QUEUE);