What is port 587 used for?
Email submission from mail clients and apps, upgraded to TLS with STARTTLS.
Should port 587 be open?
Usually open to the internet. This port is meant to be reachable publicly on servers that offer the service. This is the port apps and email clients should use to send mail through a provider. It requires a username and password or API key.
See what is listening on port 587
# Linux
sudo ss -tlnp | grep ':587 '
# macOS
sudo lsof -nP -i TCP:587 -sTCP:LISTEN
# Windows (PowerShell)
Get-NetTCPConnection -LocalPort 587 -State Listen
Open or block port 587 in a firewall
# Ubuntu / Debian (ufw)
sudo ufw allow 587/tcp
sudo ufw deny 587/tcp
# Windows (PowerShell, as administrator)
New-NetFirewallRule -DisplayName "Port 587" -Direction Inbound -Protocol TCP -LocalPort 587 -Action Allow
On cloud servers, also open the port in the provider’s security group or network firewall. At home, a service behind a router needs a port-forwarding rule to the device’s local IP.
Test it from outside
A port can be open on the server but blocked upstream. The Port Checker connects from the internet, so it shows what the world sees. From your own machine, use nc -vz example.com 587 (macOS/Linux) or Test-NetConnection example.com -Port 587 (Windows).