Send mail port 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
qneo
New user
New user
Posts: 29
Joined: 2019-08-27 07:59

Send mail port 587

Post by qneo » 2019-09-08 14:02

So I'm trying to send mail through port 587, because 25 is blocked.

As you can see in the log, it connects internally through 587, but then it tries to connect to gmail through port 25.

What should I do?


"DEBUG" 3924 "2019-09-08 13:51:15.313" "Creating session 148"
"TCPIP" 3924 "2019-09-08 13:51:15.314" "TCP - 192.168.1.1 connected to 192.168.1.22:587."
"DEBUG" 3924 "2019-09-08 13:51:15.317" "TCP connection started for session 146"
"SMTPD" 3924 146 "2019-09-08 13:51:15.317" "192.168.1.1" "SENT: 220 mail.almighty.se ESMTP"
"SMTPD" 4168 146 "2019-09-08 13:51:15.318" "192.168.1.1" "RECEIVED: HELO Admin-Dator"
"SMTPD" 4168 146 "2019-09-08 13:51:15.319" "192.168.1.1" "SENT: 250 Hello."
"SMTPD" 5396 146 "2019-09-08 13:51:15.319" "192.168.1.1" "RECEIVED: MAIL FROM:<user1@almighty.se>"
"DEBUG" 5396 "2019-09-08 13:51:15.321" "Total spam score: 0"
"SMTPD" 5396 146 "2019-09-08 13:51:15.321" "192.168.1.1" "SENT: 250 OK"
"SMTPD" 3924 146 "2019-09-08 13:51:15.322" "192.168.1.1" "RECEIVED: RCPT TO:<mymail@gmail.com>"
"SMTPD" 3924 146 "2019-09-08 13:51:15.326" "192.168.1.1" "SENT: 250 OK"
"SMTPD" 4168 146 "2019-09-08 13:51:15.326" "192.168.1.1" "RECEIVED: DATA"
"SMTPD" 4168 146 "2019-09-08 13:51:15.327" "192.168.1.1" "SENT: 354 OK, send."
"DEBUG" 7884 "2019-09-08 13:51:15.529" "Adding task AsynchronousTask to work queue Asynchronous task queue"
"DEBUG" 1232 "2019-09-08 13:51:15.529" "Executing task AsynchronousTask in work queue Asynchronous task queue"
"DEBUG" 1232 "2019-09-08 13:51:15.530" "Total spam score: 0"
"DEBUG" 1232 "2019-09-08 13:51:15.530" "Saving message: {BE5F2F15-A999-475C-84D2-F410832A6194}.eml"
"DEBUG" 1232 "2019-09-08 13:51:15.533" "Requesting SMTPDeliveryManager to start message delivery"
"SMTPD" 1232 146 "2019-09-08 13:51:15.533" "192.168.1.1" "SENT: 250 Queued (0.203 seconds)"
"SMTPD" 3924 146 "2019-09-08 13:51:15.536" "192.168.1.1" "RECEIVED: QUIT"
"SMTPD" 3924 146 "2019-09-08 13:51:15.536" "192.168.1.1" "SENT: 221 goodbye"
"DEBUG" 5240 "2019-09-08 13:51:15.536" "Adding task DeliveryTask to work queue SMTP delivery queue"
"DEBUG" 7884 "2019-09-08 13:51:15.536" "Ending session 146"
"DEBUG" 6224 "2019-09-08 13:51:15.537" "Executing task DeliveryTask in work queue SMTP delivery queue"
"DEBUG" 6224 "2019-09-08 13:51:15.537" "Delivering message..."
"APPLICATION" 6224 "2019-09-08 13:51:15.537" "SMTPDeliverer - Message 22451: Delivering message from user1@almighty.se to mymail@gmail.com@gmail.com. File: C:\hMailServer\Data\{BE5F2F15-A999-475C-84D2-F410832A6194}.eml"
"DEBUG" 6224 "2019-09-08 13:51:15.538" "Applying rules"
"DEBUG" 6224 "2019-09-08 13:51:15.538" "Performing local delivery"
"DEBUG" 6224 "2019-09-08 13:51:15.538" "Local delivery completed"
"TCPIP" 6224 "2019-09-08 13:51:15.538" "DNS MX lookup: gmail.com"
"TCPIP" 6224 "2019-09-08 13:51:15.543" "DNS - MX Result: 5 IP addresses were found."
"DEBUG" 6224 "2019-09-08 13:51:15.543" "Starting external delivery process. Server: gmail-smtp-in.l.google.com (108.177.14.26), Port: 25, Security: 2, User name: "
"DEBUG" 6224 "2019-09-08 13:51:15.543" "Creating session 149"
"TCPIP" 6224 "2019-09-08 13:51:15.544" "Connecting to 108.177.14.26:25..."
"DEBUG" 4168 "2019-09-08 13:51:16.297" "SMTPDeliverer - Message 22449 - Connection failed: Host name: 108.177.8.26, message: Anslutningsförsöket misslyckades eftersom den anslutna datorn inte svarade inom en viss tid eller på grund av att den etablerade anslutningen till värddatorn inte längre fungerar"
"DEBUG" 4168 "2019-09-08 13:51:16.297" "Ending session 143"
"DEBUG" 2788 "2019-09-08 13:51:16.297" "External delivery process completed"
"DEBUG" 2788 "2019-09-08 13:51:16.297" "Starting external delivery process. Server: alt4.gmail-smtp-in.l.google.com (173.194.192.26), Port: 25, Security: 2, User name: "
"DEBUG" 2788 "2019-09-08 13:51:16.298" "Creating session 150"
"TCPIP" 2788 "2019-09-08 13:51:16.298" "Connecting to 173.194.192.26:25..."

