From 38976bbe295bb85305dc4de01c9688f835d35299 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 9 Feb 2026 12:50:45 +0000 Subject: bugfix! --- src/qmail-remote/qmail-remote.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/qmail-remote') diff --git a/src/qmail-remote/qmail-remote.c b/src/qmail-remote/qmail-remote.c index 1f4983b..057f6f1 100644 --- a/src/qmail-remote/qmail-remote.c +++ b/src/qmail-remote/qmail-remote.c @@ -262,6 +262,7 @@ int main (int argc, char const *const *argv) mxip const *mxs ; size_t eaddrpos[argc] ; size_t ntot = 0 ; + unsigned int pass = 1 + (qtls.flagwanttls && qtls.strictness == 1) ; unsigned int mxn = dns_stuff(hostpos ? storage.s + hostpos : host, argv, argc, eaddrpos, &mxipind, &storage, timeoutdns, ipme4.s, ipme4.len >> 2, ipme6.s, ipme6.len >> 4, !hostpos) ; if (!mxn) qmailr_perm("No suitable MX found for remote host") ; stralloc_free(&ipme4) ; @@ -274,8 +275,9 @@ int main (int argc, char const *const *argv) for (unsigned int i = 0 ; i < mxn ; i++) ntot += mxs[i].n4 + mxs[i].n6 ; if (!ntot) qmailr_perm("No suitable IP addresses for the MX") ; - for (; qtls.flagwanttls && qtls.strictness == 1 ; qtls.flagwanttls = 0) + while (pass--) { + if (!pass && qtls.strictness == 1) qtls.flagwanttls = 0 ; for (unsigned int i = 0 ; i < mxn ; i++) { #ifdef SKALIBS_IPV6_ENABLED -- cgit v1.3.1