diff src/mail/ngx_mail_smtp_handler.c @ 1896:4c060e30476b

do not resolve SMTP clients by default
author Igor Sysoev <igor@sysoev.ru>
date Sat, 16 Feb 2008 13:46:33 +0000
parents 057d362ee50e
children 2a92804f4109 f4aea5b40fd7
line wrap: on
line diff
--- a/src/mail/ngx_mail_smtp_handler.c
+++ b/src/mail/ngx_mail_smtp_handler.c
@@ -54,9 +54,15 @@ ngx_mail_smtp_init_session(ngx_mail_sess
     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);
 
-    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) {