# HG changeset patch # User Maxim Dounin # Date 1221073554 -14400 # Node ID e2df123bbbe2d30c7577d4a01abdb0157dd4d950 # Parent 375518f786dbda2710c371fc6d1618a079f0d0b0 Mail: close session on smtp_greeting_delay violation. Server MUST send greeting before other replies, while before this change it sends 503 replies to commands received before greeting, then sends 220 greeting, and then accepts more commands. This patch is quick-fix and doesn't really rfc-complaint, since closing connection isn't allowed by RFC. The rfc-complaint options are: 1. Send 220 greeting and then process commands as valid. Probably make sense if information about violation will be available to spam filtering engine later. 2. Send 554 greeting and wait for the client to send a QUIT (see RFC 2821, section "3.1 Session Initiation"). 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 @@ -298,6 +298,7 @@ ngx_mail_smtp_invalid_pipelining(ngx_eve s->out.len = sizeof(smtp_invalid_pipelining) - 1; s->out.data = smtp_invalid_pipelining; + s->quit = 1; } ngx_mail_send(c->write);