Test a Mail Server's TLS with openssl s_client
Handshake with SMTP/IMAP servers over STARTTLS or implicit TLS and inspect the certificate chain interactively.
01Command
$ openssl s_client -starttls smtp -connect smtp.example.com:587 -brief02What it does
For submission/port 587 and imap 143, mail servers start in plaintext and upgrade with STARTTLS, which -starttls smtp (or imap/pop3) negotiates before the handshake; for implicit TLS ports like 465 or 993, drop the -starttls flag. -brief condenses the output to the negotiated protocol, cipher and server certificate subject/issuer, while the full output lets you verify expiration with the dates shown in the certificate block. 'Verify return code: 0 (ok)' at the end is the quick pass/fail signal.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- openssl s_client(1) — SSL/TLS client programEvidence: Man page documents the -starttls option with the smtp protocol value, -connect host:port, and -brief; confirms 's_client' and 'starttls' appear in the text.
- openssl-s_client(1ssl) — Debian man pageEvidence: Man page text includes -starttls with protocol values smtp/pop3/imap and -brief option, confirming the flags used.
Last verified: 2026-09-19 · Category: Security & Privacy
06Related solutions
Launch an interactive process viewer with color meters for CPU cores, memory, and swap, plus search, sort, and kill controls.
Show total, used, and available space plus usage percentage for every mounted filesystem in human-readable units.
The classic forgotten-syntax command: `traceroute` shows every router between you and a destination plus the round-trip time of probes to each hop.