HTTPfy

Port 25 (SMTP)

Server-to-server mail transfer. Mail servers deliver to each other's MX hosts on port 25, upgrading to TLS with STARTTLS when both support it.

Well-known (system) port, 0-1023 TCP Email Meant to face the internet

What port 25 is used for

Server-to-server mail transfer. Mail servers deliver to each other's MX hosts on port 25, upgrading to TLS with STARTTLS when both support it.

Security: should port 25 be open?

Meant to face the internet. An MX host must accept port 25 from the internet. Never run an open relay: only accept mail for your own domains or from authenticated users. Most residential ISPs and many clouds block outbound 25 to stop spam bots, so clients should submit on 587 or 465 instead.

IANA assignment

Service nameProtoDescriptionAssigneeReference
smtp TCP Simple Mail Transfer IESG RFC-ietf-emailcore-rfc5321bis-43
smtp UDP Simple Mail Transfer IESG RFC-ietf-emailcore-rfc5321bis-43

Registry dates for this port: last modified 2017-06-05.

Check what is listening on port 25

Linux: is anything listening on TCP 25?
sudo ss -tlnp 'sport = :25'
Linux / macOS: which process owns the port
sudo lsof -nP -i :25
Older Linux / BSD (net-tools)
sudo netstat -tlnp | grep ':25 '
Windows (Command Prompt)
netstat -ano | findstr :25
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 25 -State Listen | Select LocalAddress,OwningProcess

Test it from outside

From another machine
nc -vz -w 5 HOST 25
From Windows
Test-NetConnection HOST -Port 25

Open port 25 in the firewall

ufw
sudo ufw allow 25/tcp
iptables
sudo iptables -A INPUT -p tcp --dport 25 -j ACCEPT
nftables
sudo nft add rule inet filter input tcp dport 25 accept
Windows Firewall
New-NetFirewallRule -DisplayName 'Allow TCP 25' -Direction Inbound -Protocol TCP -LocalPort 25 -Action Allow

Related ports

All port numbers · Open port checker
Assignment data: IANA port number registry (public domain), retrieved 2026-11-10.