Need help choosing hosting?Live chatSupport
Client Area
SMTP Windows Mailing VPS

Windows Firewall for SMTP Server: Which Ports Should You Allow?

Windows Firewall for SMTP Server: Learn which ports to allow for mail delivery, authenticated SMTP, IMAP, webmail, and secure RDP access.

By James RadyNovember 20, 20263 min readUpdated November 20, 2026

Configuring the Windows Firewall for SMTP server security helps protect mail software without interrupting legitimate delivery. Opening every port creates unnecessary exposure, while blocking the wrong connection can delay invoices, password resets, or incoming messages.

The correct rules depend on whether your Windows SMTP VPS only sends mail or also hosts inboxes.

Windows Firewall for SMTP Server: Ports to Allow

TCP PortPurposeWhen to Allow
25Server-to-server SMTPOutbound for direct delivery; inbound when receiving mail
587SMTP submission with STARTTLSInbound if clients submit mail
465SMTP submission with implicit TLSInbound if supported and used
993Secure IMAP mailbox accessInbound only when hosting IMAP
995Secure POP3 mailbox accessInbound only when offering POP3
443HTTPS webmail or administrationInbound only for required web services
3389Remote DesktopRestrict to a VPN or trusted admin IPs

These ports use TCP. Do not open IMAP, POP3, or webmail ports on an outgoing-only SMTP relay.

1. Configure Port 25 Correctly

For direct delivery to recipient mail exchangers, your server normally needs outbound TCP 25.

Allow inbound Port 25 only if your server receives mail from other SMTP servers. Opening the port is not enough: configure relay restrictions so unauthorized senders cannot forward messages through your system.

2. Secure SMTP Submission

If applications or email clients connect to your Windows mail server, use Port 587 with required STARTTLS or Port 465 with implicit TLS.

Require authentication and valid TLS certificates. You do not need both submission ports unless your software or clients use both.

3. Restrict RDP and Administration

Avoid exposing RDP to every internet address. Prefer VPN access or permit only known administrator IPs.

Keep management dashboards limited to trusted networks where practical. Before modifying RDP firewall rules, confirm you have working console access to avoid locking yourself out.

4. Create and Verify Firewall Rules

Open Windows Defender Firewall with Advanced Security, select Inbound Rules → New Rule → Port, and allow the necessary TCP ports for your installed services.

Specify network profiles and remote IP scope. Review existing rules because an older broad allow rule can defeat a newly added restriction.

Microsoft’s official Windows Firewall rules guidance explains rule scope and security practices.

Windows generally allows outbound traffic unless a rule blocks it. If you enforce outbound restrictions, remember DNS and other essential server connections.

To test external SMTP connectivity in PowerShell, run:

Test-NetConnection gmail-smtp-in.l.google.com -Port 25

A successful test checks TCP connectivity, not whether messages will reach an inbox.

Choosing a Windows SMTP VPS

VeltrixHost Windows SMTP VPS Hosting provides Administrator/RDP access, Port 25 availability, and PTR/rDNS controls for self-managed servers.

Configure Windows Firewall to match MailEnable, SmarterMail, or your chosen application.

Final Recommendation

For Windows Firewall for SMTP server setups, permit only necessary mail traffic, isolate RDP, and verify both inbound and outbound connectivity. Recheck rules after software changes.

FAQs

Is outbound Port 25 enough for an SMTP relay?

For direct delivery it is essential, but DNS resolution and other supporting connections also matter.

Should I open both Ports 465 and 587?

Only when your mail software and clients need both.

Does opening Port 25 create an open relay?

No. An open relay results from incorrect mail-server authorization rules.

Written by

James Rady

VeltrixHost editorial team publishing practical hosting, VPS, dedicated server, email infrastructure and performance guidance.