diff src/mail/ngx_mail_smtp_handler.c @ 435:e2df123bbbe2

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").
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 10 Sep 2008 23:05:54 +0400
parents cd9cb7a3ff9e
children 9b19e26b2660
line wrap: on
line diff
--- 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);