Pfsense - Fails to setup haproxy with IMAPS on outside to IMAP internally - why?


I have been following several guides on the youtube channel and have successfully setup haproxy in pfsense with https on outside to three internal services on the inside without ssl.

I fail to setup haproxy to open IMAPS on the outside to IMAP on the inside.

My setup:
DNS setup with a mx record pointing to

acme setup
Certificate created for both and

haproxy setup
Backend created by pointing to local imap server on port 143

Frontend created by listen to WAN address on port 993 with SSL Offloading selected and

Value for “Host starting with:” is

I’m not sure which certificate to use for SSL offloading but I have tried both the cert for and with same result.

I have a firewall rule with source=any and desitnation any with port IMAP/S (993).
I thought I should have the destination IP but I just tested with any. Still no success.

When I use a mail server tester on internet

  • I get a timeout if I try to use the IMAPS method.
  • If I instead use IMAP (which I created a NAT rule for) it works as expected.

Anyone who can tell me what I should do to get progress?


I have never used HAProxy for IMAP but there are some forum posts over at that might help.