Skip to content
Look up and open a port

Port 25: Understand and open the SMTP port for mail servers

Port 25 (TCP) is the traditional SMTP port used to deliver emails between mail servers. The tool shows you the key details and generates suitable firewall commands.

Built by Justin Schuessler

Try the commands on your own VPS, with root access and your own firewall.

Add multiple ports one at a time, up to 12.

Or choose a preset

Ports

25/TCPSMTP

Email · Well-known port · OSI layer 7

Mail delivery between mail servers. Inbound access is only needed on a real mail server listed in the MX record.

IANA: officially registered as smtp

Firewall rule (inbound)

Firewall commands

Open port

sudo ufw allow 25/tcp
Check port
Notes on ufw

For Ubuntu and Debian. ufw creates the rule for both IPv4 and IPv6. If ufw is disabled, allow SSH first (sudo ufw allow 22/tcp), then enable it with sudo ufw enable, or you'll lock yourself out.

On a ZAP-Hosting VPS with an active network firewall, you also need to allow the port in the Customer Panel.

Port 25 explained

What is port 25 used for?

Purpose

On port 25, a mail server receives emails from other mail servers and delivers its own emails to them. The DNS MX record identifies the server responsible for a domain. Port 25 is no longer intended for sending email from an email client; use port 587 or port 465 instead. You only need inbound port 25 if you run a mail server, for example with Postfix or Exim.

Origin and standard

SMTP was described in RFC 821 in 1982 and is one of the oldest internet protocols. The current specification is RFC 5321. IANA lists port 25 as “smtp”. SMTP originally ran without encryption; today, servers can upgrade the connection to TLS using STARTTLS.

Typical use

  • Receiving emails on a mail server listed in the MX record
  • Delivery of outgoing emails from your mail server to other mail servers
  • Forwarding between internal mail systems, such as a spam filter and mailbox server

Security

The biggest risk with port 25 is an open relay: a misconfigured server forwards mail from any sender, is quickly abused to send spam, and ends up on blocklists. Only allow relaying for authenticated users and your own networks. Many hosting providers and ISPs block outgoing traffic on port 25 to prevent spam from compromised systems. For your own mail server, you also need correct DNS records such as MX, SPF, DKIM, and DMARC, as well as a suitable reverse DNS record.

More ports

Related ports

These ports are often part of the same setup. Click one to see its explanation and firewall commands.

View all well-known ports and the complete IANA list

Port list source: IANA Service Name and Transport Protocol Port Number Registry, as of October 22, 2026. iana.org

Discover more

More tools

FAQ

Frequently asked questions

Quick answers about port 25.

With ufw, sudo ufw allow 25/tcp is enough. With firewalld, run sudo firewall-cmd --permanent --add-port=25/tcp followed by sudo firewall-cmd --reload. Only open the port for incoming traffic if the server actually runs a mail server that accepts mail for your domain.

Many hosting providers and ISPs block outgoing connections on port 25 to prevent spam from compromised computers. For sending email from clients and applications, use port 587 or 465 with authentication instead. To run your own mail server, you usually need to request that your provider unblock the port.

No. Mail clients such as Outlook or Thunderbird send mail through port 587 or 465 using a username and password. Port 25 is intended for mail exchange between mail servers.

An open relay is a mail server that forwards emails from any sender to any recipient. Spammers find these servers quickly, and your IP ends up on blocklists. Test your configuration after every change.

Any more questions?

Contact Support
Your own server?

Try the commands on your own VPS

With a ZAP-Hosting VPS, you have root access, can set up services and firewall rules yourself, and can immediately see which ports are open.

4.4/5 Trustpilot32,000+ Active serversSince 2010

No setup. No risk. Online in seconds.

Flexible TermCancel anytimeOnline in 60 seconds

Looking for more tools? View all network tools