[GH-ISSUE #450] [Feature Request] Set up a mail server behind Nginx Proxy Manager #380

Closed
opened 2026-02-26 06:32:37 +03:00 by kerem · 10 comments
Owner

Originally created by @aitkar on GitHub (Jun 7, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/450

Hi,

First of all, many thanks to have created this great tool to handle reverse proxy servers in a simple and great UI.

I need to "stream" some mails servers ports (25,110,143 etc...) following a sub domain e.g. mail.example.com

An example here:

mail {
    server_name mail.example.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;
    }
}

I am using jc21/nginx-proxy-manager:latest 2.3

Thank you for considering this new feature request.

Originally created by @aitkar on GitHub (Jun 7, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/450 Hi, First of all, many thanks to have created this great tool to handle reverse proxy servers in a simple and great UI. I need to "stream" some mails servers ports (25,110,143 etc...) following a sub domain e.g. mail.example.com An example here: ``` mail { server_name mail.example.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; } } ``` I am using jc21/nginx-proxy-manager:latest 2.3 Thank you for considering this new feature request.
kerem closed this issue 2026-02-26 06:32:37 +03:00
Author
Owner

@Shifter2600 commented on GitHub (Aug 21, 2020):

I would be interested in this as well. I was able to get reverse proxies going for pop but I don't have it working for imap. Wonder if anyone has imap working.

<!-- gh-comment-id:677986445 --> @Shifter2600 commented on GitHub (Aug 21, 2020): I would be interested in this as well. I was able to get reverse proxies going for pop but I don't have it working for imap. Wonder if anyone has imap working.
Author
Owner

@kennylajara commented on GitHub (May 12, 2021):

Any update on this issue?

<!-- gh-comment-id:840130617 --> @kennylajara commented on GitHub (May 12, 2021): Any update on this issue?
Author
Owner

@Tradeforlife commented on GitHub (Sep 6, 2021):

I would also like to see this thanks.

<!-- gh-comment-id:913602512 --> @Tradeforlife commented on GitHub (Sep 6, 2021): I would also like to see this thanks.
Author
Owner

@b10126 commented on GitHub (Sep 10, 2021):

I would also recommend this feature.

Today the ports are routed directly from the fritzbox to my Mailserver, which is not behind the proxy. The certificate is copied manually to the Mailserver, very manual. :-(

Or does anyone has a workaround?

Many thanks.....

<!-- gh-comment-id:916633319 --> @b10126 commented on GitHub (Sep 10, 2021): I would also recommend this feature. Today the ports are routed directly from the fritzbox to my Mailserver, which is not behind the proxy. The certificate is copied manually to the Mailserver, very manual. :-( Or does anyone has a workaround? Many thanks.....
Author
Owner

@mpldr commented on GitHub (Oct 8, 2021):

Or does anyone has a workaround?

I am using TCP Streams to forward to the ports bound to loopback. Unfortunately that does not seem to work with STARTTLS and I am not quite happy sending my credentials over the wire unencrypted.

<!-- gh-comment-id:938424625 --> @mpldr commented on GitHub (Oct 8, 2021): > Or does anyone has a workaround? I am using TCP Streams to forward to the ports bound to loopback. Unfortunately that does not seem to work with STARTTLS and I am not quite happy sending my credentials over the wire unencrypted.
Author
Owner

@vincemd22 commented on GitHub (Dec 25, 2021):

Hello,
I am very interested in the function of proxymail
Is it possible to manually add an SSL on a stream on the current version of NPM ?

<!-- gh-comment-id:1000994270 --> @vincemd22 commented on GitHub (Dec 25, 2021): Hello, I am very interested in the function of proxymail Is it possible to manually add an SSL on a stream on the current version of NPM ?
Author
Owner

@chaptergy commented on GitHub (Dec 25, 2021):

@vincemd22 No, that's unfortunately not possible. The way streams work in nginx a stream can't do basically anything because it does not look at the body of a request. Streams work on the TCP / UDP, so protocol specific things like SSL can't be done there. SSL termination only work within the nginx http block (so normal proxy hosts in npm) or in a mail block, which does not exist in npm and is what this feature request is about.

<!-- gh-comment-id:1001007755 --> @chaptergy commented on GitHub (Dec 25, 2021): @vincemd22 No, that's unfortunately not possible. The way streams work in nginx a stream can't do basically anything because it does not look at the body of a request. Streams work on the TCP / UDP, so protocol specific things like SSL can't be done there. SSL termination only work within the nginx http block (so normal proxy hosts in npm) or in a mail block, which does not exist in npm and is what this feature request is about.
Author
Owner

@ahknight commented on GitHub (Dec 27, 2021):

Nginx can do it. mailu is a project that uses nginx as a TLS proxy for HTTP, SMTP, IMAP, and POP. Here's their config: https://github.com/Mailu/Mailu/blob/master/core/nginx/conf/nginx.conf

<!-- gh-comment-id:1001716613 --> @ahknight commented on GitHub (Dec 27, 2021): Nginx can do it. mailu is a project that uses nginx as a TLS proxy for HTTP, SMTP, IMAP, and POP. Here's their config: https://github.com/Mailu/Mailu/blob/master/core/nginx/conf/nginx.conf
Author
Owner

@chaptergy commented on GitHub (Dec 27, 2021):

@ahknight I said it is not possible using streams, as was the question. It is possible in general in nginx, just not in npm. It currently has no way to add servers inside a mail block, expect by mounting your own mail block into /data/nginx/custom/root.conf. (See custom mountpoints)

<!-- gh-comment-id:1001726767 --> @chaptergy commented on GitHub (Dec 27, 2021): @ahknight I said it is not possible using streams, as was the question. It is possible in general in nginx, just not in npm. It currently has no way to add servers inside a [mail block](https://github.com/Mailu/Mailu/blob/master/core/nginx/conf/nginx.conf#L254), expect by mounting your own `mail` block into `/data/nginx/custom/root.conf`. (See [custom mountpoints](https://nginxproxymanager.com/advanced-config/#custom-nginx-configurations))
Author
Owner

@chaptergy commented on GitHub (Dec 27, 2021):

Also closing this in favor of https://github.com/jc21/nginx-proxy-manager/issues/1110, since it has more upvotes.

<!-- gh-comment-id:1001739534 --> @chaptergy commented on GitHub (Dec 27, 2021): Also closing this in favor of https://github.com/jc21/nginx-proxy-manager/issues/1110, since it has more upvotes.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#380
No description provided.