diff options
author | Igor Sysoev <igor@sysoev.ru> | 2007-09-15 16:51:16 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2007-09-15 16:51:16 +0000 |
commit | 48714085dde4fe4c5b695dad23295e3f96fe1d2e (patch) | |
tree | 37b0109215ca08bb1103f03dd43f435392ebe36a /src/mail/ngx_mail_imap_handler.c | |
parent | 05a75d0d9496d874fc22d7e8b3c44b7914a61509 (diff) | |
download | nginx-48714085dde4fe4c5b695dad23295e3f96fe1d2e.tar.gz nginx-48714085dde4fe4c5b695dad23295e3f96fe1d2e.zip |
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Diffstat (limited to 'src/mail/ngx_mail_imap_handler.c')
-rw-r--r-- | src/mail/ngx_mail_imap_handler.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/mail/ngx_mail_imap_handler.c b/src/mail/ngx_mail_imap_handler.c index 4c55157ea..949e96e2e 100644 --- a/src/mail/ngx_mail_imap_handler.c +++ b/src/mail/ngx_mail_imap_handler.c @@ -8,6 +8,7 @@ #include <ngx_core.h> #include <ngx_event.h> #include <ngx_mail.h> +#include <ngx_mail_imap_module.h> static ngx_int_t ngx_mail_imap_login(ngx_mail_session_t *s, @@ -58,7 +59,7 @@ ngx_mail_imap_init_protocol(ngx_event_t *rev) { ngx_connection_t *c; ngx_mail_session_t *s; - ngx_mail_core_srv_conf_t *cscf; + ngx_mail_imap_srv_conf_t *iscf; c = rev->data; @@ -81,9 +82,9 @@ ngx_mail_imap_init_protocol(ngx_event_t *rev) return; } - cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); + iscf = ngx_mail_get_module_srv_conf(s, ngx_mail_imap_module); - s->buffer = ngx_create_temp_buf(c->pool, cscf->imap_client_buffer_size); + s->buffer = ngx_create_temp_buf(c->pool, iscf->client_buffer_size); if (s->buffer == NULL) { ngx_mail_session_internal_server_error(s); return; @@ -349,6 +350,7 @@ ngx_mail_imap_authenticate(ngx_mail_session_t *s, ngx_connection_t *c) { ngx_int_t rc; ngx_mail_core_srv_conf_t *cscf; + ngx_mail_imap_srv_conf_t *iscf; #if (NGX_MAIL_SSL) if (ngx_mail_starttls_only(s, c)) { @@ -378,13 +380,15 @@ ngx_mail_imap_authenticate(ngx_mail_session_t *s, ngx_connection_t *c) case NGX_MAIL_AUTH_CRAM_MD5: - cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); + iscf = ngx_mail_get_module_srv_conf(s, ngx_mail_imap_module); - if (!(cscf->imap_auth_methods & NGX_MAIL_AUTH_CRAM_MD5_ENABLED)) { + if (!(iscf->auth_methods & NGX_MAIL_AUTH_CRAM_MD5_ENABLED)) { return NGX_MAIL_PARSE_INVALID_COMMAND; } if (s->salt.data == NULL) { + cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); + if (ngx_mail_salt(s, c, cscf) != NGX_OK) { return NGX_ERROR; } @@ -405,12 +409,12 @@ ngx_mail_imap_authenticate(ngx_mail_session_t *s, ngx_connection_t *c) static ngx_int_t ngx_mail_imap_capability(ngx_mail_session_t *s, ngx_connection_t *c) { - ngx_mail_core_srv_conf_t *cscf; + ngx_mail_imap_srv_conf_t *iscf; #if (NGX_MAIL_SSL) ngx_mail_ssl_conf_t *sslcf; #endif - cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); + iscf = ngx_mail_get_module_srv_conf(s, ngx_mail_imap_module); #if (NGX_MAIL_SSL) @@ -418,18 +422,18 @@ ngx_mail_imap_capability(ngx_mail_session_t *s, ngx_connection_t *c) sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module); if (sslcf->starttls == NGX_MAIL_STARTTLS_ON) { - s->text = cscf->imap_starttls_capability; + s->text = iscf->starttls_capability; return NGX_OK; } if (sslcf->starttls == NGX_MAIL_STARTTLS_ONLY) { - s->text = cscf->imap_starttls_only_capability; + s->text = iscf->starttls_only_capability; return NGX_OK; } } #endif - s->text = cscf->imap_capability; + s->text = iscf->capability; return NGX_OK; } |