aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmail-remote/qmail-remote.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2026-02-10 07:51:49 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2026-02-10 07:51:49 +0000
commit27a9b53363ff44df5b9b5acd17e64c77ec6ede53 (patch)
treeb94a71a5942d7a43874b98c5f577efe533cf15d0 /src/qmail-remote/qmail-remote.c
parent34b8a10af3b6999e8dfbb1ee267bd58c09b27bfd (diff)
downloadsmtpd-starttls-proxy-27a9b53363ff44df5b9b5acd17e64c77ec6ede53.tar.gz
Keep the MX name and use it as SNI servername
Diffstat (limited to 'src/qmail-remote/qmail-remote.c')
-rw-r--r--src/qmail-remote/qmail-remote.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qmail-remote/qmail-remote.c b/src/qmail-remote/qmail-remote.c
index 9c9bc15..d5bf0ea 100644
--- a/src/qmail-remote/qmail-remote.c
+++ b/src/qmail-remote/qmail-remote.c
@@ -92,7 +92,7 @@ static int smtp_start (buffer *in, buffer *out, char const *helohost, unsigned i
return hastls ;
}
-static void attempt_smtp (int fd, char const *ip, int is6, unsigned int timeoutconnect, unsigned int timeoutremote, qmailr_tls const *qtls, size_t helopos, size_t const *eaddrpos, unsigned int n, char const *storage)
+static void attempt_smtp (int fd, char const *ip, int is6, unsigned int timeoutconnect, unsigned int timeoutremote, qmailr_tls const *qtls, size_t helopos, size_t const *eaddrpos, unsigned int n, size_t mxnamepos, char const *storage)
{
int hastls ;
char inbuf[2048] ;
@@ -121,7 +121,7 @@ static void attempt_smtp (int fd, char const *ip, int is6, unsigned int timeoutc
qmailr_smtp_quit(&out, timeoutremote) ;
qmailr_temp("Connected to ", fmtip, " but connection died") ;
}
- else if (r == 220) run_tls(fd, fmtip, timeoutconnect, timeoutremote, qtls, helopos, eaddrpos, n, storage) ;
+ else if (r == 220) run_tls(fd, fmtip, timeoutconnect, timeoutremote, qtls, helopos, eaddrpos, n, mxnamepos, storage) ;
if (qtls->strictness) return ;
}
else if (qtls->strictness >= 2) return ;
@@ -239,7 +239,7 @@ int main (int argc, char const *const *argv)
}
if (!qmailr_tcpto_update(ip, 1, 0))
qmailr_tempusys("update ", "tcpto6") ;
- attempt_smtp(fd, ip, 1, timeoutconnect, timeoutremote, &qtls, helopos, eaddrpos, argc, storage.s) ;
+ attempt_smtp(fd, ip, 1, timeoutconnect, timeoutremote, &qtls, helopos, eaddrpos, argc, mxs[i].namepos, storage.s) ;
fd_close(fd) ;
}
#endif
@@ -265,7 +265,7 @@ int main (int argc, char const *const *argv)
}
if (!qmailr_tcpto_update(ip, 0, 0))
qmailr_tempusys("update ", "tcpto") ;
- attempt_smtp(fd, ip, 0, timeoutconnect, timeoutremote, &qtls, helopos, eaddrpos, argc, storage.s) ;
+ attempt_smtp(fd, ip, 0, timeoutconnect, timeoutremote, &qtls, helopos, eaddrpos, argc, mxs[i].namepos, storage.s) ;
fd_close(fd) ;
}
}