I am running mailcow-dockerized on a server with 3 network cards, 1 is the lan interface, and 2 are WAN interfaces and I am hosting a separate domain on each of the 2 WAN interfaces. I am using Nginx proxy manager to reverse proxy mailcow services from my lan interface to one of my wan IPs - and when I set this up I set mailcow to use the correct IP for sending and receiving emails and it worked fine, but it seems on rebooting the server, the mailcow-dockerized server switches to use the other or ‘wrong’ WAN ip - how can I set mailcow-dockerized (or docker) to always use the correct WAN interface/address.

Any help or pointers will me much appreciated - thank you!

Have something to say?

Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!

Thank you sir, here are my bindings settings
as you can see I am binding the mailcow services to my local lan IP and then I am using nginx proxy manager to reverse proxy to the correct WAN Interface - so I am thinking this may be a proxy/docker issue rather than an an mailcow config issue…

Then again maybe I need to amend the below to include the WAN IP I wish to use?

e.g. SMTP_PORT=x.x.x.x:25
etc… ?

Do you think this may help?

Just to recap my server has a lan IP of 192.168.1.19 and I am running mailcow-dockerized on the lan IP and reverse proxing the front-end services to one of my WAN IPs (O have 2 but I want to restrict all the services for my hosted domain to run on 1 of the WAN IPs and have set this up correctly with my DNS provider)

I am confused and thinking that as mailcow-dockerized is bound to the plan IP although I am reverse proxing the front-end services to the correct WAN IP - my server may be selecting one of the WAN IPs (in this case the wrong WAN IP) as the default gateway that docker/mailcow is using to send emails…

Does this make sense - or do you have any ideas?

Many thanks for your reply and any help on this!

    Thank you, I am only reverse proxying ports 80 and 8080 from my lan IP to the WAN IP for the SOGo front end and using Nginx Proxy Manager to deal with SSL - so I am not reverse proxying any of the mailcow SMTP ports etc… this is what leads me to suspect that the issue is more to do with how docker is internally selecting a default gateway to use from the machines three interfaces rather than any mailcow settings….

    I will continue to investigate and if I find a solution I will update this thread in case it is useful for anyone else in the future.

    But if you have any ideas… feel free!

    Cheers

    hello.
    nginx

    listen 80;

    change to

    listen 12.34.56.78:80;

    chers 🙂

    Thanks but nginx proxy manager and the webmail front end are working fine - its just an issue with the IP mails are being sent from on my server with 3 network interfaces.

    I havent yet been able to restart the server after setting the smtp ports etc to bind to the wan interfacr i need, altough i may also try binding the ports to the lan ip and reverse proxing them…

    Cheers!

    No one is typing