Port 143 is IMAP, which mail clients use to read and manage messages on the server. It starts unencrypted and can upgrade with STARTTLS; the encrypted-from-the-start version is on port 993. It should not be reachable from the public internet.
- Port
- 143
- Protocol
- TCP
- Service
- IMAP
- Expose to internet?
- No
- Also used by
- Dovecot, Courier, Microsoft Exchange
Is port 143 safe to open?
If STARTTLS is optional, clients can log in over plain text and expose the mailbox password. IMAP is a frequent target for password spraying because a successful login gives full access to the mailbox. Port 993 with TLS is the safer default.
How to secure IMAP
- Offer IMAP on 993 with TLS and close 143 if your clients allow it.
- If you keep 143, require STARTTLS before authentication (Dovecot
ssl = required). - Block repeated login failures with fail2ban.
- Enable app passwords or OAuth where the mail platform supports it.
Check if port 143 is open
Linux: what is listening on this port
sudo ss -tlpn | grep ':143 'Windows (PowerShell): what is listening
Get-NetTCPConnection -LocalPort 143 -State Listen | Select-Object LocalAddress, OwningProcess, @{n='Process';e={(Get-Process -Id $_.OwningProcess).Name}}From another machine: is it reachable
nc -zv HOST 143
# or
nmap -p 143 HOST
# Windows
Test-NetConnection HOST -Port 143Test the IMAP service itself
openssl s_client -starttls imap -connect HOST:143Restrict port 143 in the firewall
Replace 10.0.0.0/8 with the network or address that needs access. Docker publishes container ports through its own iptables rules, which bypass ufw; bind published ports to 127.0.0.1 (-p 127.0.0.1:143:143) instead of relying on the host firewall.
ufw: allow only your private network, deny everyone else
sudo ufw allow from 10.0.0.0/8 to any port 143 proto tcp
sudo ufw deny 143/tcpfirewalld: allow one source network only
sudo firewall-cmd --permanent --remove-port=143/tcp
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/8" port port="143" protocol="tcp" accept'
sudo firewall-cmd --reloadiptables
sudo iptables -A INPUT -p tcp --dport 143 -s 10.0.0.0/8 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 143 -j DROPWindows Firewall (PowerShell, as Administrator)
New-NetFirewallRule -DisplayName "Block 143 from internet" -Direction Inbound -Protocol TCP -LocalPort 143 -RemoteAddress Internet -Action BlockMonitor port 143
Run a TCP port monitor against your public IP on port 143: here, a failed connection is the healthy result, so you know the firewall is still doing its job. On Linux, the Statance agent also reports every listening port on the server. TCP port monitoring.
Related ports
FAQ
What is port 143 used for?
Port 143 is IMAP, which mail clients use to read and manage messages on the server. It starts unencrypted and can upgrade with STARTTLS; the encrypted-from-the-start version is on port 993. It is also used by Dovecot, Courier, Microsoft Exchange.
Is it safe to open port 143?
Not to the public internet. If STARTTLS is optional, clients can log in over plain text and expose the mailbox password. IMAP is a frequent target for password spraying because a successful login gives full access to the mailbox. Port 993 with TLS is the safer default.
Is port 143 TCP or UDP?
IMAP uses TCP on port 143.
How do I check if port 143 is open?
On the server, run sudo ss -tulpn | grep ':143 ' (Linux) or Get-NetTCPConnection -LocalPort 143 (Windows) to see what is listening. From another machine, run nc -zv HOST 143 or Test-NetConnection HOST -Port 143.
Know the moment a port stops answering.
TCP, HTTP, DNS and SSL checks from six regions, plus server metrics from a one-line agent.