i have a Netgear Nighthawk router, and it connect to the email server, how do i setup the port forwarding?

In your situation, it’s generally not recommended to set up port forwarding for email directly on your Netgear Nighthawk router. Here’s why:

  • PfSense Firewall: Since you’re already using PfSense as your firewall, it offers more granular control and security features for port forwarding compared to a typical consumer router like the Netgear Nighthawk.
  • Email Server Location: If your email server isn’t running on the same network behind your Netgear router (e.g., it’s hosted externally), forwarding ports on the Netgear router wouldn’t be the right approach.

Here’s a better approach depending on your email server location:

Scenario 1: Email Server on Your Network (e.g., Ubuntu Server with Virtualmin)

  1. Focus on PfSense Port Forwarding: Configure the necessary port forwarding rules in PfSense to direct email traffic (IMAP, POP3, SMTP) to your Ubuntu server’s local IP address. Refer to the previous guide’s instructions for PfSense port forwarding.
  2. Virtualmin Server Configuration: Double-check your Virtualmin email server settings to ensure they match the ports you forwarded in PfSense. This ensures proper communication between email protocols and your server.

Scenario 2: Email Server Hosted Externally

You typically wouldn’t need to configure port forwarding on your router for an externally hosted email server. Your email client (e.g., Outlook, Thunderbird) should be able to connect to the server’s public IP address using the standard ports for the email protocol (IMAP, POP3, SMTP).

Additional Tips:

  • Use Secure Ports: When forwarding email ports in PfSense (if applicable), prioritize secure alternatives like port 587 for SMTP with TLS and port 993 for IMAP with SSL/TLS.
  • Firewall Rules on Netgear Router (Optional): If your Netgear Nighthawk router still has a built-in firewall, consider disabling it to avoid conflicts with PfSense’s firewall rules. However, this is only recommended if PfSense is managing all your network security.
  • Consult Documentation: Refer to the documentation for your specific PfSense version and Virtualmin (if applicable) for detailed configuration steps related to email server settings.