Get your free beta license ↗
Mail · Dovecot

A mail client cannot connect with its security settings

Last updated 30 Nov 2026
Summary

A mail client fails to connect or sign in when its port and encryption settings differ from what the server offers. Dovecot and Postfix accept mail logins only over TLS, so use one of the port and encryption pairs below.

Symptoms

The mail client fails to connect, times out, or reports that the server lacks support for the selected connection security. Sending mail fails with an authentication error, or the client reports that the server lacks support for authentication.

Cause

The server accepts mail logins only over an encrypted connection. Use these port and encryption pairs.

  • For IMAP, use port 993 with SSL/TLS or port 143 with STARTTLS.
  • For POP3, use port 995 with SSL/TLS or port 110 with STARTTLS.
  • For sending mail, use port 465 with SSL/TLS or port 587 with STARTTLS. Port 587 offers authentication only after STARTTLS.

Port 25 is reserved for mail between servers. The username is always the full email address.

Resolution

  1. Set the mail client to one of the port and encryption pairs above for each protocol it uses. Enter the full email address as the username and enable authentication for sending mail.

  2. Check that IMAP answers over TLS.

    openssl s_client -connect mail.example.com:993 -quiet
    Output
    * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
  3. Check that SMTP answers with STARTTLS on port 587.

    openssl s_client -starttls smtp -connect mail.example.com:587 -quiet
  4. Type EHLO test. The server answers with lines that start with 250. The first line includes the server's name. Then type QUIT.

  5. If a port answers when you check it from the server and times out when you check it from outside, a firewall between the two blocks the connection.