Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #242281 > unrolled thread

nginx mail proxy

Started byGokan Atmaca <linux.gokan@gmail.com>
First post2021-11-21 12:30 +0100
Last post2021-11-22 08:30 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.debian.user


Contents

  nginx mail proxy Gokan Atmaca <linux.gokan@gmail.com> - 2021-11-21 12:30 +0100
    Re: nginx mail proxy Reco <recoverym4n@enotuniq.net> - 2021-11-21 15:10 +0100
      Re: nginx mail proxy Gokan Atmaca <linux.gokan@gmail.com> - 2021-11-22 08:30 +0100

#242281 — nginx mail proxy

FromGokan Atmaca <linux.gokan@gmail.com>
Date2021-11-21 12:30 +0100
Subjectnginx mail proxy
Message-ID<DlTcL-1Yp-15@gated-at.bofh.it>
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
⠈⠳⣄⠀⠀⠀⠀

[toc] | [next] | [standalone]


#242294

FromReco <recoverym4n@enotuniq.net>
Date2021-11-21 15:10 +0100
Message-ID<DlVHA-3uF-7@gated-at.bofh.it>
In reply to#242281
	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

[toc] | [prev] | [next] | [standalone]


#242322

FromGokan Atmaca <linux.gokan@gmail.com>
Date2021-11-22 08:30 +0100
Message-ID<DmbW1-4LC-1@gated-at.bofh.it>
In reply to#242294
> 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.


On Sun, Nov 21, 2021 at 5:06 PM Reco <recoverym4n@enotuniq.net> wrote:
>
>         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
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web