diff options
Diffstat (limited to 'src/mail/ngx_mail_smtp_handler.c')
-rw-r--r-- | src/mail/ngx_mail_smtp_handler.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mail/ngx_mail_smtp_handler.c b/src/mail/ngx_mail_smtp_handler.c index 2d7c24f56..6e944738f 100644 --- a/src/mail/ngx_mail_smtp_handler.c +++ b/src/mail/ngx_mail_smtp_handler.c @@ -54,10 +54,16 @@ ngx_mail_smtp_init_session(ngx_mail_session_t *s, ngx_connection_t *c) ngx_resolver_ctx_t *ctx; ngx_mail_core_srv_conf_t *cscf; - c->log->action = "in resolving client address"; - cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); + if (cscf->resolver == NULL) { + s->host = smtp_unavailable; + ngx_mail_smtp_greeting(s, c); + return; + } + + c->log->action = "in resolving client address"; + ctx = ngx_resolve_start(cscf->resolver, NULL); if (ctx == NULL) { ngx_mail_close_connection(c); |