]> code.citadel.org Git - citadel.git/blobdiff - citadel/msgbase.c
* Coded up the "bounce" functions. Still a coupla bugs.
[citadel.git] / citadel / msgbase.c
index 132b09e57dbef0090e6fa812328ad6277646f6d9..9dde1f53549da3d3844011ac017237296eec50a6 100644 (file)
@@ -674,10 +674,13 @@ void CtdlFreeMessage(struct CtdlMessage *msg)
        if (is_valid_message(msg) == 0) return;
 
        for (i = 0; i < 256; ++i)
-               if (msg->cm_fields[i] != NULL)
+               if (msg->cm_fields[i] != NULL) {
+                       lprintf(9, "phreeing %c\n", i);
                        phree(msg->cm_fields[i]);
+               }
 
        msg->cm_magic = 0;      /* just in case */
+       lprintf(9, "phreeing msg\n");
        phree(msg);
 }
 
@@ -1002,6 +1005,9 @@ int CtdlOutputMsg(long msg_num,           /* message number (local) to fetch */
        if (mode == MT_CITADEL)
                if (do_proto) cprintf("text\n");
        if (mode == MT_RFC822) {
+               if (TheMessage->cm_fields['U'] == NULL) {
+                       cprintf("Subject: (no subject)%s", nl);
+               }
                cprintf("%s", nl);
        }
 
@@ -1672,8 +1678,11 @@ long CtdlSaveMsg(struct CtdlMessage *msg,        /* message to save */
                instr = mallok(2048);
                sprintf(instr,
                        "Content-type: %s\n\nmsgid|%ld\nsubmitted|%ld\n"
+                       "bounceto|%s@%s\n"
                        "remote|%s|0||\n",
-                       SPOOLMIME, newmsgid, time(NULL), recipient );
+                       SPOOLMIME, newmsgid, time(NULL),
+                       msg->cm_fields['A'], msg->cm_fields['N'],
+                       recipient );
 
                imsg = mallok(sizeof(struct CtdlMessage));
                memset(imsg, 0, sizeof(struct CtdlMessage));