From 78e1a8ed7f33c55e7a24cbf4d0155bea6430dd59 Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Wed, 25 Feb 2015 17:47:49 +0300 Subject: [PATCH] Mail: added Auth-SSL header to indicate SSL. Based on a patch by Filipe da Silva. --- src/mail/ngx_mail_auth_http_module.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/mail/ngx_mail_auth_http_module.c b/src/mail/ngx_mail_auth_http_module.c index f040ec194..fbcc605a7 100644 --- a/src/mail/ngx_mail_auth_http_module.c +++ b/src/mail/ngx_mail_auth_http_module.c @@ -1173,6 +1173,9 @@ ngx_mail_auth_http_create_request(ngx_mail_session_t *s, ngx_pool_t *pool, + sizeof("Auth-SMTP-Helo: ") - 1 + s->smtp_helo.len + sizeof(CRLF) - 1 + sizeof("Auth-SMTP-From: ") - 1 + s->smtp_from.len + sizeof(CRLF) - 1 + sizeof("Auth-SMTP-To: ") - 1 + s->smtp_to.len + sizeof(CRLF) - 1 +#if (NGX_MAIL_SSL) + + sizeof("Auth-SSL: on" CRLF) - 1 +#endif + ahcf->header.len + sizeof(CRLF) - 1; @@ -1255,6 +1258,15 @@ ngx_mail_auth_http_create_request(ngx_mail_session_t *s, ngx_pool_t *pool, } +#if (NGX_MAIL_SSL) + + if (s->connection->ssl) { + b->last = ngx_cpymem(b->last, "Auth-SSL: on" CRLF, + sizeof("Auth-SSL: on" CRLF) - 1); + } + +#endif + if (ahcf->header.len) { b->last = ngx_copy(b->last, ahcf->header.data, ahcf->header.len); }