From d9d90025f08f931a7b85e3393c0f54cd590bbd25 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Thu, 3 Feb 2011 22:34:38 +0100 Subject: [PATCH] libev migration: start out with creating support for 'fallbackhost' --- citadel/modules/smtp/serv_smtpqueue.c | 20 ++++++++++++++++++++ citadel/modules/smtp/smtpqueue.h | 1 + 2 files changed, 21 insertions(+) diff --git a/citadel/modules/smtp/serv_smtpqueue.c b/citadel/modules/smtp/serv_smtpqueue.c index c071daf2b..bdf1a323a 100644 --- a/citadel/modules/smtp/serv_smtpqueue.c +++ b/citadel/modules/smtp/serv_smtpqueue.c @@ -783,6 +783,26 @@ void smtp_do_procmsg(long msgnum, void *userdata) { FreeStrBuf(&All); FreeStrBuf(&One); } + + Url = &MyQItem->FallBackHost; + nRelays = get_hosts(mxbuf, "fallbackhost"); + if (nRelays > 0) { + StrBuf *All; + StrBuf *One; + const char *Pos = NULL; + All = NewStrBufPlain(mxbuf, -1); + One = NewStrBufPlain(NULL, StrLength(All) + 1); + + while ((Pos != StrBufNOTNULL) && ((Pos == NULL) || !IsEmptyStr(Pos))) { + StrBufExtract_NextToken(One, All, &Pos, '|'); + if (!ParseURL(Url, One, 25)) + CtdlLogPrintf(CTDL_DEBUG, "Failed to parse: %s\n", ChrPtr(One)); + else + Url = &(*Url)->Next; + } + FreeStrBuf(&All); + FreeStrBuf(&One); + } } It = GetNewHashPos(MyQItem->MailQEntries, 0); diff --git a/citadel/modules/smtp/smtpqueue.h b/citadel/modules/smtp/smtpqueue.h index 0da689561..b2b7a3bb9 100644 --- a/citadel/modules/smtp/smtpqueue.h +++ b/citadel/modules/smtp/smtpqueue.h @@ -55,6 +55,7 @@ typedef struct queueitem { StrBuf *EnvelopeFrom; StrBuf *BounceTo; ParsedURL *URL; + ParsedURL *FallBackHost; } OneQueItem; typedef void (*QItemHandler)(OneQueItem *Item, StrBuf *Line, const char **Pos); -- 2.30.2