*/
#include "webcit.h"
+CtxType CTX_MAILQITEM = CTX_NONE;
+CtxType CTX_MAILQ_RCPT = CTX_NONE;
HashList *QItemHandlers = NULL;
void QItem_Handle_Recipient(OneQueItem *Item, StrBuf *Line, const char **Pos)
{
+ const char *pch;
if (Item->Current == NULL)
NewMailQEntry(Item);
if (Item->Current->Recipient == NULL)
StrBufExtract_NextToken(Item->Current->Recipient, Line, Pos, '|');
Item->Current->Status = StrBufExtractNext_int(Line, Pos, '|');
StrBufExtract_NextToken(Item->Current->StatusMessage, Line, Pos, '|');
+
+ pch = ChrPtr(Item->Current->StatusMessage);
+ while ((pch != NULL) && (*pch != '\0')) {
+ pch = strchr(pch, ';');
+ if (pch != NULL) {
+ pch ++;
+ if (*pch == ' ') {
+ StrBufPeek(Item->Current->StatusMessage,
+ pch, -1, '\n');
+ }
+ }
+ }
Item->Current = NULL; // TODO: is this always right?
}
InitModule_SMTP_QUEUE
(void)
{
+ RegisterCTX(CTX_MAILQITEM);
+ RegisterCTX(CTX_MAILQ_RCPT);
RegisterQItemHandler(HKEY("msgid"), QItem_Handle_MsgID);
RegisterQItemHandler(HKEY("envelope_from"), QItem_Handle_EnvelopeFrom);