-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IPv6 and/or multiple IPv4 addresses] dovecot/nginx bindings due to "address already in use" #3900
Comments
As alwais, I forget to include some important details: |
Hi, you don't need to enable IPv6, it is enabled by default. What am I missing? :) |
Hi Andryyy, thank you for your quick reply and info, I would like to configure the machine IPv6 also configured in my domain DNS records, for nginx to bind and work correctly (ATM it can't renew the certificates) and for Postfix/Dovecot to send and receive emails via v6. |
Do you have an only single IPv6 address configured on the host machine? |
Yes I do... |
No, I run it just like that too. Looking at your docker-compose.override.yml and mailcow.conf, you don't seem to need the docker-compose.override.yml; because from what I understand if there's only a single IPv4 and IPv6 address, and if there's nothing running on the host machine which would conflict with mailcow's containers, you wouldn't need to do any kind of bindings by hand. Did you try running it without the docker-compose.override.yml file? Just run |
As described in the first post, when running without the override file it works fine. And no, |
Talking about this sentence:
|
I should definitely try to learn how to read sometime 😛 Sorry about that. What does |
Sorry for the late reply... family... meh... |
It does not show a binding for me too (when I don't have the override file), but I can |
No, but I did just now, and as you said, I can telnet port 587 from another IPv6 capable machine. Okay so my issue with the certificates was not related to the fact IPv6 is not working, because clearly it is (even tho it doesn't show up bindings for |
I seem to have the same issue. Unlike maybe others I use multiple IPv6 and need to bind mailcow with one only. I created the override as was in the docs:
This is the output from the log:
I can confirm there is no other program listening on port 587
|
I have exactly the same problem. Have you managed to solve it? |
No, I did not. I had to leave IPv6 alone for now and it's running on IPv4 only. |
@bryanpedini Any suggestion of how can we solve this? I have multiple IPv6 assigned to my host NIC, but I need to bind just one IPv6 to mailcow. |
Why do you ask me? 😄 I only have one IPv6 address configured in my VM and I didn't need to create the override file, since it gets used automatically (yet somehow there is no binding on any port in v6 🤨) Anyway, if there's something to learn from this issue, if I may suggest, is that IPv6 on Mailow Dockerized probably would benefit from a complete overhaul (or at least a complete check), since it's unclear how to use it for many people. |
I have multiple IPv4 and IPv6. With IPv4 it's not that easy already. I tried to use some proxy but I did not not succeed. The biggest problem is with certificates, so you need to set up the proxy to query for them, which I could not set up to work with no issues. The only way is to have an extra IPv4 for anything else but Mailcow. As for IPv6, we already know, that's a problem. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
STFU stale bot! |
@kunago seems to have the same issue under multiple IPv4 addresses, perhaps it's the same root cause so I updated the issue title... |
It's actually very easy to fix, it happens because by default in the docker compose file the ports bind on all interface ip's. I fixed it by adding 2 new keys to my mailcow.conf:
And then changing the docker-compose.yml and changing all public port bindings there to include the BIND_V4 key, for example (do the same for dovecot, I did that this way to hope that I can avoid future merge conflicts):
And also creating a docker-compose.override.yml with the following content:
|
can't we just override everything in the appropriate file, and put both v4 and v6 bindings in the override file? |
@xPathin can't SNAT do what you describe in your answer https://mailcow.github.io/mailcow-dockerized-docs/firststeps-snat/? Otherwise the docs clearly explain how to bind to a specific IP address: https://mailcow.github.io/mailcow-dockerized-docs/firststeps-ip_bindings/ |
@mthld to be clear, the second link you posted (https://mailcow.github.io/mailcow-dockerized-docs/firststeps-ip_bindings/) is the exact guide I followed, the one that caused my problems, and the reason why I ultimately opened this issue on GH. Maybe the issue isn't that "this thing X doesn't work" but "this procedure ABC described in the official doc doesn't work since version XYZ of the product", but in any case something doesn't work, hence this #3900. |
@bryanpedini I see. Sorry I didn't read thoroughly your first post, I didn't saw the link the first time. |
no problem, now the only thing left to do is understand if just the doc isn't updated, or there actually is and underlying issue on the software itself... |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
STFU stalebot |
Annoying indeed. |
The solution given in #3900 (comment) does not work for me
|
You need to explicilty set the IP on your other services too. |
what other services? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
quote. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
quote. Can we take a look at what needs to be done for this not to happen anymore? Or at least block the stalebot from constantly pressing, at least I have email notifications active 😅 |
done :) |
As of docker compose 2.x you must use square brackets [ ] around IPv6 addresses. The following shows custom IPv4 and IPv6 bindings and works with docker compose 2.x. mailcow.conf
docker-compose.override.yml
|
Have there been any news to this? I just installed mailcow on a fresh machine with both a single ipv4 and a single ipv6 address. |
This worked for me. |
Prior to placing the issue, please check following: (fill out each checkbox with an
X
once done)Summary
I'm sure I'm 101% idiot and missed something, let's start with that 😄
![Screenshot_20201215_164150](https://user-images.githubusercontent.com/45012292/102238556-2ba45900-3ef6-11eb-84c5-a0f0ec7ee463.png)
I'm currently on commit 329fe3f, trying to configure IPv6 because I forgot that I have registered the DNS names but not configured it properly on the containers yet (so Let'sEncrypt fails, obviously). I'm following the official guide here.
However it fails due to "bind: address already in use":
This happens only when using the override YAML file with IPv6, when renaming it to
.bak
everything works again with all the other files untouched.I also tried to update (commit 0846013 plus moo@cow.moo before and after update commits) but with same results, unfortunately...
Logs
As per screenshot above, full logs here:
debug.log (as per
docker-compose logs -t --no-color --tail=all | tee debug.log
)Reproduction
Fairly simple dockerized version of Mailcow, almost no customization to the config files, adding IPv6. (basically nothing else).
Sorry, can't better describe how to reproduce, I'm just enabling IPv6 on a perfectly working Mailcow environment, after finally having configured it on the host machine...
System information
docker version
)docker-compose version
)git diff origin/master
, any other changes to the code?data/assets/ssl-example/cert.pem
anddata/assets/ssl-example/key.pem
.iptables -L -vn
,ip6tables -L -vn
,iptables -L -vn -t nat
andip6tables -L -vn -t nat
.docker exec -it $(docker ps -qf name=acme-mailcow) dig +short stackoverflow.com @172.22.1.254
(set the IP accordingly, if you changed the internal mailcow network) and post the output.Thanks to everyone involved in the Mailcow and Mailcow-Dockerized projects, and thank you in advance for any help!
The text was updated successfully, but these errors were encountered: