]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/smtp/serv_smtpeventclient.c
Give event clients a citadel session context.
[citadel.git] / citadel / modules / smtp / serv_smtpeventclient.c
index 3276f90f0036581baeabcc499a9ede6469cf3445..a2913bb9b23d57a2024c16f1c970c5572170cf95 100644 (file)
@@ -158,6 +158,8 @@ void FinalizeMessageSend(SmtpOutMsg *Msg)
 
                RemoveQItem(Msg->MyQItem);
        }
+
+       RemoveContext(Msg->IO.CitContext);
        DeleteSmtpOutMsg(Msg);
 }
 
@@ -430,7 +432,6 @@ SmtpOutMsg *new_smtp_outmsg(OneQueItem *MyQItem,
        SendMsg->IO.RecvBuf.Buf   = NewStrBufPlain(NULL, 1024);
        SendMsg->IO.IOBuf         = NewStrBuf();
 
-       SendMsg->IO.sock          = (-1);
        SendMsg->IO.NextState     = eReadMessage;
        
        return SendMsg;
@@ -451,6 +452,11 @@ void smtp_try_one_queue_entry(OneQueItem *MyQItem,
        else             SendMsg->msgtext = NewStrBufDup(MsgText);
        
        if (smtp_resolve_recipients(SendMsg)) {
+               CitContext *SubC;
+               SubC = CloneContext (CC);
+               SubC->session_specific_data = (char*) SendMsg;
+               SendMsg->IO.CitContext = SubC;
+
                if (SendMsg->pCurrRelay == NULL)
                        QueueEventContext(&SendMsg->IO,
                                          resolve_mx_records);