Common attacks and weaknesses
- Open relays used to send spam and phishing.
- User enumeration with VRFY and EXPN.
- Spoofed senders when SPF, DKIM and DMARC are missing.
Server-to-server email delivery. Supports STARTTLS, which is opportunistic unless MTA-STS or DANE is used.
Mail servers hand messages to each other over port 25, one hop at a time, until the recipient's server. Encryption is optional: it only happens if both sides negotiate TLS (STARTTLS).
| Service | Port | Transport | Description | Reference | Updated |
|---|---|---|---|---|---|
| smtp | 25 | TCP, UDP | Simple Mail Transfer | RFC-ietf-emailcore-rfc5321bis-43 | 2017-06-05 |
// source: IANA service name and port number registry
Linux
sudo ss -ltnup 'sport = :25' # process listening on 25
sudo lsof -nP -i :25macOS
sudo lsof -nP -i :25
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 25 -State Listen | Select LocalAddress, OwningProcess Get-NetUDPEndpoint -LocalPort 25 netstat -ano | findstr :25
From another machine
nmap -p 25 -sV <host> sudo nmap -sU -p 25 <host> nc -zv <host> 25
Block it in the firewall
sudo ufw deny 25/tcp # Linux (ufw) New-NetFirewallRule -DisplayName "Block 25" -Direction Inbound -LocalPort 25 -Protocol TCP -Action Block # Windows
Server-to-server email delivery. Supports STARTTLS, which is opportunistic unless MTA-STS or DANE is used.
Port 25 is registered for TCP and UDP. In practice the service mostly uses TCP.
It is rated 4/10 (moderate) when exposed to the Internet. Open relays used to send spam and phishing. Refuse relaying for unauthenticated clients.
On Linux run "ss -ltnup 'sport = :25'", on macOS "lsof -nP -i :25", and on Windows "netstat -ano | findstr :25" to see the local process. From another machine, "nmap -p 25 <host>" shows whether it is reachable.