What is Port 587?

by Colin Cohen | Published on October 20, 2023

Port 587 is dedicated to the Simple Mail Transfer Protocol (SMTP) and is used to submit mail messages from the sender to the receiver. SMTP port 587 facilitates secure, reliable email traffic. Unlike SMTP port 25, port 587 is specifically designed for the submission of outgoing mail messages initiated by end-users.


Simple Mail Transfer Protocol Explained

SMTP over port 587 delivers mail through the transmission of a set of messages (a mail transaction) between the sender’s email client and the receiver’s email server. This happens through the following six steps:

Email Client

Email Server

Sends a HELO (or EHLO) command identifying itself.

Replies with a HELO command with its domain or IP address.

Sends a MAIL FROM command identifying the sender of the mail.

Replies with a 250 OK message.

Sends a RCPT TO command identifying the receiver of the mail.

Replies with a 250 OK message.

Sends a DATA command along with the contents of the message.

Replies with a 354 message.

Sends a “.” indicating the end of the message.

Replies with a 250 OK message.

Sends a QUIT command to end the transmission.

Replies with a 221 message.

 

If, during transmission, the client needs to abort and restart transmission, it will issue a RSET command.

Why is Port 587 Called the Submission Port?

Port 587 is known as the default mail submission port because it is the port used to submit mail messages to a recipient’s email server. Port 587 is only responsible for outgoing (submitted) messages — not the incoming ones.

Is SMTP Port 25 or 587?

At one time, port 25 was used for submitting mail messages. But thanks to several types of vulnerabilities relating to this port, port 587 was established for the transmission of standard email. Today, port 25 is primarily used for relaying mail from one server to another. Even though SMTP port 25 is still recognized by the IANA as the default SMTP port for sending email... you probably shouldn't use it.

The biggest difference between port 25 vs port 587 is that port 25 is unsecure. Port 587, on the other hand, uses an encryption mechanism such as STARTTLS. 

RELATED: SMTP Ports 587 vs 25 (and How to Choose the Right One)

What is TCP Port 587 Used For?

Applications and devices use port 587 for delivering mail messages using SMTP.

An Overview of Simple Mail Transfer Protocol

SMTP is a protocol that lets you send a mail message over the Internet. You can use it to send mail from a client to a server over port 587. You can also use the same protocol for relaying mail from server to server over port 25.

Applications and Devices That Use Port 587

Two types of applications use port 587 for delivering mail messages: clients and servers.

Client applications let an individual submit an email to another user. This includes applications such as:

  • Outlook

  • Gmail

  • Apple Mail

The other type of application that uses port 587 is mail servers, which processes submitted email. This includes applications like these:

  • Sendmail

  • Exim

  • Postfix

While email is generally sent through an application, you can also send it through a device such as a printer or a scanner.

Why You Should Use Port 587 Instead of Port 25

While you can use port 25 for relaying mail from one server to another, you should use port 587 for submitting standard email. This is because port 587 supports the following features that port 25 does not:

  • Authentication

  • Encryption

  • Tamper proofing through the use of digital signatures

This creates a more secure connection, making port 587 a better choice for email. 

Is Gmail SMTP Port 587?

Gmail supports both port 587 and port 25. But if you are submitting a standard mail message through it, you should use port 587.

Are There Security Vulnerabilities With Port 587?

Port 587 is not inherently vulnerable, but as with any port, it's possible for security vulnerabilities to arise if it's not configured and managed properly. To ensure the security of email communication using port 587, it is essential to enforce encryption, use strong authentication methods, monitor for unusual activity, and keep both client and server software up to date with security patches. 

Avoid Being Labeled As Spam with SMTP Port 587

Because port 25 is so associated with spam, many ISPs and hosting providers block it. Others may automatically consider it spam. By submitting mail over port 587, you can help avoid having your mail automatically labeled as spam.

How SMTP 587 Improves Email Security

Using SMTP over port 587 improves email security by adding authentication, encryption and tamper proofing. To put it simply, port 587 is the most modern, secure SMTP port for sending emails. Its support of TLS and STARTTLS helps ensure safe message transmission.

The primary purpose of port 587 is to separate mail submission from message relay, versus the less secure relay that occurs with port 25. Since port 587 is widely adopted by major email services (including Microsoft Outlook, Apple Mail, Gmail, and others) this is the gold standard.

SMTP 587: TCP, UDP, SSL, or TLS

SMTP can use either TLS or SSL when encrypting mail. It typically uses TCP as a transport protocol. This section delves into the technical intricacies surrounding SMTP 587, exploring the fundamental protocols, such as TCP and UDP, as well as the encryption methods, SSL and TLS, that underpin its operation.  

TLS or SSL: Which Does SMTP Use?

SMTP can use either Transport Layer Security (TLS) or Secure Sockets Layer (SSL) to encrypt mail messages and prevent injection attacks, in which an attacker modifies the contents of the mail or reroutes it to a different recipient. Using TLS or SSL transforms SMTP into the secure version of it, which is called SMTPS.

Is SMTP Port 587 TCP?

When using SMTP over port 587, you should use TCP as the transport protocol. In theory, while you could use UDP for submitting mail, in practice you'll use TCP. This is because it's a more reliable protocol. With TCP, you don’t have to worry about mail data getting lost, damaged, delivered out of order, or duplicated during transmissions.

How to Avoid SMTP Port 587 Conflicts

You can avoid conflicts by using port 587 only for submitting email with SMTP. You can also use port 2525 for this (in case port 587 is blocked).

You should only use port 587 for mail submissions because it's far more secure than using port 25. With support for encryption, authentication and tamper proofing, sending mail over port 587 can prevent spamming and email-related vulnerabilities. This is what port 587 was designated for, and helps traffic move securely from sender to receiver.

Do You Need to Open Port 587 for SMTP?

You should open port 587 for SMTP if you have an email server that you want others to reach. If there is a conflict with port 587, you can also use port 2525 for SMTP as a backup. Port 2525 supports TLS encryption as well, despite it not having been recognized as an official designated port by the IANA.

Do Email Servers Use Port 587 or Port 25?

Trick question! Email servers can use both port 587 and port 25. While they use port 587 for submitting mail from clients, they can also use port 25 for receiving mail from other email servers. The receiving end of email happens in a process called 'relaying.'

Key Takeaways About Port 587

When submitting mail from an email client to a recipient’s email server using SMTP, you should use port 587, as it provides protections against spammers and other malicious actors. While there are limited cases where port 587 may not be accessible, for most senders, its encryption and widespread acceptance make it the preferred choice for secure email sending.

Get CBT Nuggets IT training news and resources

I have read and understood the privacy policy and am able to consent to it.

© 2024 CBT Nuggets. All rights reserved.Terms | Privacy Policy | Accessibility | Sitemap | 2850 Crescent Avenue, Eugene, OR 97408 | 541-284-5522