TCP port
Port 25: SMTP
TCP port 25 is SMTP between mail servers: the sending server finds the receiving one through the domain's MX record and connects to its port 25.
- A mail program hands new mail to its own server on port 587 (message submission), usually after logging in.
- SMTP does not prove who the sender is: SPF, DKIM and DMARC were added for that.
Check port 25 on Linux
Put the server's name or address in place of HOST.
ss -tlnp 'sport = :25'- On the server: is a program listening on TCP port 25, on which address, and which program? How to read ss.
nc -zv HOST 25- From a client: does a TCP connection to port 25 open, get refused, or time out? How to read nc.
tcpdump -ni any tcp port 25- On either end: the packets to and from TCP port 25, as they cross the card. How to read tcpdump.
nmap -p 25 HOST- From outside: is TCP port 25 open, closed or filtered? How to read nmap.
What runs on it
- SMTP
- How mail moves: from a client to its own mail server, then from server to server, found by the domain's MX record.
- SPF, DKIM and DMARC
- Three DNS-published policies that let a receiving mail server check that a message really comes from the domain it claims.
- DNS records
- The typed entries of a zone: A for an address, CNAME for an alias, NS for delegation, and more.
Use port 25 on real machines
Open Email: where a message goes after you press Send