[GH-ISSUE #95] Can I use it without port 25? #68

Open
opened 2026-02-25 23:39:46 +03:00 by kerem · 1 comment
Owner

Originally created by @saschabrockel on GitHub (Jan 19, 2025).
Original GitHub issue: https://github.com/HaschekSolutions/opentrashmail/issues/95

Currently, I run a ntfy instance which already uses an MX record and of course port 25. The port is exposed to the internet and this works.

So this is ntfy.test.com. Now I created a new entry called *.trash.test.com. Of course the A record for trash.test.com as well.

I run the OpenTrashMail instance in Docker and have mapped the internal port 25 to 2626 and exposed 2626 as well on my router. But I do not receive any mail. Where is the problem? Does it has to be used with port 25 and I can only use one tool?

I don't understand how this technically works anyway.

Originally created by @saschabrockel on GitHub (Jan 19, 2025). Original GitHub issue: https://github.com/HaschekSolutions/opentrashmail/issues/95 Currently, I run a ntfy instance which already uses an MX record and of course port 25. The port is exposed to the internet and this works. So this is `ntfy.test.com`. Now I created a new entry called `*.trash.test.com`. Of course the A record for `trash.test.com` as well. I run the OpenTrashMail instance in Docker and have mapped the internal port 25 to 2626 and exposed 2626 as well on my router. But I do not receive any mail. Where is the problem? Does it has to be used with port 25 and I can only use one tool? I don't understand how this technically works anyway.
Author
Owner

@thegeekoftheworld commented on GitHub (May 7, 2025):

This is hardcoded behavior of all mail servers they always connect to port 25 for delivery.

If you expose port 2626 instead of 25, no one will ever send email to it.
External mail servers don’t “know” about your custom port.
They don't support port numbers in MX records — MX is domain → host, not host:port.

If you only have one public IP, and you want both ntfy and OpenTrashMail to receive mail:

Run a full MTA (like Postfix) on port 25.

Configure it to:

- Accept mail for ntfy.test.com and pass it to your ntfy instance.
- Accept mail for *.trash.test.com and forward it to OpenTrashMail (e.g., via localhost:2626).
<!-- gh-comment-id:2857663150 --> @thegeekoftheworld commented on GitHub (May 7, 2025): This is hardcoded behavior of all mail servers they always connect to port 25 for delivery. If you expose port 2626 instead of 25, no one will ever send email to it. External mail servers don’t “know” about your custom port. They don't support port numbers in MX records — MX is domain → host, not host:port. If you only have one public IP, and you want both ntfy and OpenTrashMail to receive mail: Run a full MTA (like Postfix) on port 25. Configure it to: - Accept mail for ntfy.test.com and pass it to your ntfy instance. - Accept mail for *.trash.test.com and forward it to OpenTrashMail (e.g., via localhost:2626).
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/opentrashmail#68
No description provided.