---
title: "Connection to mail over SSL fails"
date: "2016-10-26"
category: "email"
slug: "connection-mail-ssl-fails"
---

## Overview

IMAP, POP3, and SMTP connections over SSL (STARTTLS on ports 143/110/587 or implicit SSL on ports 993/995/465) may fail with a certificate warning. This typically manifests as a security exception dialog in your mail client.

![SSL certificate rejection on initial connection](kb-image:ssl-mismatch.png)
*SSL certificate rejection on initial connection*

![SSL certificate mismatch inspection after clicking "View" in the "Add Security Exception" dialog](kb-image:ssl-mismatch-x509.png)
*SSL certificate mismatch inspection after clicking "View" in the "Add Security Exception" dialog*

## Cause

Modern mail clients require that the **mail server hostname match a name in the SSL certificate's Subject Alternative Name (SAN) extension**. If your configured mail server name (e.g., `mail.yourdomain.com`) does not appear in the server's SSL certificate, a warning is generated.

## Solution

Change your mail server name -- both incoming and outgoing -- to the [[what-is-my-server-name]] on which your account is hosted. For example, change `mail.futz.net` to `luna.apnscp.com`.

### Thunderbird

See [KB: Manual Account Configuration](https://support.mozilla.org/en-US/kb/manual-account-configuration)

### Outlook

See [KB: Change email account-settings](https://support.office.com/en-us/article/Change-email-account-settings-58b62e89-6a9b-467b-8865-d5633fcacc3f)
