For some reason when I create a mail domain, it uses the local IP of my server, not the public IP in the nginx.conf (in the listen directive).
I need it to use the public IP.
If I manually edit the webmail nginx .conf then it works, but of course this is not proper solution as it will get overwritten again later.
When adding web domains, they also default to the private IP but I’m able to select the public IP instead during creation. However no such option exists for mail domains.
If it’s relevant, I use the private IP to access the panel (only I use it)
Ah yes thank you, the domain I was testing this with didn’t have a web site configured. If I create a web domain on the correct IP, the mail domain copies it.
Ah thank you, after digging around I found the IP configuration by clicking Server (cog in top right) / Configure / Network. I set the private IP as not-shared and assigned it to admin user. My other users now don’t see this as an option when creating a web domain.