Network Configuration: Firewall Setup for Optimized Performance
Published June 8, 2024 · Updated August 10, 2026 · Guides & Tutorials
Network configuration is the unglamorous foundation of a fast, secure email service. Proper firewall setup in particular keeps your sending infrastructure protected and performing at its best. Here is why network and firewall configuration matters for email.
Why firewall setup matters
- Security - blocks unauthorised access to your mail servers.
- Performance - open the right ports (587, 465) so mail flows without bottlenecks.
- Abuse prevention - stops your infrastructure being hijacked as an open relay.
- Reliability - well-tuned rules keep legitimate traffic fast.
Key configuration principles
- Allow only the ports your services need.
- Restrict administrative access to trusted IPs.
- Rate-limit connections to blunt abuse and attacks.
- Monitor and log traffic for anomalies.
A basic firewall rule set for a mail server
At minimum: allow inbound on 587 and 465 for authenticated submission, allow 25 only if the server needs to receive mail (not just send), restrict SSH and any admin panel to a specific trusted IP range rather than leaving it open to the world, and deny everything else by default rather than trying to block a list of "bad" ports.
Misconfigurations that specifically break email
The most common ones: a firewall blocking outbound port 587 (so your own server cannot reach the relay), reverse DNS (PTR record) not matching the server's hostname, which many receiving servers treat as a spam signal, and rate-limiting rules set too aggressively, which throttles legitimate high-volume sending along with the abuse they were meant to stop.
Testing your firewall rules before relying on them
After configuring rules, verify from outside your network (not just locally) that only the intended ports respond — a rule that looks correct in the config file can still be undone by an earlier, broader rule taking precedence.
Revisit your firewall configuration whenever you add a new service to your server — new ports opened for a new tool are easy to forget about later.
Related reading: Dynamic DNS Registration · SMTP Server Setup and Configuration: Ensuring Seamless Email Integration · free email toolsUnlimited email on a dedicated SMTP
Dedicated IP, no caps, automatic SPF/DKIM/DMARC - live in minutes. From $39.99/mo, cancel anytime.
Frequently asked questions
Why is firewall setup important for email servers?
It secures your mail infrastructure, opens only the ports you need for performance, and prevents abuse that could blacklist your sending IP.
Which ports does email use?
587 and 465 for authenticated SMTP submission, 25 for server-to-server delivery. Open only what you need.