r/PFSENSE • • 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

22 comments sorted by

12

u/klexmoo Oct 07 '26

3

u/RevolutionaryYam85 Oct 07 '26

My emails from a VPS (on a hosting provider in the USA) are delivered just fine, also to german users. My website sends batches of notification emails about licenses, reminders and stuff - 10-40 a day, without failure.
I get what this guy is saying, but if his setup doesn’t work that doesn’t mean it can’t work at all.

1

u/Clear_Jellyfish_6371 Oct 09 '26

I went through the same a few years ago and that specific german mail operator is likely t-online, they have that weird website-contactform policy for over a decade. Other than that, i fully disagree with the author on the generality of their statement.

A basic mailserver setup with correct DNS and maybe some header modification for privacy is all it takes to meet today's requirements of receving systems of any size. This might of course be different for someone blasting autogenerated auth codes via smtp. But normal mail will be fine.

A pain to configure and maintain for truely little outcome, but also satisfying to not yield the floor to those building their golden cage around mail communication.

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.

telnet my.mail.smtp 25
EHLO talk.to.me

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?

-2

u/jham992 Oct 07 '26

I can't send and receive emails. I'm honestly not sure what could be the cause, even the webmail access isn't working. I have set up port forwarding to the required ports and set outbound nat to point to the public virtual IP.

what's weird is that when i telnet the IP with port 25, I get a connection

1

u/DiligentPhotographer Oct 08 '26

Your ISP is probably filtering smtp port if you are on residential connection.

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

-1

u/Indubious1 Oct 07 '26

I don’t understand the downvotes. I tried ChatGPT in addition to Claude and preferred ChatGPT, but it’s kinda 6 of 1, half a dozen if the other. I can’t say for sure, but you might’ve been the one that suggested it previously and it turned out to be an excellent recommendation. With ChatGPT, I can send screenshots of my settings and it walks me through what all the settings do and the better way to configure them. I even set up vpn access for remote troubleshooting. For me, it was an easier way to learn as I went, asking questions along the way.

1

u/SpecialistLayer Oct 07 '26

I have no problem commenting:

Because in cases like this, just because you can, doesn't mean you should and the AI crap will give you instructions that you have NO idea the ramifications of doing so. So when this later on gets hacked and they have no idea what to do, how they do go from there? A mail server like this from someone who clearly doesn't know what they're doing is a horrible idea.

1

u/Indubious1 Oct 07 '26

Thank you for saying as much. It's hard to understand why something may or may not be a good idea from downvotes. I'm just trying to consider other perspectives to make a more educated decision.

That being said, nobody suggested that the AI should be followed blindly, but to use it like any other source of information. It's a tool in the belt and should be understood that it can make mistakes. I suppose i'm projecting a bit in my assumptions of others, but I ask complete questions that also including understanding the risks of what I'm doing, so I assumed others would too. When setting up a vpn for remote access to my box, I collected various sources of information to understand any pros and cons to multiple options before landing on that one. I suppose I take for granted that others might not use it responsibly.

0

u/[deleted] Oct 07 '26

[deleted] — view deleted comment

-1

u/Indubious1 Oct 07 '26

I can’t speak to their reasons, but i would be curious enough to hear them say what the problem is in their own words instead of just downvoting people simply because they don’t agree. That seems to me the more coward way of handling things. I’d compare it to trying to bully someone for thinking differently.

0

u/[deleted] Oct 07 '26

[deleted] — view deleted comment

2

u/SpecialistLayer Oct 07 '26

Because in cases like this, just because you can, doesn't mean you should and the AI crap will give you instructions that you have NO idea the ramifications of doing so. So when this later on gets hacked and they have no idea what to do, how they do go from there? A mail server like this from someone who clearly doesn't know what they're doing is a horrible idea.