SMTP-Client: add the stati of all delivery attempts to the status messages.
[citadel.git] / citadel / modules / smtp / serv_smtpeventclient.c
index 34363eb6f64545a95ae8e88da333a3820a868180..c744bb6e4cb81fd3bf2d99a60834d6c21c04f435 100644 (file)
@@ -264,6 +264,14 @@ eNextState FailOneAttempt(AsyncIO *IO)
         */
        StopClientWatchers(IO, 1);
 
+       Msg->MyQEntry->nAttempt ++;
+       if (Msg->MyQEntry->AllStatusMessages == NULL)
+               Msg->MyQEntry->AllStatusMessages = NewStrBuf();
+
+       StrBufAppendPrintf(Msg->MyQEntry->AllStatusMessages, "%ld) ", Msg->MyQEntry->nAttempt);
+       StrBufAppendBuf(Msg->MyQEntry->AllStatusMessages, Msg->MyQEntry->StatusMessage, 0);
+       StrBufAppendBufPlain(Msg->MyQEntry->AllStatusMessages, HKEY("; "), 0);
+
        if (Msg->pCurrRelay != NULL)
                Msg->pCurrRelay = Msg->pCurrRelay->Next;
        if ((Msg->pCurrRelay != NULL) &&