* add reply-to: header to mails sent to room list recipients
[citadel.git] / citadel / modules / network / serv_network.c
index b3d3d4617300430a06a41abc62813c794fa1885a..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']);