Install and config behind HAProxy

a.dimitrov

Member
Mar 3, 2021
7
1
23
45
Hi everyone. I have a following setup:
Proxmox VE with 10 VM-s. For firewall I am using pfSense (XX virtual IPs for my Public interface) with haProxy. Behind haProxy I have a PMG and mail server (iRedmail) in same LAN. This is my test scenario:
192.168.100.5 - virtual IP public interface
172.16.20.1 - PMG
172.16.20.2 - iRedMail
haProxy config - 192.168.100.5 - Frontend, backend 172.16.20.1:25
PMG config - Default relay 172.16.20.2 (here Im not sure is this right)
telnet 192.168.100.5 25 - > port is open and i can conect
telnet 172.16.20.2 - > 220 mail.xxxxx.xx SMTP postfix

So i have a couple questions:
How to test this scenario?
Am I make something wrong in my config in test scenario?
I read documentation but i am in a little confusuion and I need help
 
Last edited:
what is your use case for haproxy on pmg/iredmail?
I believe you no need haproxy for mail servers. Just set multiple mx record in your dns server for HA.
 
Last edited:
  • Like
Reactions: a.dimitrov
How to test this scenario?
The easiest would be to send a mail to 192.168.100.5 - i.e. have a domain which has a MX record pointing to the pfsense
the mail should arrive at PMG - and if PMG is configured correctly (from your description it should be) - PMG should relay the mail to 172.16.20.2

Check the logs on PMG and 172.16.20.2

however - if you only have one PMG installation I don't quite see the advantage of using HAProxy -> just configure a port-forward.

Apart from that @hata_ph also has a point - load-balancing/failover for SMTP works quite well with multiple mx records (or multiple A records for the mail-server).

maybe also the getting started article in our wiki might be of some help:
https://pmg.proxmox.com/wiki/index.php/Getting_started_with_Proxmox_Mail_Gateway

I hope this helps!
 
  • Like
Reactions: a.dimitrov