From 6867509f5e1d42791120a315cb0dd9d953e2ff8c Mon Sep 17 00:00:00 2001 From: mdecimus Date: Thu, 6 Jun 2024 09:22:39 +0200 Subject: [PATCH] Do not announce STARTTLS if the listener does not support it --- crates/smtp/src/inbound/ehlo.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/smtp/src/inbound/ehlo.rs b/crates/smtp/src/inbound/ehlo.rs index c049502c..acae9911 100644 --- a/crates/smtp/src/inbound/ehlo.rs +++ b/crates/smtp/src/inbound/ehlo.rs @@ -123,7 +123,7 @@ impl Session { let mut response = EhloResponse::new(self.hostname.as_str()); response.capabilities = EXT_ENHANCED_STATUS_CODES | EXT_8BIT_MIME | EXT_BINARY_MIME | EXT_SMTP_UTF8; - if !self.stream.is_tls() { + if !self.stream.is_tls() && self.instance.acceptor.is_tls() { response.capabilities |= EXT_START_TLS; } let ec = &self.core.core.smtp.session.extensions;