After jumping through several hoops, I got my Proxmox mail gateway working!
- Do **not**, I repeat, **do not** use incus config device add $contname $devname proxy *without* nat -- everything will be passed to the container as 127.0.0.1 - PMG will act as open relay!!!
- PMG uses the search domain in /etc/resolv.conf as "domainname"
- PMG uses the hostname in /etc/hostname as hostname
- you need both for the FQDN!
- Set up `ufw route allow proto tcp to $containerip port 25`
- Set up static IPs, for the container, otherwise incus will refuse to add the proxy with nat:
* incus config device set prox-mail eth0 ipv6.address=fc00::25 security.ipv6_filtering=true
* incus config device override prox-mail eth0 ipv4.address=10.0.0.2
* within the container, setup the static ipv6, if applicable
- Add the proxy device with NAT
* incus config device add prox-mail public6-port25 proxy listen="tcp:[host-public-ipv6]:25" connect="tcp:[fc00::25]:25" nat=true
* incus config device add prox-mail public-port25 proxy listen="tcp:host-public-ipv4:25" connect=tcp:10.0.0.2:25 nat=true
