aboutsummaryrefslogtreecommitdiff
path: root/src/mail/ngx_mail_smtp_handler.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2013-09-30 22:09:50 +0400
committerMaxim Dounin <mdounin@mdounin.ru>2013-09-30 22:09:50 +0400
commit32d6035303426bfd027d00030d0749cc0e85c6fb (patch)
tree16dfadef9a4b8fb36688f02ee587c200c242941f /src/mail/ngx_mail_smtp_handler.c
parentaf897b7f03260f9672c814733671ac433ef36d65 (diff)
downloadnginx-32d6035303426bfd027d00030d0749cc0e85c6fb.tar.gz
nginx-32d6035303426bfd027d00030d0749cc0e85c6fb.zip
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 (limited to 'src/mail/ngx_mail_smtp_handler.c')
-rw-r--r--src/mail/ngx_mail_smtp_handler.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mail/ngx_mail_smtp_handler.c b/src/mail/ngx_mail_smtp_handler.c
index 21714239f..c118f547d 100644
--- 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_event_t *rev)
}
ngx_str_set(&s->out, smtp_invalid_pipelining);
+ s->quit = 1;
}
ngx_mail_send(c->write);