The the difference between your email being delivered or not. Luckily, it’s not something you need to think about a lot as your email provider does it for you. And they care about the successful delivery as much as you do.
Sometimes, however, the default SMTP port might not guarantee the best delivery. This is when knowing what the alternatives are might really help. Let’s start then!
SMTP and SMTP ports – what are they all about?
Let’s start with some definitions so it’s clear what we’re talking about.
SMTP (Simple Mail Transfer Protocol) is a technology that sends the huge majority of emails on the internet. It’s what moves the message from your email client through email servers to the recipient’s server. From there, it’s usually delivered to their client over a different protocol – usually IMAP or POP3.
Ports (not in a maritime sense) are communication endpoints commonly used to identify the exact location of an internet address. They’re a part of every domain address, even though they’re not visible to end-users. For example, to open an HTTP address you use port 80 and to get to an HTTPS address you need to use port 443.
When sending emails, SMTP first needs to direct them to a specific address on the internet for further processing. Each email is sent to a dedicated server and a predefined SMTP port.
Modern SMTP transmission can be broken down into two stages – email submission and relaying. Submission is, well, about submitting an email message to an outgoing server. SMTP Relay refers to the process of relaying a message between email servers (known as MTA), on the way to the recipient’s server. Frequently, different ports are used for each of these stages. We’ve covered SMTP Relay in detail in another article.
What are the standard SMTP ports?
There are four of them that are or were considered standard at some point. These are ports 25, 465, 587 and 2525. Other ports can also be used for SMTP transmission but they’re not usually the first choice for Internet Service Providers (ISPs).
Among these four, 587 and 2525 are the more reliable options these days. To understand why, we need to look a bit back into history.
SMTP Ports – different ports for different purposes
Port 25
Port 25 is the oldest of all SMTP protocols. As a matter of fact, it was around since the very first days of email transmission. When RFC 821 was launched back in 1982, it established Port 25 as the default transmission channel for internet email. It remained omnipresent for all these years and even now is used for many transmissions.
Over time, though, 25 became a port for sending not only legitimate messages but also unwanted emails. Spammers were roaming freely, sending huge waves of spam over this somewhat ancient port. This, as a result, led to more and more hosting providers and ISPs blocking port 25 for email submission.
These days, port 25 is mainly used for SMTP Relaying – transmitting messages between different email servers. It’s not recommended to use for email submission unless you specifically manage your own mail server.
When sending emails this way, you may often hit an error that would indicate that port 25 is closed for email submission. Luckily, there are several alternative, more modern ports you can use freely instead.
It’s important to note that SMTP and its port 25 weren’t secure at the beginning. In 1995, SSL was introduced, establishing the first publicly available way to encrypt emails.
At that time, adding extra security to a port didn’t just mean some extra development. It required establishing an entirely new port for secured transmissions and having another one for plain text messages (port 25). It wasn’t just an SMTP thing – to this day, protocols such as FTP, IMAP and POP also use two different ports for encrypted and for plain text messages.
Port 465
Port 465 was selected for use as the new, secure SMTP port for SSL while port 25 was tasked with relaying. Many platforms quickly migrated to port 465. Not long afterward, though, IANA (Internet Assigned Numbers Authority) reassigned this port for other uses, and recommended using other ports for secure transmission.
Due to this unusual move, many services that had just switched to 465 were left with a deprecated port. Others quickly adapted to use other ports. Even though port 465 was made redundant in 1998, you can still find many services using it today.
This is partly due to the fact that it was reinstated in 2018 with RFC8314. With this decision, IEFT wanted to “encourage more widespread use of TLS and to also encourage greater consistency regarding how TLS is used”.
Transmissions sent via port 465 rely on Implicit SSL. This means that upon the first connection to a server, a client will immediately negotiate an SSL connection. If either side of the transaction is not compatible, or if any errors occur, the transmission will not continue.
Another approach involves STARTTLS and Explicit SSL. Here, a plain text connection is established first which the STARTTLS command will try to upgrade to an encrypted one. If it fails for any reason, a plain text transmission will be used.
Read more about SSL, TLS, STARTTLS, and others in our other article about SMTP Security.
Port 465 is a reasonable approach if you explicitly want to use Implicit SSL. For Explicit SSL and STARTTLS, you might want to look into…
To learn about Port 587 and Port 2525 head to the original mailtrap.io blog post.