libev migration: start out with creating support for 'fallbackhost'
[citadel.git] / citadel / modules / smtp / serv_smtpqueue.c
index c071daf2b8f7cdf44ac91d46d525eb42f8c44950..bdf1a323a29390f69d9c24dd13faf7eb43967b06 100644 (file)
@@ -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);