]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/smtp/serv_smtpqueue.c
SMTP-Client: first add backups, then Relays, since we want Relays to be attempted...
[citadel.git] / citadel / modules / smtp / serv_smtpqueue.c
index 2430d0db8a76f24f2a2cca9fe0815d2331358c8d..0fa65bea2000901c0098d814f5fcabbc9f0cb481 100644 (file)
@@ -817,7 +817,7 @@ void smtp_do_procmsg(long msgnum, void *userdata) {
        {
                char mxbuf[SIZ];
                ParsedURL **Url = &MyQItem->URL;
-               nRelays = get_hosts(mxbuf, "smarthost");
+               nRelays = get_hosts(mxbuf, "fallbackhost");
                if (nRelays > 0) {
                        StrBuf *All;
                        StrBuf *One;
@@ -836,16 +836,14 @@ void smtp_do_procmsg(long msgnum, void *userdata) {
                                                     ChrPtr(One));
                                }
                                else {
-                                       ///if (!Url->IsIP)) // todo dupe me fork ipv6
-                                       Url = &(*Url)->Next;
+                                       (*Url)->IsRelay = 1;
+                                       MyQItem->HaveRelay = 1;
                                }
                        }
                        FreeStrBuf(&All);
                        FreeStrBuf(&One);
                }
-
-               Url = &MyQItem->FallBackHost;
-               nRelays = get_hosts(mxbuf, "fallbackhost");
+               nRelays = get_hosts(mxbuf, "smarthost");
                if (nRelays > 0) {
                        StrBuf *All;
                        StrBuf *One;
@@ -863,12 +861,16 @@ void smtp_do_procmsg(long msgnum, void *userdata) {
                                                     "Failed to parse: %s\n",
                                                     ChrPtr(One));
                                }
-                               else
-                                       Url = &(*Url)->Next;
+                               else {
+                                       ///if (!Url->IsIP)) // todo dupe me fork ipv6
+                                       (*Url)->IsRelay = 1;
+                                       MyQItem->HaveRelay = 1;
+                               }
                        }
                        FreeStrBuf(&All);
                        FreeStrBuf(&One);
                }
+
        }
 
        It = GetNewHashPos(MyQItem->MailQEntries, 0);