]> code.citadel.org Git - citadel.git/blobdiff - citadel/journaling.c
fix warnings - remove variables no longer needed
[citadel.git] / citadel / journaling.c
index eb9e378e7f76872b95d7291d946598bcf2bb8ad2..0d2e74f4182d2218a042b7a9ea9167de77abbf06 100644 (file)
@@ -1,5 +1,15 @@
 /*
  * Message journaling functions.
+ *
+ * Copyright (c) 1987-2015 by the citadel.org team
+ *
+ * This program is open source software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  */
 
 #include <stdio.h>
@@ -8,6 +18,7 @@
 #include "ctdl_module.h"
 
 #include "citserver.h"
+#include "config.h"
 #include "user_ops.h"
 #include "serv_vcard.h"                        /* Needed for vcard_getuser and extract_inet_email_addrs */
 #include "internet_addressing.h"
@@ -100,7 +111,7 @@ void JournalRunQueueMsg(struct jnlq *jmsg) {
 
        if (jmsg == NULL)
                return;
-       journal_recps = validate_recipients(config.c_journal_dest, NULL, 0);
+       journal_recps = validate_recipients(CtdlGetConfigStr("c_journal_dest"), NULL, 0);
        if (journal_recps != NULL) {
 
                if (  (journal_recps->num_local > 0)
@@ -119,15 +130,33 @@ void JournalRunQueueMsg(struct jnlq *jmsg) {
                        journal_msg->cm_anon_type = MES_NORMAL;
                        journal_msg->cm_format_type = FMT_RFC822;
                        CM_SetField(journal_msg, eJournal, HKEY("is journal"));
-                       CM_SetField(journal_msg, eAuthor, jmsg->from, strlen(jmsg->from));
-                       CM_SetField(journal_msg, eNodeName, jmsg->node, strlen(jmsg->node));
-                       CM_SetField(journal_msg, erFc822Addr, jmsg->rfca, strlen(jmsg->rfca));
-                       CM_SetField(journal_msg, eMsgSubject, jmsg->subj, strlen(jmsg->subj));
+
+                       if (!IsEmptyStr(jmsg->from)) {
+                               CM_SetField(journal_msg, eAuthor, jmsg->from, strlen(jmsg->from));
+                       }
+
+                       if (!IsEmptyStr(jmsg->node)) {
+                               CM_SetField(journal_msg, eNodeName, jmsg->node, strlen(jmsg->node));
+                       }
+
+                       if (!IsEmptyStr(jmsg->rfca)) {
+                               CM_SetField(journal_msg, erFc822Addr, jmsg->rfca, strlen(jmsg->rfca));
+                       }
+
+                       if (!IsEmptyStr(jmsg->subj)) {
+                               CM_SetField(journal_msg, eMsgSubject, jmsg->subj, strlen(jmsg->subj));
+                       }
 
                        mblen = snprintf(mime_boundary, sizeof(mime_boundary),
                                         "--Citadel-Journal-%08lx-%04x--", time(NULL), ++seq);
-                       rfc822len = strlen(jmsg->rfc822);
-                      
+
+                       if (!IsEmptyStr(jmsg->rfc822)) {
+                               rfc822len = strlen(jmsg->rfc822);
+                       }
+                       else {
+                               rfc822len = 0;
+                       }
+
                        message_text = NewStrBufPlain(NULL, rfc822len + sizeof(recptypes) + 1024);
 
                        /*