From 0d032264344e1ecb0e99e2eefe6301c6f6c550b8 Mon Sep 17 00:00:00 2001 From: zeroleo12345 Date: Sat, 24 May 2025 09:51:04 +0800 Subject: [PATCH] MAIL: MTA to MTA check startTLS only --- src/mail/ngx_mail_smtp_handler.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mail/ngx_mail_smtp_handler.c b/src/mail/ngx_mail_smtp_handler.c index e68ceedfd..80ca8c050 100644 --- a/src/mail/ngx_mail_smtp_handler.c +++ b/src/mail/ngx_mail_smtp_handler.c @@ -742,6 +742,12 @@ ngx_mail_smtp_mail(ngx_mail_session_t *s, ngx_connection_t *c) ngx_str_t *arg, cmd; ngx_mail_smtp_srv_conf_t *sscf; +#if (NGX_MAIL_SSL) + if (ngx_mail_starttls_only(s, c)) { + return NGX_MAIL_PARSE_INVALID_COMMAND; + } +#endif + sscf = ngx_mail_get_module_srv_conf(s, ngx_mail_smtp_module); if (!(sscf->auth_methods & NGX_MAIL_AUTH_NONE_ENABLED)) {