From 50b0d5ce3ad04e2d49b7ea7ff8046a64991b1bf4 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 25 Feb 2026 19:26:02 +0000 Subject: don't wait for a banner after STARTTLS --- src/qmail-remote/qmailr_smtp.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/qmail-remote/qmailr_smtp.c') diff --git a/src/qmail-remote/qmailr_smtp.c b/src/qmail-remote/qmailr_smtp.c index 1d5d426..a36942f 100644 --- a/src/qmail-remote/qmailr_smtp.c +++ b/src/qmail-remote/qmailr_smtp.c @@ -52,19 +52,11 @@ void qmailr_smtp_quit (buffer *out, unsigned int timeout) buffer_timed_flush_g(out, &deadline) ; } -int qmailr_smtp_start (buffer *in, buffer *out, char const *helohost, unsigned int timeout) +int qmailr_smtp_ehlo (buffer *in, buffer *out, char const *helohost, unsigned int timeout) { int hastls = 0 ; tain deadline ; char line[1024] ; - int r = qmailr_smtp_read_answer(in, line, 1024, timeout) ; - if (r == -1) return -1 ; - if (!r) return (errno = EPIPE, -1) ; - if (r != 220) - { - qmailr_smtp_quit(out, timeout) ; - return (errno = EPROTO, -1) ; - } buffer_putnoflush(out, "EHLO ", 5) ; buffer_putsnoflush(out, helohost) ; @@ -86,3 +78,17 @@ int qmailr_smtp_start (buffer *in, buffer *out, char const *helohost, unsigned i } return hastls ; } + +int qmailr_smtp_start (buffer *in, buffer *out, char const *helohost, unsigned int timeout) +{ + char line[1024] ; + int r = qmailr_smtp_read_answer(in, line, 1024, timeout) ; + if (r == -1) return -1 ; + if (!r) return (errno = EPIPE, -1) ; + if (r != 220) + { + qmailr_smtp_quit(out, timeout) ; + return (errno = EPROTO, -1) ; + } + return qmailr_smtp_ehlo(in, out, helohost, timeout) ; +} -- cgit v1.3.1