[nginx] Mail: added session close on smtp_greeting_delay violation.

Maxim Dounin mdounin at mdounin.ru
Mon Sep 30 18:10:55 UTC 2013


details:   http://hg.nginx.org/nginx/rev/42f874c0b970
branches:  
changeset: 5396:42f874c0b970
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Mon Sep 30 22:09:50 2013 +0400
description:
Mail: added session close on smtp_greeting_delay violation.

A server MUST send greeting before other replies, while before this
change in case of smtp_greeting_delay violation the 220 greeting was
sent after several 503 replies to commands received before greeting,
resulting in protocol synchronization loss.  Moreover, further commands
were accepted after the greeting.

While closing a connection isn't strictly RFC compliant (RFC 5321
requires servers to wait for a QUIT before closing a connection), it's
probably good enough for practial uses.

diffstat:

 src/mail/ngx_mail_smtp_handler.c |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff --git a/src/mail/ngx_mail_smtp_handler.c b/src/mail/ngx_mail_smtp_handler.c
--- a/src/mail/ngx_mail_smtp_handler.c
+++ b/src/mail/ngx_mail_smtp_handler.c
@@ -321,6 +321,7 @@ ngx_mail_smtp_invalid_pipelining(ngx_eve
         }
 
         ngx_str_set(&s->out, smtp_invalid_pipelining);
+        s->quit = 1;
     }
 
     ngx_mail_send(c->write);



More information about the nginx-devel mailing list