From c2e22bcf325ee0031d1c86fbdfb79a2f8e1b4a7b Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Fri, 5 Mar 2021 17:16:29 +0300 Subject: Mail: realip module. When configured with the "set_real_ip_from", it can set client's IP address as visible in logs to the one obtained via the PROXY protocol. --- src/mail/ngx_mail_handler.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mail/ngx_mail_handler.c') diff --git a/src/mail/ngx_mail_handler.c b/src/mail/ngx_mail_handler.c index 50a44c782..b9010535b 100644 --- a/src/mail/ngx_mail_handler.c +++ b/src/mail/ngx_mail_handler.c @@ -260,6 +260,11 @@ ngx_mail_proxy_protocol_handler(ngx_event_t *rev) return; } + if (ngx_mail_realip_handler(s) != NGX_OK) { + ngx_mail_close_connection(c); + return; + } + ngx_mail_init_session_handler(rev); } -- cgit