[SOLVED] Mail Gateway in Proxmox VE webinterface

budder

New Member
Dec 23, 2022
5
0
1
Hey,

is there a way to make the mail gateway work in the normal Proxmox WebUI. I'd like to use it as a relay server for MailCow running on a KVM.

The background is a NAT setup on my Server. My containers/vm's have a dedicated IPv6 from a /64 subnet and use the hosts single IPv4 for IPv4 connections. Obviously MailCow works no problem, with IPv6 only, after setting up Docker to use IPv6. The problem with that is, many email servers still use IPv4 only. I did in fact forward the required ports (25, 465 ect.) that is working but port 25 is already occupied from the standard postfix configuration used by Proxmox VE. I dont want to mess with that too much as I have a few monitoring tools that require sending me emails from the host for status updates.

So I thought it might be easier to use the mail gateway for relaying from my MailCow VM. Best practice would be connecting through IPv6 and relaying through IPv4 using the gateway, if this is even possible?

I guess it would be possible to install the gateway ontop of Proxmox VE and change the port for the webinterface but that seems risky. Is there another way?


Best regards

budder
 
No this is not supported - both frontends are hard-coded to listen on port 8006
I would suggest to forward traffic from outside on port 25 to a PMG VM/Container (or directly to your MailCow installation)
(just configure the postfix on PVE to listen only on the loopback interface)

I hope this helps!
 
  • Like
Reactions: budder
No this is not supported - both frontends are hard-coded to listen on port 8006
I would suggest to forward traffic from outside on port 25 to a PMG VM/Container (or directly to your MailCow installation)
(just configure the postfix on PVE to listen only on the loopback interface)

I hope this helps!
Hey!

Thanks for your help. Just to clearify it, with "listening only on the loopback interface" you simply mean the "inet_interface = loopback-only" parameter?

Best regards

budder
 
Hey!

Thanks for your help. Just to clearify it, with "listening only on the loopback interface" you simply mean the "inet_interface = loopback-only" parameter?

Best regards

budder
Just for my own reference and if somebody encounters the same problem. I fixed it by specifying the port to forward more precisley.

For example:
post-up iptables -t nat -A PREROUTING -p tcp -m multiport --dport 25,465,587,143,993,4190,110,995 -j DNAT --to 10.0.0.100

This was the entry i used for port forwarding in /etc/network/interfaces for my MailCow instance (for IPv4 NAT). Everything was working except sending email from my MailCow inbox.

I changed the line to exclude port 25 and inserted a diffrent rule to be used with port 25.

post-up iptables -t nat -A PREROUTING -i eno1 -d my_public_host_ip/32 -p TCP --dport 25 -j DNAT --to-destination 10.0.0.100:25 #kvm ip post-down iptables -t nat -D PREROUTING -i eno1 -d my_public_host_ip/32 -p TCP --dport 25 -j DNAT --to-destination 10.0.0.100:25 #kvm ip

Now delivery, aswell as receving mail works both over IPv6 and IPv4 (which includes sending status mail, of my monitoring tools, from the proxmox host).

Best regards

budder

PS Edit: Nothing was changed on the standard postfix config of Proxmox VE, it's still vanilla.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!