↑ ↓ select, Enter open, Esc close

Test an SMTP connection with STARTTLS and certificate

Adjust the values, the command updates live
user@server
openssl s_client -connect mail.example.com:587 -starttls smtp -servername mail.example.com

Connects to the mail server’s submission port, switches to encryption via STARTTLS and prints the certificate chain, validity and negotiated cipher. Useful when mail clients show certificate warnings or sending fails at the TLS handshake. Exit with QUIT or Ctrl+C.

Note: For port 25 the command stays the same, for IMAP the variant is -connect mail.example.com:143 -starttls imap.

Also searched as

  • check mail server certificate
  • outlook certificate error when sending
  • starttls not working

Related one-liners

All in Mail

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.