Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

nginx mail proxy

395 views
Skip to first unread message

Gokan Atmaca

unread,
Nov 21, 2021, 6:30:06 AM11/21/21
to
Hello

I want to configure email proxy server with Nginx. Actually I already
do this with Postfix. But my goal is to make it Nginx. To learn... I
have configured Nginx with email module. You can see it below.

# nginx -V
nginx version: nginx/1.20.2
built by gcc 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
built with OpenSSL 1.1.1f 31 Mar 2020
TLS SNI support enabled
configure arguments: --user=www-data --group=www-data
--prefix=/etc/nginx --sbin-path=/usr/sbin/nginx
--conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid
--lock-path=/var/run/nginx.lock
--error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log
--with-http_gzip_static_module --with-http_stub_status_module
--with-http_ssl_module --with-file-aio --with-http_geoip_module
--with-http_realip_module --without-http_scgi_module
--without-http_uwsgi_module --without-http_rewrite_module --with-mail

the error is as follows:

# nginx -t
nginx: [emerg] "mail" directive is not allowed here in /etc/nginx/conf.d/1:3
nginx: configuration file /etc/nginx/nginx.conf test fail


Config:

mail {
server_name 98281.domain.com;
auth_http localhost:9000/cgi-bin/nginxauth.cgi;

proxy_pass_error_message on;

ssl on;
ssl_certificate /etc/ssl/certs/server.crt;
ssl_certificate_key /etc/ssl/certs/server.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;

server {
listen 25;
protocol smtp;
smtp_auth login plain cram-md5;
}

server {
listen 110;
protocol pop3;
pop3_auth plain apop cram-md5;
}

server {
listen 143;
protocol imap;
}
}


What could be the problem?

--
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀⠀⠀⠀

Reco

unread,
Nov 21, 2021, 9:10:05 AM11/21/21
to
Hi.

On Sun, Nov 21, 2021 at 02:27:52PM +0300, Gokan Atmaca wrote:
> What could be the problem?

The very thing nginx tells you in the error message - "mail" directive
is not recognized. Probably your installation is missing libnginx-mod-mail.

Reco

Gokan Atmaca

unread,
Nov 22, 2021, 2:30:04 AM11/22/21
to
> The very thing nginx tells you in the error message - "mail" directive
> is not recognized. Probably your installation is missing libnginx-mod-mail.

I showed above. There is a module. (nginx -V --with-mail) I compiled
nginx manually.
There seems to be a module. I added the email while compiling.
0 new messages