Port 143 (IMAP)
Key facts
- Port
- 143
- Protocols
- TCP
- Range
- System port (Well-Known), 0-1023
- IANA service name
- imap
IANA assigns ports in this range to well-known services, under RFC 6335.
About port 143
Port 143 is the default port of IMAP (Internet Message Access Protocol), the protocol email clients and phones use to read and manage a mailbox stored on the server, over TCP. The connection on port 143 starts unencrypted and switches to an encrypted connection with the STARTTLS command.
IMAP is defined in RFC 9051 (and its previous version in RFC 3501), and IANA registers TCP port 143 for the imap service.
What port 143 is used for
- Sync across devices: with IMAP, messages stay on the server, so your computer, phone, and webmail show the same mailbox, including folders and read messages.
- Managing folders on the server: folders, flags, and deletions you make in your email client are saved on the server and appear on all your devices.
- Mailbox migration: mailbox migration tools connect to the old server and the new server over IMAP, and copy the messages and folders.
For a connection that's encrypted from the start, use port 993, which is the recommended setting today. Sending mail uses SMTP, on port 465 or port 587.
Port 143 in the firewall
On a mail server that serves users over IMAP with STARTTLS, open port 143 to incoming traffic. When all users connect on port 993, you can keep port 143 closed in the firewall.
- UFW:
ufw allow 143/tcp - firewalld:
firewall-cmd --permanent --add-service=imap
A server that isn't a mail server doesn't need port 143 open.
Risks and security
On port 143, encryption depends on the STARTTLS command. An email client set up without encryption may send the password as plain text, so it's important that the server allows login only after switching to an encrypted connection. RFC 8314 recommends preferring port 993, where the connection is encrypted from the start.
- Configure the mail server to allow password login only over an encrypted connection.
- Use strong, unique passwords for mailboxes.
- Temporarily block addresses that make repeated failed login attempts, for example with fail2ban.
- Set up a valid SSL certificate for the server name clients connect to.
Commands to check and configure
-
ss -tlnp | grep ':143 'Checks whether the IMAP server is listening on port 143.
-
nc -zv mail.example.com 143Checks whether port 143 on the mail server is open and reachable from your computer.
-
openssl s_client -connect mail.example.com:143 -starttls imapChecks that the server supports STARTTLS on port 143, and shows its certificate details.
-
curl -v --ssl-reqd --user name@example.com imap://mail.example.com/Connects to the mailbox over a connection that must be encrypted, and lists its folders. The password is prompted for separately.
-
ufw allow 143/tcpOpens port 143 to incoming traffic (UFW).
-
firewall-cmd --permanent --add-service=imapOpens port 143 to incoming traffic in firewalld. Then run firewall-cmd --reload.
Port 143 in the IANA registry
| Port | Protocol | Service | IANA registry description |
|---|---|---|---|
| 143 | TCP | imap | Internet Message Access Protocol |
| 143 | UDP | Reserved | Reserved |
Data source: IANA Service Name and Transport Protocol Port Number Registry (opens in a new tab)
Port 143 FAQ
What's the difference between port 143 and port 993?
Both ports are used for IMAP. On port 143, the connection starts unencrypted and switches to an encrypted connection with STARTTLS, while on port 993 the connection is encrypted from the very first moment. When the server supports both, we recommend choosing port 993.
Which security setting do I choose in my email client for port 143?
Choose STARTTLS. The SSL/TLS setting is for port 993, so combining port 143 with SSL/TLS makes the connection fail.
Can I read the same mailbox on my computer and my phone?
Yes, and that's the main advantage of IMAP. Messages and folders are stored on the server, and every device set up with IMAP shows the same mailbox. A message you read or delete on your phone shows up that way on your computer too.
Why does my email client show a certificate warning when connecting?
In most cases, the server name set in your email client doesn't appear in the server's SSL certificate. In your email client, set the exact server name that appears in the certificate, as listed in the account details you received. The Common browser SSL errors page explains other common errors.