From abeb122d6e447f03be252094e857bf6d5611de19 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 23 Oct 2006 13:10:10 +0000 Subject: APOP --- src/imap/ngx_imap_parse.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/imap/ngx_imap_parse.c') diff --git a/src/imap/ngx_imap_parse.c b/src/imap/ngx_imap_parse.c index eea4550a8..6256cc863 100644 --- 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_imap_session_t *s) { 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_imap_session_t *s) 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: -- cgit v1.2.3