Mercurial > hg > nginx-ranges
diff src/imap/ngx_imap_core_module.c @ 250:fbf2b2f66c9f NGINX_0_4_10
nginx 0.4.10
*) Feature: the POP3 proxy supports the APOP command.
*) Bugfix: if the select, poll or /dev/poll methods were used, then
while waiting authentication server response the IMAP/POP3 proxy
hogged CPU.
*) Bugfix: a segmentation fault might occur if the $server_addr
variable was used in the "map" directive.
*) Bugfix: the ngx_http_flv_module did not support the byte ranges for
full responses; bug appeared in 0.4.7.
*) Bugfix: nginx could not be built on Debian amd64; bug appeared in
0.4.9.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 23 Oct 2006 00:00:00 +0400 |
parents | 56688ed172c8 |
children | 644510700914 |
line wrap: on
line diff
--- a/src/imap/ngx_imap_core_module.c +++ b/src/imap/ngx_imap_core_module.c @@ -45,6 +45,13 @@ static ngx_str_t ngx_imap_default_capab }; +static ngx_conf_bitmask_t ngx_imap_auth_methods[] = { + { ngx_string("plain"), NGX_IMAP_AUTH_PLAIN_ENABLED }, + { ngx_string("apop"), NGX_IMAP_AUTH_APOP_ENABLED }, + { ngx_null_string, 0 } +}; + + static ngx_command_t ngx_imap_core_commands[] = { { ngx_string("server"), @@ -103,6 +110,20 @@ static ngx_command_t ngx_imap_core_comm offsetof(ngx_imap_core_srv_conf_t, imap_capabilities), NULL }, + { ngx_string("server_name"), + NGX_IMAP_MAIN_CONF|NGX_IMAP_SRV_CONF|NGX_CONF_TAKE1, + ngx_conf_set_str_slot, + NGX_IMAP_SRV_CONF_OFFSET, + offsetof(ngx_imap_core_srv_conf_t, server_name), + NULL }, + + { ngx_string("auth"), + NGX_IMAP_MAIN_CONF|NGX_IMAP_SRV_CONF|NGX_CONF_1MORE, + ngx_conf_set_bitmask_slot, + NGX_IMAP_SRV_CONF_OFFSET, + offsetof(ngx_imap_core_srv_conf_t, auth_methods), + &ngx_imap_auth_methods }, + ngx_null_command }; @@ -210,6 +231,30 @@ ngx_imap_core_merge_srv_conf(ngx_conf_t ngx_conf_merge_value(conf->so_keepalive, prev->so_keepalive, 0); + ngx_conf_merge_bitmask_value(conf->auth_methods, prev->auth_methods, + (NGX_CONF_BITMASK_SET|NGX_IMAP_AUTH_PLAIN_ENABLED)); + + + ngx_conf_merge_str_value(conf->server_name, prev->server_name, ""); + + if (conf->server_name.len == 0) { + conf->server_name.data = ngx_palloc(cf->pool, NGX_MAXHOSTNAMELEN); + if (conf->server_name.data == NULL) { + return NGX_CONF_ERROR; + } + + if (gethostname((char *) conf->server_name.data, NGX_MAXHOSTNAMELEN) + == -1) + { + ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno, + "gethostname() failed"); + return NGX_CONF_ERROR; + } + + conf->server_name.len = ngx_strlen(conf->server_name.data); + } + + if (conf->pop3_capabilities.nelts == 0) { conf->pop3_capabilities = prev->pop3_capabilities; }