use an Enum for the cm_fields vector instead of nameless chars
[citadel.git] / citadel / modules / smtp / serv_smtpeventclient.c
index b3ec5da0e5ff8bed1a35197d855e7fdc44b8a1ad..5eddfc1b67a1d3cfb39ff378a582584e36e2eb37 100644 (file)
@@ -108,7 +108,8 @@ ConstStr SMTPStates[] = {
 void SetSMTPState(AsyncIO *IO, smtpstate State)
 {
        CitContext* CCC = IO->CitContext;
-       memcpy(CCC->cs_clientname, SMTPStates[State].Key, SMTPStates[State].len + 1);
+       if (CCC != NULL)
+               memcpy(CCC->cs_clientname, SMTPStates[State].Key, SMTPStates[State].len + 1);
 }
 
 int SMTPClientDebugEnabled = 0;
@@ -211,7 +212,7 @@ eNextState FinalizeMessageSend_DB(AsyncIO *IO)
        Msg->MyQItem->QueMsgID = -1;
 
        if (Msg->IDestructQueItem)
-               smtpq_do_bounce(Msg->MyQItem, StatusMessage, Msg->msgtext, Msg->pCurrRelay);
+               smtpq_do_bounce(Msg->MyQItem, Msg->msgtext, Msg->pCurrRelay);
 
        if (Msg->nRemain > 0)
        {
@@ -221,8 +222,8 @@ eNextState FinalizeMessageSend_DB(AsyncIO *IO)
                msg->cm_magic = CTDLMESSAGE_MAGIC;
                msg->cm_anon_type = MES_NORMAL;
                msg->cm_format_type = FMT_RFC822;
-               msg->cm_fields['M'] = SmashStrBuf(&Msg->QMsgData);
-               msg->cm_fields['U'] = strdup("QMSG");
+               msg->cm_fields[eMesageText] = SmashStrBuf(&Msg->QMsgData);
+               msg->cm_fields[eMsgSubject] = strdup("QMSG");
                Msg->MyQItem->QueMsgID =
                        CtdlSubmitMsg(msg, NULL, SMTP_SPOOLOUT_ROOM, QP_EADDR);
                EVS_syslog(LOG_DEBUG, "%ld", Msg->MyQItem->QueMsgID);
@@ -253,7 +254,7 @@ eNextState Terminate(AsyncIO *IO)
 eNextState FinalizeMessageSend(SmtpOutMsg *Msg)
 {
        /* hand over to DB Queue */
-       return QueueDBOperation(&Msg->IO, FinalizeMessageSend_DB);
+       return EventQueueDBOperation(&Msg->IO, FinalizeMessageSend_DB);
 }
 
 eNextState FailOneAttempt(AsyncIO *IO)