]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/smtp/serv_smtpeventclient.c
SMTP-Client: decide when to send a bounce or not.
[citadel.git] / citadel / modules / smtp / serv_smtpeventclient.c
index dd86b40f8a33db76264dac7b5da2350a0be854a8..7374107d810ccbfcdc20d5427651d4c1a097ea19 100644 (file)
@@ -106,7 +106,7 @@ void DeleteSmtpOutMsg(void *v)
        FreeURL(&Msg->Relay);
        FreeStrBuf(&Msg->msgtext);
        FreeAsyncIOContents(&Msg->IO);
-///    memset (Msg, 0, sizeof(SmtpOutMsg)); /* just to be shure... */
+       memset (Msg, 0, sizeof(SmtpOutMsg)); /* just to be shure... */
        free(Msg);
 }
 
@@ -139,6 +139,13 @@ void FinalizeMessageSend(SmtpOutMsg *Msg)
 
        nRemain = CountActiveQueueEntries(Msg->MyQItem);
 
+       if (Msg->MyQEntry->Active && 
+           CheckQEntryIsBounce(Msg->MyQEntry))
+       {
+               /* are we casue for a bounce mail? */
+               Msg->MyQItem->SendBounceMail = 1;
+       }
+
        if ((nRemain > 0) || IDestructQueItem)
                MsgData = SerializeQueueItem(Msg->MyQItem);
        else
@@ -163,6 +170,7 @@ void FinalizeMessageSend(SmtpOutMsg *Msg)
                msg->cm_anon_type = MES_NORMAL;
                msg->cm_format_type = FMT_RFC822;
                msg->cm_fields['M'] = SmashStrBuf(&MsgData);
+               msg->cm_fields['U'] = strdup("QMSG");
                Msg->MyQItem->QueMsgID =
                        CtdlSubmitMsg(msg, NULL, SMTP_SPOOLOUT_ROOM, QP_EADDR);
                EVS_syslog(LOG_DEBUG, "SMTPQ: %ld", Msg->MyQItem->QueMsgID);