diff src/imap/ngx_imap_parse.c @ 800:887d8dec72dc

APOP
author Igor Sysoev <igor@sysoev.ru>
date Mon, 23 Oct 2006 13:10:10 +0000
parents 4e296b7d25bf
children da9c1521319d
line wrap: on
line diff
--- a/src/imap/ngx_imap_parse.c
+++ b/src/imap/ngx_imap_parse.c
@@ -429,6 +429,10 @@ ngx_int_t ngx_pop3_parse_command(ngx_ima
                     {
                         s->command = NGX_POP3_PASS;
 
+                    } else if (c0 == 'A' && c1 == 'P' && c2 == 'O' && c3 == 'P')
+                    {
+                        s->command = NGX_POP3_APOP;
+
                     } else if (c0 == 'Q' && c1 == 'U' && c2 == 'I' && c3 == 'T')
                     {
                         s->command = NGX_POP3_QUIT;
@@ -496,12 +500,20 @@ ngx_int_t ngx_pop3_parse_command(ngx_ima
         case sw_argument:
             switch (ch) {
 
-         /*
-          * the space should be considered part of the at username
-          * or password, but not of argument in other commands
-          *
-          * case ' ':
-          */
+            case ' ':
+
+                /*
+                 * the space should be considered as part of the at username
+                 * or password, but not of argument in other commands
+                 */
+
+                if (s->command == NGX_POP3_USER
+                    || s->command == NGX_POP3_PASS)
+                {
+                    break;
+                }
+
+                /* fall through */
 
             case CR:
             case LF: