Mercurial > hg > nginx-mail
comparison src/mail/ngx_mail_handler.c @ 468:2580fe1c5a9a PATCH_NGINX_MAIL_0_6
Mail: support for smtp auth login with username.
According to "[MS-XLOGIN]: SMTP Protocol AUTH LOGIN Extension Specification"
(http://msdn.microsoft.com/en-us/library/cc433484.aspx) there is special mode
called "AUTH LOGIN with User Name". And it seems to be used by some Microsoft
software seen in wild.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sun, 11 Jan 2009 23:19:26 +0300 |
parents | d67e93e97b4a |
children | abbf48179d76 |
comparison
equal
deleted
inserted
replaced
467:d67e93e97b4a | 468:2580fe1c5a9a |
---|---|
354 return NGX_DONE; | 354 return NGX_DONE; |
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 { | 361 { |
361 ngx_str_t *arg; | 362 ngx_str_t *arg; |
362 | 363 |
363 arg = s->args.elts; | 364 arg = s->args.elts; |
365 | |
366 if (initial) { | |
367 /* username in initial response */ | |
368 arg += (s->protocol == NGX_MAIL_SMTP_PROTOCOL) ? 2 : 1; | |
369 } | |
364 | 370 |
365 ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0, | 371 ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0, |
366 "mail auth login username: \"%V\"", &arg[0]); | 372 "mail auth login username: \"%V\"", &arg[0]); |
367 | 373 |
368 s->login.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[0].len)); | 374 s->login.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[0].len)); |