]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/network/serv_network.c
* add reply-to: header to mails sent to room list recipients
[citadel.git] / citadel / modules / network / serv_network.c
index 9ed349bab54399b19552441ad3dba0db8c985b25..e89f26eec7b78c03e21d0efe98a82a877a0fffd1 100644 (file)
@@ -647,7 +647,19 @@ void network_spool_msg(long msgnum, void *userdata) {
                 */
                msg = CtdlFetchMessage(msgnum, 1);
                if (msg != NULL) {
-
+                       if (msg->cm_fields['V'] == NULL){
+                               /* local message, no enVelope */
+                               StrBuf *Buf;
+                               Buf = NewStrBuf();
+                               StrBufAppendBufPlain(Buf, msg->cm_fields['O'], -1, 0);
+                               StrBufAppendBufPlain(Buf, HKEY("@"), 0);
+                               StrBufAppendBufPlain(Buf, config.c_fqdn, -1, 0);
+                               
+                               msg->cm_fields['K'] = SmashStrBuf(&Buf);
+                       }
+                       else {
+                               msg->cm_fields['K'] = strdup (msg->cm_fields['V']);
+                       }
                        /* Set the 'List-ID' header */
                        if (msg->cm_fields['L'] != NULL) {
                                free(msg->cm_fields['L']);
@@ -2232,6 +2244,7 @@ void *network_do_queue(void *args) {
         * with a static variable instead.
         */
        if (doing_queue) {
+               CtdlClearSystemContext();
                return NULL;
        }
        doing_queue = 1;
@@ -2319,6 +2332,7 @@ void *network_do_queue(void *args) {
        else {
                CtdlLogPrintf(CTDL_DEBUG, "network: Task STOPPED.\n");
        }
+       CtdlClearSystemContext();
        return NULL;
 }