Configuring nginx as mail proxy

Maxim Dounin mdounin at mdounin.ru
Wed Oct 24 14:53:36 UTC 2012


Hello!

On Wed, Oct 24, 2012 at 10:27:33AM -0400, Laurent Bonetto wrote:

> I need to use nginx as a mail proxy. I am completely new to 
> nginx and need some help with the configuration.

[...]

> $ nginx -V nginx version: nginx/1.2.4 configure arguments: 
> --prefix=/opt/local --with-cc-opt='-I/opt/local/include -O2' 
> --with-ld-opt=-L/opt/local/lib 
> --conf-path=/opt/local/etc/nginx/nginx.conf 
> --error-log-path=/opt/local/var/log/nginx/error.log 
> --http-log-path=/opt/local/var/log/nginx/access.log 
> --pid-path=/opt/local/var/run/nginx/nginx.pid 
> --lock-path=/opt/local/var/run/nginx/nginx.lock 
> --http-client-body-temp-path=/opt/local/var/run/nginx/client_body_temp 
> --http-proxy-temp-path=/opt/local/var/run/nginx/proxy_temp 
> --http-fastcgi-temp-path=/opt/local/var/run/nginx/fastcgi_temp 
> --http-uwsgi-temp-path=/opt/local/var/run/nginx/uwsgi_temp 
> --with-ipv6
> 
> $ nginx nginx: [emerg] unknown directive "mail" in 
> /opt/local/etc/nginx/nginx.conf:6
> 
> The only mention of that error on the web brings up a discussion 
> in Russian and the translation is "This question is no longer 
> relevant"
> 
> 
> My questions:
> 
> Why am I getting this unknow directive?

To use nginx mail proxy module, you have to enable it during
compilation using the --with-mail configure argument.  From the 
"nginx -V" output you've provided it's clear that nginx binary you 
are using doesn't have mail module compiled in.

See here for more details:
http://nginx.org/en/docs/mail/ngx_mail_core_module.html

[...]

-- 
Maxim Dounin
http://nginx.com/support.html



More information about the nginx mailing list