Welcome! Log In Create A New Profile

Advanced

Re: Configuring nginx as mail proxy

Laurent Bonetto
October 24, 2012 11:52AM
Thanks. That was indeed my first issue. I did sudo port edit nginx, added --with-mail to the config options, reinstalled, and now I am passed that error.

I then got an error that no events was present so I just added
events {
worker_connections 1;
}

Now nginx is starting but I never see any hit to my mock service despite it being specified in auth_http
auth_http http://localhost:8080/authorize;
No errors reported in the error log.

When is nginx expected to hit the url specified in nginx? When it gets launched? When an event occurs on the ports 110 and 2525 with the protocols I specified?

I tried sending emails to/from my mail server that uses POP3 on port 110 and SMTP on port 2525 and never saw any hit to the authorize url. Am I missing another component in my config?

Again, here is my current config:

worker_processes 1;

error_log /var/log/nginx/error.log info;

events {
worker_connections 1;
}

mail {
server_name <my mail server>;
auth_http http://localhost:8080/authorize;

pop3_auth plain apop cram-md5;
pop3_capabilities "LAST" "TOP" "USER" "PIPELINING" "UIDL";

smtp_auth login plain cram-md5;
smtp_capabilities "SIZE 10485760" ENHANCEDSTATUSCODES 8BITMIME DSN;

xclient off;

server {
# SMTP on port 2525 not 25
listen 2525;
protocol smtp;
}
server {
listen 110;
protocol pop3;
# proxy on;
proxy_pass_error_message on;
}
}




On Oct 24, 2012, at 10:53 AM, Maxim Dounin <mdounin@mdounin.ru> wrote:

> 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
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Configuring nginx as mail proxy

Laurent Bonetto October 24, 2012 10:30AM

Re: Configuring nginx as mail proxy

Anton Yuzhaninov October 24, 2012 10:42AM

Re: Configuring nginx as mail proxy

Maxim Dounin October 24, 2012 10:54AM

Re: Configuring nginx as mail proxy

Laurent Bonetto October 24, 2012 11:52AM

Re: Configuring nginx as mail proxy

Maxim Dounin October 24, 2012 12:28PM

Re: Configuring nginx as mail proxy

Maxim Dounin October 24, 2012 12:38PM

Re: Configuring nginx as mail proxy

Laurent Bonetto October 24, 2012 05:40PM

Re: Configuring nginx as mail proxy

Maxim Dounin October 24, 2012 06:56PM

Re: Configuring nginx as mail proxy

Laurent Bonetto October 24, 2012 09:36PM

Re: Configuring nginx as mail proxy

Yanfeng L. November 01, 2012 06:46AM

Re: Configuring nginx as mail proxy

useopenid November 02, 2012 08:11PM

Re: Configuring nginx as mail proxy

dukzcry February 24, 2014 02:11PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 142
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready