aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmail-remote/qmailr_smtp.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2026-02-25 19:26:02 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2026-02-25 19:26:02 +0000
commit50b0d5ce3ad04e2d49b7ea7ff8046a64991b1bf4 (patch)
treebf21f69ce676e90fda5efaafbde51371a8a7c994 /src/qmail-remote/qmailr_smtp.c
parenta6d307976be9de94f3c05ff879a558f1fa347c6c (diff)
downloadsmtpd-starttls-proxy-50b0d5ce3ad04e2d49b7ea7ff8046a64991b1bf4.tar.gz
don't wait for a banner after STARTTLS
Diffstat (limited to 'src/qmail-remote/qmailr_smtp.c')
-rw-r--r--src/qmail-remote/qmailr_smtp.c24
1 files changed, 15 insertions, 9 deletions
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) ;
+}