palinka
Senior user
Senior user
Posts: 1213
Joined: 2017-09-12 17:57

Re: Send mail port 587

Post by palinka » 2019-09-08 14:21

qneo wrote:
2019-09-08 14:02
So I'm trying to send mail through port 587, because 25 is blocked.

As you can see in the log, it connects internally through 587, but then it tries to connect to gmail through port 25.

What should I do?

Image


If port 25 outgoing is blocked, you will need to use a relay to send mail. Google (like all other mail servers) will only receive external mail on port 25.

Google: "free smtp relay" to get you started. Some relay services have free accounts with rather good limitations. You may be able to get by with a free one. If not, there are cheap ones for relatively low volume. But start with free so you can evaluate how they work for you and also to get yourself up and running. You can decide later if you need a paid account.

qneo
New user
New user
Posts: 29
Joined: 2019-08-27 07:59

Re: Send mail port 587

Post by qneo » 2019-09-08 14:26

Don't they receive 465 ssl or 587 tls?

palinka
Senior user
Senior user
Posts: 1213
Joined: 2017-09-12 17:57

Re: Send mail port 587

Post by palinka » 2019-09-08 14:58

qneo wrote:
2019-09-08 14:26
Don't they receive 465 ssl or 587 tls?
Those are mail submission ports. Local account client connections. All external (server to server) mail travels on port 25.

Edit - to a relay service, your server is a local account. You need an account with them and a password. They will not accept mail on port 587, 465 or any custom port without authentication. But they (and everyone else) will receive all mail from all senders on port 25 without authentication.
Last edited by palinka on 2019-09-08 15:06, edited 1 time in total.

qneo
New user
New user
Posts: 29
Joined: 2019-08-27 07:59

Re: Send mail port 587

Post by qneo » 2019-09-08 15:02

So if someone use SSL it's only secure within the own network? Later when sent out it's plain text?

palinka
Senior user
Senior user
Posts: 1213
Joined: 2017-09-12 17:57

Re: Send mail port 587

Post by palinka » 2019-09-08 15:07

qneo wrote:
2019-09-08 15:02
So if someone use SSL it's only secure within the own network? Later when sent out it's plain text?
You're mixing concepts. SSL/TLS have nothing to do with authentication.

