SSL/TLS on port 465 vs. STARTTLS on port 587: Port 465 (Implicit TLS) is officially recommended by RFC 8314 as the safer SMTP submission setting because it encrypts the TCP socket immediately before any SMTP commands or passwords are sent, eliminating cleartext downgrade attacks (STRIPTLS) that still threaten misconfigured STARTTLS port 587 clients.
There is a question that trips up nearly every developer, system administrator, and business owner who sets up their own email server. When your mail client shows you a dropdown with two options — SSL/TLS (port 465) or STARTTLS (ports 587 and 2525) — which one do you actually pick?
Most tutorials confidently recommend STARTTLS on port 587. Dozens of legacy hosting guides, Mailcow documentation screenshots, and Stack Overflow answers point you toward 587. If you have been doing this for years, that is probably what you are using right now.
Here is what those guides quietly skip over: SSL/TLS on port 465 is definitively the safer, faster, and more modern choice in 2025. The reason most documentation still defaults to 587 is inertia — not technical superiority.
This article explains the fundamental difference between the two protocols, why SSL/TLS 465 wins on every technical dimension that matters, and when STARTTLS is still the right choice (there is one real scenario).
1. The Core Difference: Encryption Timing
The most important thing to understand about these two protocols is not the port number. It is when the encryption begins.
SSL/TLS (Port 465) — Encryption First:
The moment your email client makes a connection to the server on port 465, an encrypted TLS tunnel is established. Every single byte — including your username, your password, and the email headers — is encrypted from the very first millisecond of the connection. The server never sees your credentials in plaintext. There is no window where the connection is vulnerable.
STARTTLS (Port 587 / 2525) — Upgrade Model:
Your email client connects to the server on port 587. The initial connection is completely unencrypted. Your client first sends a greeting, the server responds with its capabilities in plaintext, and then — only after this initial plaintext handshake — your client says "hey, let's upgrade to TLS now" via a STARTTLS command. The server agrees, and the connection becomes encrypted.
That gap between the initial connection and the TLS upgrade is the core architectural weakness of STARTTLS.
2. The STARTTLS Downgrade Attack (Why It Matters)
The vulnerability that keeps serious security engineers up at night is called a STARTTLS downgrade attack, also known as a STRIPTLS attack.
Here is how it works: An attacker who can intercept traffic between your email client and your server (a Man-in-the-Middle attack, which is alarmingly common on shared networks, corporate firewalls, and compromised routers) can intercept the unencrypted initial connection and strip the STARTTLS capability announcement out of the server's response.
Your client never sees the STARTTLS option. Without knowing it is available, your client quietly falls back to sending your email in plain, unencrypted text. Your username, your password, and every word of your email can be read by the attacker in perfect clarity.
This cannot happen with SSL/TLS on port 465. Because the TLS tunnel is established before any data is exchanged, there is nothing for an attacker to intercept or downgrade. The connection is either fully encrypted from the start, or it fails completely. There is no fallback to plaintext.
3. Why Does Port 587 Still Exist?
If SSL/TLS 465 is more secure, why is port 587 still the default recommendation in so many places?
The answer is history. Port 465 was officially assigned for SMTPS (SMTP over SSL) in 1997, but was controversially unassigned by the IANA just one year later in 1998 — before it was widely adopted. Port 587 was then designated as the official "mail submission" port with STARTTLS support.
For the next 20 years, the industry built around port 587. Corporate firewalls were configured to allow 587. Client software was written to default to 587. Documentation was written around 587.
Then in 2018, the IANA quietly but officially reassigned port 465 for SMTPS with implicit TLS. The security community broadly agrees today that 465 with SSL/TLS is the correct modern choice. The problem is that 20 years of inertia means most tutorials have not caught up yet.
4. Head-to-Head Comparison: SSL/TLS vs STARTTLS
| Feature | SSL/TLS (Port 465) | STARTTLS (Port 587/2525) |
|---|---|---|
| Encryption Start | ✅ Immediate — first byte | ⚠️ After initial plaintext handshake |
| Downgrade Attack Risk | ✅ Zero — impossible by design | ⚠️ Vulnerable on compromised networks |
| Connection Speed | ✅ Slightly faster — no upgrade step | Slightly slower — two-phase handshake |
| Modern Standard | ✅ IANA-assigned 2018 | Legacy assignment from 1998 |
| Mailcow Support | ✅ Full support | ✅ Full support |
| Old Corporate Firewall Compat | Sometimes blocked | ✅ More widely allowed |
| Credential Safety | ✅ Never exposed in plaintext | ⚠️ Brief plaintext window |
5. The One Scenario Where STARTTLS 587 is Still Correct
There is exactly one legitimate reason to use STARTTLS on port 587 in 2025: you are connecting from behind an old corporate or ISP firewall that actively blocks port 465.
Some enterprise networks, particularly in older industries like finance, government, and healthcare, have strict firewall rules that only allow outbound traffic on specific ports. If your IT department's firewall blocks 465 and you have no ability to change it, STARTTLS on 587 is your only option.
Port 2525 is a fallback that exists for exactly this reason — ISPs historically blocked both 25 and 465 on residential connections, so 2525 was added as an alternative submission port for STARTTLS. If you are on a consumer internet connection (not a business connection), port 2525 may work when 465 is blocked.
Outside of these specific corporate or ISP firewall scenarios, there is no technical justification for choosing STARTTLS over SSL/TLS on a modern mail server.
6. What This Means for Your Mailcow Setup
If you are running a private Mailcow server (like mail.sendmehi.com or any other self-hosted mail infrastructure), your configuration should be:
- SMTP Submission Port: 465
- Security Protocol: SSL/TLS (also called Implicit TLS)
- Authentication: Your full email address and mailbox password
Mailcow fully supports implicit TLS on port 465 out of the box. There is no configuration needed on the server side — it is enabled by default.
When connecting external apps (newsletter tools, CRM systems, autoresponders) to your Mailcow server via SMTP, always specify 465 with SSL/TLS as the security method. If the connection app gives you an error with 465, try toggling between "SSL/TLS" and "Implicit TLS" — they are the same thing, just named differently in different interfaces.
7. Checking Your Existing Configuration
If you want to verify that your current mail setup is using the strongest possible encryption, here is a quick PowerShell test you can run on any Windows machine:
Test-NetConnection -ComputerName mail.yourdomain.com -Port 465
If the result shows TcpTestSucceeded: True, your server is listening on 465 and ready to accept SSL/TLS connections. If it shows False, your server may only be configured for STARTTLS on 587, and you should check your Mailcow or server settings.
8. The Bottom Line for Developers and Business Owners
The SSL/TLS vs STARTTLS debate has a clear winner in 2025. SSL/TLS on port 465 is faster, more secure by design, immune to downgrade attacks, and the officially recognized modern standard.
The only reason to use STARTTLS on 587 or 2525 is if your specific network environment actively prevents port 465 connections. That is a network constraint, not a security preference.
For your private mail server, your newsletter tool, your CRM SMTP connection, and any other outbound email configuration: choose SSL/TLS on 465 every single time.
Frequently Asked Questions
Is port 465 or 587 more secure?
Port 465 with SSL/TLS is more secure. It establishes an encrypted tunnel before any data is sent, eliminating the STARTTLS downgrade attack vulnerability that exists with port 587.
Why do so many email tutorials recommend port 587?
Because most tutorials were written during the 20-year period (1998–2018) when port 465 was officially unassigned by the IANA. Port 587 was the official standard for that entire era. The IANA officially reassigned port 465 for implicit TLS in 2018, but most documentation has not caught up.
What is a STARTTLS downgrade attack?
A downgrade attack occurs when a Man-in-the-Middle intercepts the initial unencrypted connection of a STARTTLS session and removes the server's announcement that it supports TLS. The client, not seeing TLS as an option, falls back to sending credentials and email content in plaintext. This attack is impossible with SSL/TLS implicit connections.
What is the difference between SSL/TLS and Implicit TLS?
They are the same thing. Different email clients and SMTP configuration interfaces use these terms interchangeably. Both refer to an encrypted-from-the-start connection on port 465, as opposed to the upgrade-based STARTTLS model on port 587.
When should I use port 2525?
Port 2525 is a fallback port for STARTTLS connections when both port 25 and port 587 are blocked by a consumer ISP or corporate firewall. It offers no security advantage over 587 — use it only when 465 and 587 are both blocked.
RFC 8314 Explained: Why the IETF Reversed 20 Years of Port 587 Advice
Countless outdated blog tutorials and legacy hosting knowledge bases still warn developers that "port 465 is deprecated—always use STARTTLS on port 587." That guidance was briefly accurate in 1998 when the IETF initially favored opportunistic STARTTLS upgrades. However, two decades of real-world exploits—culminating in widespread ISP and hostile Wi-Fi STRIPTLS downgrade attacks—forced the IETF to publish RFC 8314 (Cleartext Considered Obsolete) in January 2018, formally reinstating port 465 (submissions) with Implicit TLS as the preferred submission standard for all modern mail clients and application libraries.
Under RFC 8314 Section 3.3, Implicit TLS on port 465 eliminates two entire classes of protocol vulnerability simultaneously: first, there is zero plaintext preamble where an attacker can inject plaintext commands (command-injection bugs like CVE-2011-0411 / STARTTLS buffer-smuggling flaws); second, a buggy SMTP client library can never silently fall back to sending AUTH PLAIN Base64 passwords in cleartext if a rogue firewall strips the 250-STARTTLS line from the server's EHLO response.
Live Diagnostic Verification: Testing Port 465 vs. Port 587 with OpenSSL
Systems engineers and developers should never assume a mail server enforces modern TLS 1.3 cipher suites. Verify both implicit TLS on port 465 and STARTTLS on port 587 directly from any Linux, macOS, or Windows WSL terminal using openssl s_client:
# Test Implicit SSL/TLS on Port 465 (TLS handshake occurs IMMEDIATELY)
openssl s_client -connect mail.yourdomain.com:465 -servername mail.yourdomain.com -brief
# Expected healthy output:
# Protocol version: TLSv1.3
# Ciphersuite: TLS_AES_256_GCM_SHA384
# Peer certificate: CN = mail.yourdomain.com
# Verification: OK
# Test STARTTLS upgrade on Port 587 (Cleartext EHLO precedes TLS)
openssl s_client -starttls smtp -connect mail.yourdomain.com:587 -servername mail.yourdomain.com -brief
Inspect two fields in the output: first, verify Protocol version negotiates TLSv1.3 (or at minimum TLSv1.2 with ECDHE forward secrecy—never TLS 1.0/1.1); second, confirm Verification: OK so strict clients like Python smtplib.SMTP_SSL, Go net/smtp, and Node.js Nodemailer never suffer certificate-chain rejections.
Hardened Postfix master.cf Configuration for Port 465 & Port 587
If you administer your own Postfix or Mailcow deployment, harden your submission listeners so unencrypted authentication is structurally impossible even if a user accidentally selects port 587 in Outlook or Thunderbird:
# /etc/postfix/master.cf — Hardened Port 465 (Implicit TLS) & Port 587 (Mandatory STARTTLS)
submissions inet n - y - - smtpd
-o syslog_name=postfix/submissions
-o smtpd_tls_wrappermode=yes
-o smtpd_tls_security_level=encrypt
-o smtpd_tls_mandatory_protocols=>=TLSv1.2
-o smtpd_sasl_auth_enable=yes
-o smtpd_reject_unlisted_recipient=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
submission inet n - y - - smtpd
-o syslog_name=postfix/submission
-o smtpd_tls_security_level=encrypt
-o smtpd_tls_auth_only=yes
-o smtpd_tls_mandatory_protocols=>=TLSv1.2
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
Notice the critical parameter smtpd_tls_wrappermode=yes on submissions (465) and smtpd_tls_security_level=encrypt + smtpd_tls_auth_only=yes on submission (587). Together, these settings guarantee Postfix rejects any authentication attempt on port 587 until an encrypted TLS tunnel is verified, while offering zero-round-trip implicit TLS on port 465 for maximum speed and security.
Nodemailer, Python & PHP Production Code Snippets for Port 465
When wiring backend transactional mailers to SendMeHi or Mailcow, configure implicit TLS explicitly (secure: true in Nodemailer or SMTP_SSL in Python) rather than relying on ambiguous auto-detection:
// Node.js (Nodemailer) — Implicit TLS 1.3 on Port 465
const transporter = nodemailer.createTransport({
host: 'mail.yourdomain.com',
port: 465,
secure: true, // true for implicit SSL/TLS (port 465); false for STARTTLS (587)
auth: { user: 'alerts@yourdomain.com', pass: process.env.SMTP_APP_PASS },
tls: { minVersion: 'TLSv1.2', rejectUnauthorized: true }
});
Port 25 vs. Port 465 vs. Port 587: Clearing Up Server-to-Server Confusion
A frequent engineering mistake is assuming that switching your mail client to implicit TLS on port 465 also replaces TCP port 25 across the internet. Those ports serve fundamentally distinct halves of the SMTP lifecycle:
- Port 465 & Port 587 (Mail Submission — MUA to MSA): Used exclusively when an authenticated user (Apple Mail, Outlook, Thunderbird, mobile webmail, or your backend SaaS application) submits a new outgoing message to your own mail server. Port 465 uses implicit TLS from packet one and is the modern RFC 8314 gold standard; port 587 uses explicit STARTTLS upgrades as a legacy fallback.
- Port 25 (Mail Relay — MTA to MTA): Used strictly for unauthenticated server-to-server delivery between external mail servers across the public internet (for example, your Mailcow server delivering to Gmail's MX servers). Because port 25 predates implicit TLS and still supports opportunistic STARTTLS, protecting server-to-server port 25 traffic against downgrade attacks requires publishing MTA-STS (RFC 8461) or DANE TLSA (RFC 7672) records in DNS.
Mobile & Desktop Client Configuration Cheat Sheet (SendMeHi / Mailcow)
When onboarding employees across iOS, Android, macOS, and Windows, distribute standardized implicit-TLS settings so nobody accidentally picks plaintext port 143 or opportunistic port 587:
- Incoming IMAP Server:
mail.yourdomain.com— Port993— Security: SSL/TLS (Implicit TLS 1.3) - Outgoing SMTP Server:
mail.yourdomain.com— Port465— Security: SSL/TLS (Implicit TLS 1.3) — Authentication: Normal Password / App-Specific Password - Verification Tip: In Outlook Classic or Thunderbird, explicitly disable "Allow insecure authentication" and verify the server hostname matches your SSL certificate's Subject Alternative Name (SAN) exactly—never connect via raw IP address, which forces certificate validation errors or dangerous TLS bypass prompts.
Combine hardened port 465 submission with enterprise SMTP security best practices and strict DKIM, SPF, and DMARC alignment to protect every stage of message transit from client device to recipient inbox.