# A mail client cannot connect with its security settings

UrbeStack sysadmin note about Dovecot. Last updated 30 Nov 2026.

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

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.

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.
```

Check that SMTP answers with STARTTLS on port `587`.

```
openssl s_client -starttls smtp -connect mail.example.com:587 -quiet
```

Type `EHLO test`. The server answers with lines that start with `250`. The first line includes the server's name. Then type `QUIT`.

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.

If the problem persists after you follow this note, you can [open a support ticket](https://support.urbestack.com/new?type=support). Including the output of the commands you ran helps support diagnose the problem.
