mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 17:35:52 +03:00
[GH-ISSUE #1110] Proxy mail server #914
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#914
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kennylajara on GitHub (May 19, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1110
Is your feature request related to a problem? Please describe.
I am trying to proxy a mailserver but the task seams to be impossible at the moment with NPM whit this is possible to do with Nginx.
Describe the solution you'd like
I'd like the option to stream proxy mail serves as described here: https://docs.nginx.com/nginx/admin-guide/mail-proxy/mail-proxy/
I tried to stream the ports but the protocoles
imap,smptandpop3are not supported by NPM.Describe alternatives you've considered
The only alternative that I can think is manually configure the mailserver with the "Custom Nginx configuration" option but the reason why I am using NPM is because I don't know how to deal with Nginx directly.
@jc21 commented on GitHub (May 19, 2021):
While the version of Nginx (OpenResty) is built with mail extensions, this project doesn't really support this type of configuration as the nginx document describes. Certainly something that could be added in future, though I'd like to see more demand for it.
If anyone else is wanting this feature please add a thumbs up to @kennylajara's issue above.
@kennylajara commented on GitHub (May 20, 2021):
Ok... so, meanwhile I am trying some workaround and need to mound my mailsever's
.well-knowndirectory with the proxy's.well-knowndirectory but looks like the npm's.well-knowndirectory is not being used. The.well-knowdirectory that I found with some files is on the docker'soverlay2directory...So... can you help me on that?
@dszymczuk commented on GitHub (Dec 26, 2021):
I'm bumping this issue. Is it possible to mount
.well-knownfolder into nginx-proxy-manager?I would like to use poste.io as my mail server, but to enable TLS certificate with let's encrypt I need to mount
.well-knownfolder from poste.io.I don't know how to use
/data/letsencrypt-acme-challengefolder correctly.@chaptergy commented on GitHub (Dec 27, 2021):
As a workaround: you could mount a file with an nginx
mailblock into/data/nginx/custom/root.conf. (See custom mountpoints)@iamk3 commented on GitHub (Dec 27, 2021):
I am interested in this functionality as well!
@chaptergy would you provide an example or link to an example of how to add the mail block? I understand the location based on your previous link. There currently isn't a dir located at /data/nginx/custom/ to contain any conf files.
@chaptergy commented on GitHub (Dec 27, 2021):
Well, you'll need to mount it into the docker container. So you would have to create a file on the host where docker is running, e.g.
nginx-mail.confwith your desired nginx config. It could look something like this: Example by @aitkarClick to view note about certificates
Then you have to edit you docker compose file to mount this file into the specific location inside the container and expose your ports:
@sanderlv commented on GitHub (Nov 25, 2022):
Is there and progress on this implementation or fearure request? Would love to see this natively in NPM. Having my mail services beging NPM with an ssl cert. (The described docker tip is too complex for me to understand).
@vadikonline1 commented on GitHub (Dec 15, 2022):
Create with portainer:
Image: docker.io/mailserver/docker-mailserver:edge
Ports: 25:25 143:143 465:465 587:587 993:993
Volume: contrainer: /etc/letsencrypt -> volume: (indicate the volume from npm where the certificates are included)
Network: hostname: mail DomainName: example.vom
Environment variables:
ENABLE_FAIL2BAN=1
SSL_TYPE=manual
PERMIT_DOCKER=network
ONE_DIR=1
ENABLE_POSTGREY=0
ENABLE_CLAMAV=0
ENABLE_SPAMASSASSIN=0
SPOOF_PROTECTION=0
FETCHMAIL_POLL=300
POSTGREY_AUTO_WHITELIST_CLIENTS=5
POSTGREY_DELAY=300
POSTGREY_MAX_AGE=35
POSTGREY_TEXT=Delayed by Postgrey
SASLAUTHD_MECH_OPTIONS=
SSL_CERT_PATH=/etc/letsencrypt/live/npm-X/fullchain.pem
SSL_KEY_PATH=/etc/letsencrypt/live/npm-X/privkey.pem
TLS_LEVEL=modern
Container capabilities: NET_ADMIN SYS_PTRACE
After starting the container, apply the following commands in the console:
@pacomarcilla commented on GitHub (Aug 3, 2023):
I don´t know if I arrive late to the party but here are my 2 cents. I do have NPM working for ports 25, 587 and 993 as streams for my mail server.
All I've done is:
All seems do work perfectly fine from the outside.
I do have some other streams for other services working but seems like mail ports are more sensible.
Hope it helps!
@quillfires commented on GitHub (Nov 23, 2023):
How did you do this?
@Smallinger commented on GitHub (Dec 16, 2023):
if there any updates for this ?
@Baltimorepc commented on GitHub (Mar 6, 2024):
i would love to get this working for me as i use my Asustor Nas and it has trouble getting certs. i would love to run my mail server thru my npm but i have not been able to get it to work
@manalishi70 commented on GitHub (May 24, 2024):
I try this by creating a proxy host my.domain.com:993 pointing to port 147 on the mailserver. Did you do it this way?
It doesn't work for me
@Baltimorepc commented on GitHub (May 28, 2024):
Thank you i will give this a try hopfully it will work as all my mail server is showing not trusted even though it is and my nextcloud or other services wont send emails because of it
@marshalleq commented on GitHub (Oct 25, 2024):
So this is not currently supported by the looks in Nginx Proxy Manager. I assume it would be easier to get to work in something like https://hub.docker.com/r/linuxserver/swag which I used to use, but came to this for simplicity. Seems like this simplicity has some drawbacks.
@hanisntsolo commented on GitHub (Jan 23, 2025):
is somebody looking at this @jc21 pls help with the mail proxy
@hanisntsolo commented on GitHub (Jan 23, 2025):
can you please help here there are enough upvotes to address this issue.
@Bigsausage64 commented on GitHub (Feb 26, 2025):
Hi,
I've managed to get my SMTP server behind my NPM with a stream host but as every connection come from a local IP (my NPM's private address) I can't find a way to not be an open relay.
If I trust m'y NPM's private address, I become open relay, if I don't trust it, legit emails are rejected.
When my SMTP server is directly connected to internet (no proxy involved), everything works fine.
Can someone help me understand what I'm doing wrong ? Thanks
@phoniclynx commented on GitHub (Jul 27, 2025):
I've tried to get NPM to work with streams, but every time I try creating the stream in the web interface, it gives the error "Internal Error".
Has anyone got an example of what I could write as a config file in the /data/ngix/stream folder? or if there is something better to get stream working?
@github-actions[bot] commented on GitHub (Jan 29, 2026):
Issue is now considered stale. If you want to keep it open, please comment 👍
@JSchlesinger commented on GitHub (Feb 16, 2026):
Yes I would like this feature too please, specifically to expose the proton mail bridge running in docker so I can access my Proton email when I am not on the same network.