Table of Contents
What you will read?
Port 587 is commonly used for secure email submission via SMTP. Ensuring it is open is crucial for sending emails through your mail server. This guide provides different methods to check if port 587 is open on your Ubuntu server.
Using Netcat (nc)
Netcat is a simple way to check if port 587 is open. Run:
nc -zv mail.example.com 587
If the port is open, you’ll see a successful connection message.
Using Telnet
Telnet can also check if the port is open:
telnet mail.example.com 587
If the connection is successful, the port is open.
Using Nmap
Nmap provides a detailed scan of open ports:
sudo apt install nmap # Install if not available
nmap -p 587 mail.example.com
It will indicate if port 587 is open or filtered.
Using ss Command
To check if your Ubuntu server is listening on port 587:
ss -tln | grep 587
If you see output, the port is open locally.
Using netstat (For Older Systems)
netstat -tulnp | grep 587
If the port is open, it will show a process using it.
Checking Firewall Rules
Ensure Ubuntu’s firewall allows traffic on port 587:
sudo ufw status | grep 587
If not allowed, enable it with:
sudo ufw allow 587/tcp
