+ {
+ char mxbuf[SIZ];
+ ParsedURL **Url = &MyQItem->URL;
+ nRelays = get_hosts(mxbuf, "smarthost");
+ 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)) {
+ SMTPC_syslog(LOG_DEBUG,
+ "Failed to parse: %s\n",
+ ChrPtr(One));
+ }
+ else {
+ ///if (!Url->IsIP)) // todo dupe me fork ipv6
+ Url = &(*Url)->Next;
+ }
+ }
+ 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)) {
+ SMTPC_syslog(LOG_DEBUG,
+ "Failed to parse: %s\n",
+ ChrPtr(One));
+ }
+ else
+ Url = &(*Url)->Next;
+ }
+ FreeStrBuf(&All);
+ FreeStrBuf(&One);
+ }
+ }
+