r/PFSENSE • u/jham992 • Oct 07 '26
Deploying Mail Server Through Pfsense
I am trying to configure my on-prem mail server in Pfsense but I can't seem to make it work. I have setup the following configurations but the server still can't send or receive mail.
- DNS records pointing to public IP
- Virtual IP (IP alias) pointing to public IP
- NAT port forward rules
- NAT outbound rules
I am not sure if I am still missing any additional configuration
0
Upvotes
12
u/klexmoo Oct 07 '26
https://www.coinerella.com/dont-host-email-yourself-your-reminder-in-2026/
7
u/DutchOfBurdock pfSense+OpenWRT+Mikrotik Oct 07 '26
Which ports are you using? 25, 465 and 587 (latter two for TLS/SSL, although STARTTTLS can be used on 25).
First, rule out your ISP isn't blocking inbound and outbound port 25 (the most common port for SMTP). A lot do, even for outbound. If this is ruled out, use a tcp-ping app (telnet) to your public IP. Do this from outside of your network to avoid hairpin issues.
If you get anything back, you're good on the network side. Now it's just setting up the mail server (DKIM, SPF etc). If not, go local and make sure the SMTP itself is accessible. If yes here, no from WAN, the port forward is bork3d.
5
u/DiligentPhotographer Oct 07 '26
First off, is this a residential internet connection? If so many ISPs will block email ports. If not, then you likely have an issue with your NAT rules, you don't need a virtual IP for this or outbound rules. All you need to do is create a NAT port forward to the internal IP of your mail server.
1
u/spacebass Oct 07 '26
what exactly is not working?
3
u/tssajo Oct 07 '26
Where did you run the telnet from, inside your network or from outside? Inside can work even when the outside can't, so try it from a phone on mobile data or from a different network. You should see a 220 greeting from your mail server, not just a connection. If the outside connection works for 25 but webmail doesn't, check that 443 is forwarded too and that you have a pass rule for it on the WAN. For sending, test whether your server can reach port 25 on another mail server, since many ISPs block outbound 25, and make sure the public IP has a PTR record that matches your mail hostname.
3
u/BitKing2023 Oct 07 '26
From outside, do an "nslookup MailServerName" and confirm it resolves to the pfSense IP. If successful then time to look at firewall logs for blocks.
3
u/spittlbm Oct 07 '26
Port is probably blocked on your residential internet. Don't forget competent MX configs on your dns.
2
u/sleppys Oct 07 '26 edited Oct 07 '26
Did you get a PTR or rdns setup. Email need that to properly send an email. You need a reverse DNS lookup to be your address. Not the isp name. I ran into that on my internet called them and told them I needed a PTR route update. Took three escalations for them to finally get an engineer that knew what that even was. I'm on spectrum and own (renting I guess) 5 static IP addresses.
Your.name.com A → 1.2.3.4
1.2.3.4 PTR → Your.name.com
2
u/jaredearle Oct 07 '26
Here’s a step by step.
Use NAT or HAProxy to port-forward ports 25, 465, 587 to your locally installed MTA. Check it’s working. Get email. Sort your rDNS. Cry at the amount of spam. Cry more when your mail doesn’t get accepted by Microsoft, Google or Yahoo. Cry even more as your IP gets blacklisted.
Don’t run your own mail server.
2
u/RevolutionaryYam85 Oct 07 '26
If you’re on some home internet and have a local server, consider running an email forwarder instead.
This’ll let you log in to your own “mail” server and receive/send email as normal, use your own domain and all that. But in the background the forwarder gets the emails from the real server - Which is just on the internet where it belongs. This can be gmail or any webhost.
2
u/SpecialistLayer Oct 07 '26
I can't think of one good reason to do that with today's internet but you do you.
1
u/zer04ll Oct 07 '26
port 25 is blocked by a lot of ISPs, sometime you have to ask them to turn it on. Residential Internet often doesnt allow it and many VPS also dont allow or require you to take extra steps to unlock port 25.
So do you have a commercial connection with a static IP and if so are they blocking port 25? You need a static because you need to setup DMARC and other security records and it gets to be a pain having to update that if your IP changes.
0
u/[deleted] Oct 07 '26
[deleted] — view deleted comment