Use this when securing SMTP submission and server-to-server mail.
SMTP Security
SMTP security covers authenticated submission on port 587 with TLS, preventing open relays, TLS between mail servers, MTA-STS and DANE to enforce it, and rate limits against abuse.
client → submission (auth, TLS) → MTA → MX
Context & applicabilityCommon mistakes · platform/version boundaries
- Port 25 used for client submission instead of 587/465 with authentication.
- Open relay after a misconfiguration (test from outside after every change).
- STARTTLS offered with a self-signed or expired certificate.
- No rate limiting on authenticated submission — compromised accounts send spam at volume.
Operational reference
Fast context before you go deeper.
openssl s_client -starttls smtp -connect mail.example.com:25 -crlfVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Testing a mail server Verify boundary
openssl s_client -starttls smtp -connect mail.example.com:25 -crlf
swaks --to test@example.com --server mail.example.com --tls
Check the certificate, supported TLS versions, that the server is not an open relay (rejects mail for foreign domains from foreign senders), and that SMTP AUTH is only offered after STARTTLS.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Use authenticated submission on port 587 with TLS.
- Never run an open relay.
- Enforce TLS with MTA-STS or DANE.
openssl s_client -starttls smtp -connect <mx>:25— TLS on SMTPswaks --to user@<domain> --server <mx>— test delivery- Open relay test — closed
ReferenceWhy it matters1 section · depth on demand
Ports and settings
| Port | Use |
|---|---|
| 25 | Server-to-server (MX), STARTTLS opportunistic |
| 587 | Client submission with STARTTLS and authentication |
| 465 | Client submission with implicit TLS |
Server settings: no open relay (only authenticated users or known networks may relay), TLS 1.2+, rate limits per user to contain compromised accounts. Test relay with swaks --to x@external.com --server mx.example.com.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
SMTP security protects email in transit between servers and the infrastructure that handles it. Classic SMTP was designed without encryption or sender authentication, so several extensions were added.
| Mechanism | Protects |
|---|---|
| STARTTLS | Opportunistic encryption between servers |
| MTA-STS / DANE | Enforce TLS and authenticate receiving servers |
| TLS-RPT | Reports on TLS failures |
| SMTP AUTH over TLS | Client submission (port 587/465) |
| SPF, DKIM, DMARC | Sender authentication |
| Relay restrictions | No open relays |
openssl s_client -starttls smtp -connect mx.example.com:25 -servername mx.example.com </dev/null | head
Restrict outbound port 25 from clients so only mail servers send email, which limits spam from infected devices.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Email Security → SMTP Security. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc7489 · confidence 94%