diff src/mail/ngx_mail.h @ 9236:d9a52ebb9b00

Mail: max_commands directive. The directive specifies the maximum number of commands allowed during authentication, after which the connection is closed. The default limit is 1000, which is not expected to affect any well-behaving clients, since authentication usually requires at most several commands, though will effectively stop malicious clients from flooding the server with with commands.
author Maxim Dounin <mdounin@mdounin.ru>
date Sat, 30 Mar 2024 05:05:53 +0300
parents dc955d274130
children 4538c1ffb0f8
line wrap: on
line diff
--- a/src/mail/ngx_mail.h
+++ b/src/mail/ngx_mail.h
@@ -116,6 +116,7 @@ typedef struct {
     ngx_msec_t              resolver_timeout;
 
     ngx_uint_t              max_errors;
+    ngx_uint_t              max_commands;
 
     ngx_str_t               server_name;
 
@@ -234,6 +235,7 @@ typedef struct {
     ngx_array_t             args;
 
     ngx_uint_t              errors;
+    ngx_uint_t              commands;
     ngx_uint_t              login_attempt;
 
     /* used to parse POP3/IMAP/SMTP command */