Mercurial > hg > nginx-mail
comparison src/mail/ngx_mail_handler.c @ 481:abbf48179d76
Mail: minor changes to auth login with username support.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 09 Feb 2009 00:53:34 +0300 |
parents | 2580fe1c5a9a |
children | c78a94ba4ae1 |
comparison
equal
deleted
inserted
replaced
480:a28a95b7a86d | 481:abbf48179d76 |
---|---|
355 } | 355 } |
356 | 356 |
357 | 357 |
358 ngx_int_t | 358 ngx_int_t |
359 ngx_mail_auth_login_username(ngx_mail_session_t *s, ngx_connection_t *c, | 359 ngx_mail_auth_login_username(ngx_mail_session_t *s, ngx_connection_t *c, |
360 ngx_int_t initial) | 360 ngx_uint_t n) |
361 { | 361 { |
362 ngx_str_t *arg; | 362 ngx_str_t *arg; |
363 | 363 |
364 arg = s->args.elts; | 364 arg = s->args.elts; |
365 | 365 arg += n; |
366 if (initial) { | |
367 /* username in initial response */ | |
368 arg += (s->protocol == NGX_MAIL_SMTP_PROTOCOL) ? 2 : 1; | |
369 } | |
370 | 366 |
371 ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0, | 367 ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0, |
372 "mail auth login username: \"%V\"", &arg[0]); | 368 "mail auth login username: \"%V\"", &arg[0]); |
373 | 369 |
374 s->login.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[0].len)); | 370 s->login.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[0].len)); |