How do I change my default port 25 to 587

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
jcox312
New user
New user
Posts: 3
Joined: 2019-10-08 00:36

How do I change my default port 25 to 587

Post by jcox312 » 2019-10-08 12:43

I can receive message from the internet on port 25 but i can't send out message on that port because it shows connection timeout, my isp don't allow outbound messages on port 25. How do I make port 587 my default port for outbound messages. Even when I tried to add port 587 to tcp/ip port my server still try to connect to other server through port 25 but when they try to send message to my server on port 25 my server accepts the connection and drop the message on my mail server. I have literally done every single thing I know how to do but my server end up communication with other server on port 25 when i try to send out message but when I tried to relay my messages on port 587 it went through.


This was when I tried to use a Relay on my server through port 587.

"TCPIP" 2144 "2019-10-08 09:58:43.292" "Connecting to XXX.XXX.XXX.XXX:587..."
"SMTPC" 2712 2312 "2019-10-08 09:58:43.636" "168.235.105.136" "RECEIVED: 220 relay.example.com ESMTP"
"SMTPC" 2712 2312 "2019-10-08 09:58:43.636" "168.235.105.136" "SENT: EHLO mymailserver.domain.net"
"SMTPC" 3720 2312 "2019-10-08 09:58:43.792" "168.235.105.136" "RECEIVED: 250-relay.example.com[nl]250-SIZE[nl]250-STARTTLS[nl]250-AUTH LOGIN PLAIN[nl]250 HELP"
"SMTPC" 3720 2312 "2019-10-08 09:58:43.792" "168.235.105.136" "SENT: STARTTLS"
"SMTPC" 3112 2312 "2019-10-08 09:58:43.949" "168.235.105.136" "RECEIVED: 220 Ready to start TLS"
"TCPIP" 820 "2019-10-08 09:58:44.308" "TCPConnection - TLS/SSL handshake completed. Session Id: 2312, Remote IP: XXX.XXX.XXX.XXX, Version: TLSv1.2, Cipher: ECDHE-RSA-AES128-GCM-SHA256, Bits: 128"
"SMTPC" 820 2312 "2019-10-08 09:58:44.308" "168.235.105.136" "SENT: EHLO mymailserver.domain.net"
"SMTPC" 3720 2312 "2019-10-08 09:58:44.480" "168.235.105.136" "RECEIVED: 250-relay.example.com[nl]250-SIZE[nl]250-AUTH LOGIN PLAIN[nl]250 HELP"
"SMTPC" 3720 2312 "2019-10-08 09:58:44.480" "168.235.105.136" "SENT: AUTH LOGIN"


This is when I try to send message without the relay.

"TCPIP" 3228 "2019-10-08 00:10:32.211" "DNS MX lookup: example.com"
"TCPIP" 476 "2019-10-08 00:10:32.211" "DNS - MX Result: 5 IP addresses were found."
"TCPIP" 476 "2019-10-08 00:10:32.211" "Connecting to XX.XXX.X.XX:25..."
"TCPIP" 2928 "2019-10-08 00:07:46.306" "Connecting to XXX.XX.XX.XXX:25..."
"TCPIP" 3228 "2019-10-08 00:07:46.306" "Connecting to XX.X.XX.X:25..."
"TCPIP" 2928 "2019-10-08 00:08:07.321" "Connecting to XXX.XXX.XXX.XX:25..."
"TCPIP" 3228 "2019-10-08 00:08:07.321" "Connecting to XX.XX.XXX.XXX:25..."


I need it to connect to port 587 just the way it connected when i used a relay with port 587 instead of port 25. Is it possible if it is please let me know what I am missing.

User avatar
katip
Senior user
Senior user
Posts: 690
Joined: 2006-12-22 07:58
Location: Istanbul

Re: How do I change my default port 25 to 587

Post by katip » 2019-10-08 13:19

you can tell your server to listen to ports you like but you can't tell other servers to do the same.
solution in your case is using an SMTP relay host which accepts connections to ports other than 25 (587, 465, 25000 etc...).
or you make a deal with your ISP and they open outbound port 25 for you.
Katip
--
HMS 5.7.0-B2428-LTS-64-bit, MySQL 5.7.24, SA 3.4.2, ClamAV 0.101.2 + SaneS

User avatar
Dravion
Senior user
Senior user
Posts: 1471
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: How do I change my default port 25 to 587

Post by Dravion » 2019-10-08 15:17

Aa Katip already stated.

All, worldwide SMTP-Servers expecting your SMTP-Server to communicate on Port 25.
If you switch it to something else, nothing will work on the Public Internet for you.

Port: 25 (Mail exchange on SMTP-Servers, should be set to STARTTLS optional nowdays)
Port 587 (Mail exchange via SMTP with Thunderbird/or any other MailApp, should be set to use STARTTLS required nowdays)
Port 143 (IMAP, should be set to use with STARTTLS required nowdays)
Port 933 (MAPS -> TLS/SSL)

User avatar
SorenR
Senior user
Senior user
Posts: 3213
Joined: 2006-08-21 15:38
Location: Denmark

Re: How do I change my default port 25 to 587

Post by SorenR » 2019-10-08 18:14

When we talk about port 25 being blocked...

This is basic TCP/IP knowledge btw.

hMailServer RECEIVE mail on port 25
hMailServer SEND mail on random port > 1024 - Receiver must per RFC RECEIVE mail on port 25, se previous line.

A mailserver receive mail on port 25, that is the ONLY thing you need to know.

The ONLY way to bypass "a port 25 block" is to use a relay-host. Either an inbound relay or an outbound relay - depending on which direction is blocked.

A relay will act on your behalf, it will receive mail on port 25 and send it to your server on a custom port to bypass your ISP filtering rules. Similarly will an outbound relay receive mail from your server on a custom port and forward it to the final recipient server on port 25.
SørenR.

“With age comes wisdom, but sometimes age comes alone.”
- Oscar Wilde

jcox312
New user
New user
Posts: 3
Joined: 2019-10-08 00:36

Re: How do I change my default port 25 to 587

Post by jcox312 » 2019-10-08 19:03

Thanks for your support. I thought there was any other way around it without using a relay.

User avatar
jimimaseye
Moderator
Moderator
Posts: 8157
Joined: 2011-09-08 17:48

Re: How do I change my default port 25 to 587

Post by jimimaseye » 2019-10-08 23:46

jcox312 wrote:
2019-10-08 19:03
Thanks for your support. I thought there was any other way around it without using a relay.
Thankfully not. Otherwise the email world would be flooded with spam to the point of unworthiness (Note than the current 3 billion spam messages).

[Entered by mobile. Excuse my spelling.]
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

Post Reply