TCP · Port 25IANA Registered

Port 25 — SMTP (Simple Mail Transfer Protocol)

Standard protocol for MTA-to-MTA (Mail Transfer Agent) email routing and relay across the internet.

⚡ Primary Use Cases & Environments

  • ✓Server-to-server email delivery
  • ✓Mail exchange (MX) message routing

🛡️ Security & Vulnerability Analysis

Most residential ISPs and cloud providers (AWS, GCP, DigitalOcean) block outbound port 25 to prevent spam bots. Email submission from clients should use port 587 with STARTTLS instead.

🔧 Network Diagnostics & Inspection

1. Check Active Listening Sockets (Local Host)
Terminal Command
$ sudo ss -tuln | grep :25
Inspects whether any local process daemon is bound to port 25.
2. Remote Port & Service Scan (Nmap)
Terminal Command
$ nmap -p 25 -sV --script smtp-commands <target-ip>
Probes target IP to determine whether port 25 is open, closed, or filtered.
3. Wireshark Capture / Display Filter
tcp.port == 25Wireshark Filter

🔥 Firewall Configuration Rules (UFW & iptables)

UFW (Uncomplicated Firewall)
Terminal Command
$ sudo ufw allow 25/tcp
Applies a persistent Linux UFW firewall rule for port 25.
iptables Command
Terminal Command
$ sudo iptables -A INPUT -p tcp --dport 25 -j ACCEPT
Appends a direct netfilter kernel rule to the INPUT chain for port 25.

❓ Frequently Asked Questions (FAQ)

Why can’t I send email from port 25 on my VPS?

Cloud providers block outbound port 25 by default to protect their IP reputation against spam. You must request unblocking or use an SMTP relay like SendGrid, Mailgun, or Postmark.

What is the difference between port 25 and port 587?

Port 25 is for server-to-server mail relays. Port 587 is the standard submission port for authenticated email clients sending email to their outgoing mail server.

Related Networking Tools & Guides