User avatar
mattg
Moderator
Moderator
Posts: 20232
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Send mail port 587

Post by mattg » 2019-09-09 02:39

palinka wrote:
2019-09-08 15:07
qneo wrote:
2019-09-08 15:02
So if someone use SSL it's only secure within the own network? Later when sent out it's plain text?
You're mixing concepts. SSL/TLS have nothing to do with authentication.
Absolutely mixing concepts

Port 25 can be an encrypted connection. My server accepts StartTLS on port 25 as do most servers. I don't accept SMTP Authentication on port 25, and ONLY accept incoming mail on port 25, no other ports. I ONLY allow SMTP authenticated mail to be sent from my server, and that MUST be submitted to my server via ports 465 or 587.


But also
qneo wrote:
2019-09-08 15:02
Later when sent out it's plain text?
That is entirely possible, although it has nothing to do with port choices as shown above.

If you want to keep messages secure from end to end, look at message level encryption (PGP or PKI or SMIME). This can be achieved without encrypted server connections, and uses technology in mail clients like Outlook or Thunderbird, and not mail server technology.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

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

Re: Send mail port 587

Post by Dravion » 2019-09-09 08:38

qneo wrote:
2019-09-08 14:26
Don't they receive 465 ssl or 587 tls?

465 and/or 587 is for sending Email Clients to your hMailserver only.

Port 25 is for SMTP to other SMTP-Server on the Internet only.

If Port 465 or 587 works with your Email Client, it means hMailServer accepts Emails from your Mail Client for sending.
But if hMailServer cannot connect to other Port 25 SMTP-Servers no Email will ever arrive at your Recipients nor can any
one from the Public Internet reach and connect to your hMailServer.

qneo
New user
New user
Posts: 29
Joined: 2019-08-27 07:59

Re: Send mail port 587

Post by qneo » 2019-09-13 22:56

Just curious. What happens if you send email from one server to another through 587 tls.

Let's say, for example, gmail sends mail to hotmail. (from bob@gmail.com to tom@hotmail.com)

Will hotmail handle this anyway, or just ignore it? Anyone tested?

User avatar
mattg
Moderator
Moderator
Posts: 20232
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Send mail port 587

Post by mattg » 2019-09-13 23:00

I don't think that you are listening

Dravion wrote:
2019-09-09 08:38
Port 25 is for SMTP to other SMTP-Server on the Internet only.
gmail (and all others) connecting to ANY other server will use port 25.
hotmail (and all others) will ONLY listen on port 25 for incoming mail.
There is NO WAY to configure or change that - that is the RFCs and just how email works.

bob@gmail.com to tom@hotmail.com will be sent on port 25, HOWEVER is likely to be on a StartTLS encrypted connection
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

qneo
New user
New user
Posts: 29
Joined: 2019-08-27 07:59

Re: Send mail port 587

Post by qneo » 2019-09-13 23:07

In what purpose do they listen to 587? For sending mail from clients?

User avatar
mattg
Moderator
Moderator
Posts: 20232
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Send mail port 587

Post by mattg » 2019-09-13 23:11

yes only that, and you will NEED to authenticate to use that port

Most servers will NOT accept mail on port 587 unless you Authenticate first, ie use an account on that server to send.

eg if you have an account at gmail say qneo@gmail.com then you could send via port 587, but only after you detail your account name and password to gmail, and then all mail will show as being FROM your gmail addres
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

qneo
New user
New user
Posts: 29
Joined: 2019-08-27 07:59

Re: Send mail port 587

Post by qneo » 2019-09-13 23:17

Thanks mattg.

This was good

mikedibella
Normal user
Normal user
Posts: 180
Joined: 2016-12-08 02:21

Re: Send mail port 587

Post by mikedibella » 2019-09-14 01:05

Additionally, many servers have restrictions on the mail submission port (i.e. port 587). For instance, it is common that mail is only accepted via the submission port FROM the email address(es) associated with the account that authenticated, which precludes the submission port from being used as a "relay" interface.

Post Reply