mailcow / mailcow-dockerized

mailcow: dockerized - 🐮 + 🐋 = 💕
https://mailcow.email
GNU General Public License v3.0
8.26k stars 1.12k forks source link

Mailcow Unable to Retrieve Server IPv6 Address #5859

Open 7zx opened 2 months ago

7zx commented 2 months ago

Contribution guidelines

I've found a bug and checked that ...

Description

I'm encountering an issue with my Mailcow server where the Mailcow UI (Mailcow in general) is unable to retrieve the server's IPv6 address, despite IPv6 being enabled and functional on the server. I suspect that Docker may be encountering difficulty in obtaining the IPv6 address.

Logs:

The logs I retrieved using docker-compose logs command do not include error logs. They seem to be general service logs without specific error details.

Steps to reproduce:

1. Access the Mailcow UI:
Log in to your Mailcow admin panel.

2. Enable IP Check:
Navigate to System > Configuration > Options > Customize.

3. Return to Mailcow UI:
Go back to the main Mailcow interface.

4. View Public IP:
Locate the "Show public IP" button on the Mailcow dashboard or settings page and click on it.

Which branch are you using?

master

Which architecture are you using?

x86

Operating System:

Debian GNU/Linux 11 (bullseye)

Server/VM specifications:

2 GB RAM DDR4, 1 vCPU @3,60Ghz

Is Apparmor, SELinux or similar active?

AppArmor is active

Virtualization technology:

KVM

Docker version:

26.1.0

docker-compose version or docker compose version:

v2.26.1

mailcow version:

2024-04

Reverse proxy:

Nginx

Logs of git diff:

diff --git a/data/assets/ssl-example/cert.pem b/data/assets/ssl-example/cert.pem
index 96d16bec..b83648c2 100644
--- a/data/assets/ssl-example/cert.pem
+++ b/data/assets/ssl-example/cert.pem
@@ -1,19 +1,33 @@
 -----BEGIN CERTIFICATE-----
-MIIDBDCCAe6gAwIBAgIQeJMoL/3dxhxhT9EwuRTL/DALBgkqhkiG9w0BAQswEjEQ
-MA4GA1UEChMHbWFpbGNvdzAeFw0xNjEyMTMxMDExMDBaFw0xOTExMjgxMDExMDBa
-MC0xEDAOBgNVBAoTB21haWxjb3cxGTAXBgNVBAMTEG1haWwuZXhhbXBsZS5vcmcw
-ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRg0xT3At9DSb3H5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yV+Y8A7VyZyI30ktPkmIm9XfrbZS7LMDEtij5ckT/o5VyXP9eACwpyDOzGV
+KFvl47ybffNoP5eUPmIvu1kud2SH+VVoyL8NmfeTIOwsp03g74tGRulUzHLfKQSh
+0k2IiTDAHO4kIHJyGKfdu1Wggq9Y55KHaVrxueS8L4vKfH5CqneJpDDTTrRA+YaJ
+4inpxTn4E+WXg/0L1cm6bWOKBm3KVWvF+F24dVfLY87i1qptVEXywzNsBGVKKfZY
+JbWFxqScd+jZ38KQcbEGtBc+oRyXiGnZwqtA3DyUiLJZpZkTWpmmWo1wFmzjFFtb
++699o26nwkDIAkW8M+KM0P7mIFR68nbknAcv5u6tBb5CknpMIrhIFh9fD8i67HPi
+BCe/+0RFjNUqJE2hzM9N3CWGmpF6/odxb/htC2lmqhYH7DgKl3hcaaVaDju0e9po
+NTG49hlm5pYpUZJBBOK4IYd7fbQcAJtQwECNJP5ZkEqBYucOHJsj5VyOMeRNmbxf
+ytapAQvJjeeSEN2ZWRa6Y7gC7d1j9JDAGYtmwsi3AWynrKTiWXP7dagbycgPD40c
+qInbaODgR9MXVZV7cU3VamWQFXdaNgu2hhpfsfNtJhoEcYa0WIVXiD4b+r1ijvOf
+YYPFCr7tpnlL18RJwaClNwgdxR/qHQivbg==
 -----END CERTIFICATE-----
diff --git a/data/assets/ssl-example/key.pem b/data/assets/ssl-example/key.pem
index cedf35a0..32d20689 100644
--- a/data/assets/ssl-example/key.pem

Logs of iptables -L -vn:

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
10995 3600K MAILCOW    all  --  *      *       0.0.0.0/0            0.0.0.0/0            /* mailcow */
10995 3600K DOCKER-USER  all  --  *      *       0.0.0.0/0            0.0.0.0/0
10995 3600K DOCKER-ISOLATION-STAGE-1  all  --  *      *       0.0.0.0/0            0.0.0.0/0
 8352 3370K ACCEPT     all  --  *      br-mailcow  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
  879 58976 DOCKER     all  --  *      br-mailcow  0.0.0.0/0            0.0.0.0/0
 1764  171K ACCEPT     all  --  br-mailcow !br-mailcow  0.0.0.0/0            0.0.0.0/0
  862 57956 ACCEPT     all  --  br-mailcow br-mailcow  0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  --  *      docker0  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
    0     0 DOCKER     all  --  *      docker0  0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  --  docker0 !docker0  0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     all  --  docker0 docker0  0.0.0.0/0            0.0.0.0/0

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain DOCKER (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     tcp  --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.5           tcp dpt:8983
    0     0 ACCEPT     tcp  --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.249         tcp dpt:6379
    0     0 ACCEPT     tcp  --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.6           tcp dpt:3306
    0     0 ACCEPT     tcp  --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.250         tcp dpt:12345
    0     0 ACCEPT     tcp  --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.250         tcp dpt:4190
    0     0 ACCEPT     tcp  --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.250         tcp dpt:995
    0     0 ACCEPT     tcp  --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.250         tcp dpt:993
    0     0 ACCEPT     tcp  --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.250         tcp dpt:143
    0     0 ACCEPT     tcp  --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.250         tcp dpt:110
    0     0 ACCEPT     tcp  --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.8           tcp dpt:443
    1    60 ACCEPT     tcp  --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.8           tcp dpt:80
    0     0 ACCEPT     tcp  --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.253         tcp dpt:587
    0     0 ACCEPT     tcp  --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.253         tcp dpt:465
   16   960 ACCEPT     tcp  --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.253         tcp dpt:25

Chain DOCKER-ISOLATION-STAGE-1 (1 references)
 pkts bytes target     prot opt in     out     source               destination
 1764  171K DOCKER-ISOLATION-STAGE-2  all  --  br-mailcow !br-mailcow  0.0.0.0/0            0.0.0.0/0
    0     0 DOCKER-ISOLATION-STAGE-2  all  --  docker0 !docker0  0.0.0.0/0            0.0.0.0/0
97373   19M RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain DOCKER-ISOLATION-STAGE-2 (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       all  --  *      br-mailcow  0.0.0.0/0            0.0.0.0/0
    0     0 DROP       all  --  *      docker0  0.0.0.0/0            0.0.0.0/0
14899 1468K RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain DOCKER-USER (1 references)
 pkts bytes target     prot opt in     out     source               destination
97373   19M RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain MAILCOW (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       tcp  --  !br-mailcow br-mailcow  0.0.0.0/0            0.0.0.0/0            /* mailcow isolation */

Logs of ip6tables -L -vn:

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
 5591 1891K MAILCOW    all      *      *       ::/0                 ::/0                 /* mailcow */
 5591 1891K DOCKER-USER  all      *      *       ::/0                 ::/0
 5591 1891K DOCKER-ISOLATION-STAGE-1  all      *      *       ::/0                 ::/0
 1785  449K ACCEPT     all      *      br-mailcow  ::/0                 ::/0                 ctstate RELATED,ESTABLISHED
 3013  208K DOCKER     all      *      br-mailcow  ::/0                 ::/0
  793 1234K ACCEPT     all      br-mailcow !br-mailcow  ::/0                 ::/0
 3010  208K ACCEPT     all      br-mailcow br-mailcow  ::/0                 ::/0
    0     0 ACCEPT     all      *      docker0  ::/0                 ::/0                 ctstate RELATED,ESTABLISHED
    0     0 DOCKER     all      *      docker0  ::/0                 ::/0
    0     0 ACCEPT     all      docker0 !docker0  ::/0                 ::/0
    0     0 ACCEPT     all      docker0 docker0  ::/0                 ::/0

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain DOCKER (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     tcp      !br-mailcow br-mailcow  ::/0                 fd4d:6169:6c63:6f77::b  tcp dpt:4190
    0     0 ACCEPT     tcp      !br-mailcow br-mailcow  ::/0                 fd4d:6169:6c63:6f77::b  tcp dpt:995
    0     0 ACCEPT     tcp      !br-mailcow br-mailcow  ::/0                 fd4d:6169:6c63:6f77::b  tcp dpt:993
    0     0 ACCEPT     tcp      !br-mailcow br-mailcow  ::/0                 fd4d:6169:6c63:6f77::b  tcp dpt:143
    0     0 ACCEPT     tcp      !br-mailcow br-mailcow  ::/0                 fd4d:6169:6c63:6f77::b  tcp dpt:110
    0     0 ACCEPT     tcp      !br-mailcow br-mailcow  ::/0                 fd4d:6169:6c63:6f77::c  tcp dpt:443
    3   216 ACCEPT     tcp      !br-mailcow br-mailcow  ::/0                 fd4d:6169:6c63:6f77::c  tcp dpt:80
    0     0 ACCEPT     tcp      !br-mailcow br-mailcow  ::/0                 fd4d:6169:6c63:6f77::10  tcp dpt:587
    0     0 ACCEPT     tcp      !br-mailcow br-mailcow  ::/0                 fd4d:6169:6c63:6f77::10  tcp dpt:465
    0     0 ACCEPT     tcp      !br-mailcow br-mailcow  ::/0                 fd4d:6169:6c63:6f77::10  tcp dpt:25

Chain DOCKER-ISOLATION-STAGE-1 (1 references)
 pkts bytes target     prot opt in     out     source               destination
  793 1234K DOCKER-ISOLATION-STAGE-2  all      br-mailcow !br-mailcow  ::/0                 ::/0
    0     0 DOCKER-ISOLATION-STAGE-2  all      docker0 !docker0  ::/0                 ::/0
32430 6413K RETURN     all      *      *       ::/0                 ::/0

Chain DOCKER-ISOLATION-STAGE-2 (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       all      *      br-mailcow  ::/0                 ::/0
    0     0 DROP       all      *      docker0  ::/0                 ::/0
 4517 1850K RETURN     all      *      *       ::/0                 ::/0

Chain DOCKER-USER (1 references)
 pkts bytes target     prot opt in     out     source               destination
32430 6413K RETURN     all      *      *       ::/0                 ::/0

Chain MAILCOW (1 references)
 pkts bytes target     prot opt in     out     source               destination

Logs of iptables -L -vn -t nat:

Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
  971 51460 DOCKER     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ADDRTYPE match dst-type LOCAL

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DOCKER     all  --  *      *       0.0.0.0/0           !127.0.0.0/8          ADDRTYPE match dst-type LOCAL

Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
 1454  111K MASQUERADE  all  --  *      !br-mailcow  172.22.1.0/24        0.0.0.0/0
    0     0 MASQUERADE  all  --  *      !docker0  172.17.0.0/16        0.0.0.0/0
    0     0 MASQUERADE  tcp  --  *      *       172.22.1.5           172.22.1.5           tcp dpt:8983
    0     0 MASQUERADE  tcp  --  *      *       172.22.1.249         172.22.1.249         tcp dpt:6379
    0     0 MASQUERADE  tcp  --  *      *       172.22.1.6           172.22.1.6           tcp dpt:3306
    0     0 MASQUERADE  tcp  --  *      *       172.22.1.250         172.22.1.250         tcp dpt:12345
    0     0 MASQUERADE  tcp  --  *      *       172.22.1.250         172.22.1.250         tcp dpt:4190
    0     0 MASQUERADE  tcp  --  *      *       172.22.1.250         172.22.1.250         tcp dpt:995
    0     0 MASQUERADE  tcp  --  *      *       172.22.1.250         172.22.1.250         tcp dpt:993
    0     0 MASQUERADE  tcp  --  *      *       172.22.1.250         172.22.1.250         tcp dpt:143
    0     0 MASQUERADE  tcp  --  *      *       172.22.1.250         172.22.1.250         tcp dpt:110
    0     0 MASQUERADE  tcp  --  *      *       172.22.1.8           172.22.1.8           tcp dpt:443
    0     0 MASQUERADE  tcp  --  *      *       172.22.1.8           172.22.1.8           tcp dpt:80
    0     0 MASQUERADE  tcp  --  *      *       172.22.1.253         172.22.1.253         tcp dpt:587
    0     0 MASQUERADE  tcp  --  *      *       172.22.1.253         172.22.1.253         tcp dpt:465
    0     0 MASQUERADE  tcp  --  *      *       172.22.1.253         172.22.1.253         tcp dpt:25

Chain DOCKER (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 RETURN     all  --  br-mailcow *       0.0.0.0/0            0.0.0.0/0
    0     0 RETURN     all  --  docker0 *       0.0.0.0/0            0.0.0.0/0
    0     0 DNAT       tcp  --  !br-mailcow *       0.0.0.0/0            127.0.0.1            tcp dpt:18983 to:172.22.1.5:8983
    0     0 DNAT       tcp  --  !br-mailcow *       0.0.0.0/0            127.0.0.1            tcp dpt:7654 to:172.22.1.249:6379
    0     0 DNAT       tcp  --  !br-mailcow *       0.0.0.0/0            127.0.0.1            tcp dpt:13306 to:172.22.1.6:3306
    0     0 DNAT       tcp  --  !br-mailcow *       0.0.0.0/0            127.0.0.1            tcp dpt:19991 to:172.22.1.250:12345
    0     0 DNAT       tcp  --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:4190 to:172.22.1.250:4190
    0     0 DNAT       tcp  --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:995 to:172.22.1.250:995
    0     0 DNAT       tcp  --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:993 to:172.22.1.250:993
    0     0 DNAT       tcp  --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:143 to:172.22.1.250:143
    0     0 DNAT       tcp  --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:110 to:172.22.1.250:110
    0     0 DNAT       tcp  --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:443 to:172.22.1.8:443
    1    60 DNAT       tcp  --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80 to:172.22.1.8:80
    0     0 DNAT       tcp  --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:587 to:172.22.1.253:587
    0     0 DNAT       tcp  --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:465 to:172.22.1.253:465
   18  1080 DNAT       tcp  --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:25 to:172.22.1.253:25

Logs of ip6tables -L -vn -t nat:

Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
   34  2496 DOCKER     all      *      *       ::/0                 ::/0                 ADDRTYPE match dst-type LOCAL

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DOCKER     all      *      *       ::/0                !::1                  ADDRTYPE match dst-type LOCAL

Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
  587 55348 MASQUERADE  all      *      !br-mailcow  fd4d:6169:6c63:6f77::/64  ::/0
    0     0 MASQUERADE  all      *      !docker0  fd00:dead:beef:c0::/80  ::/0
    0     0 MASQUERADE  tcp      *      *       fd4d:6169:6c63:6f77::b  fd4d:6169:6c63:6f77::b  tcp dpt:4190
    0     0 MASQUERADE  tcp      *      *       fd4d:6169:6c63:6f77::b  fd4d:6169:6c63:6f77::b  tcp dpt:995
    0     0 MASQUERADE  tcp      *      *       fd4d:6169:6c63:6f77::b  fd4d:6169:6c63:6f77::b  tcp dpt:993
    0     0 MASQUERADE  tcp      *      *       fd4d:6169:6c63:6f77::b  fd4d:6169:6c63:6f77::b  tcp dpt:143
    0     0 MASQUERADE  tcp      *      *       fd4d:6169:6c63:6f77::b  fd4d:6169:6c63:6f77::b  tcp dpt:110
    0     0 MASQUERADE  tcp      *      *       fd4d:6169:6c63:6f77::c  fd4d:6169:6c63:6f77::c  tcp dpt:443
    0     0 MASQUERADE  tcp      *      *       fd4d:6169:6c63:6f77::c  fd4d:6169:6c63:6f77::c  tcp dpt:80
    0     0 MASQUERADE  tcp      *      *       fd4d:6169:6c63:6f77::10  fd4d:6169:6c63:6f77::10  tcp dpt:587
    0     0 MASQUERADE  tcp      *      *       fd4d:6169:6c63:6f77::10  fd4d:6169:6c63:6f77::10  tcp dpt:465
    0     0 MASQUERADE  tcp      *      *       fd4d:6169:6c63:6f77::10  fd4d:6169:6c63:6f77::10  tcp dpt:25

Chain DOCKER (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 RETURN     all      br-mailcow *       ::/0                 ::/0
    0     0 RETURN     all      docker0 *       ::/0                 ::/0
    0     0 DNAT       tcp      !br-mailcow *       ::/0                 ::/0                 tcp dpt:4190 to:[fd4d:6169:6c63:6f77::b]:4190
    0     0 DNAT       tcp      !br-mailcow *       ::/0                 ::/0                 tcp dpt:995 to:[fd4d:6169:6c63:6f77::b]:995
    0     0 DNAT       tcp      !br-mailcow *       ::/0                 ::/0                 tcp dpt:993 to:[fd4d:6169:6c63:6f77::b]:993
    0     0 DNAT       tcp      !br-mailcow *       ::/0                 ::/0                 tcp dpt:143 to:[fd4d:6169:6c63:6f77::b]:143
    0     0 DNAT       tcp      !br-mailcow *       ::/0                 ::/0                 tcp dpt:110 to:[fd4d:6169:6c63:6f77::b]:110
    0     0 DNAT       tcp      !br-mailcow *       ::/0                 ::/0                 tcp dpt:443 to:[fd4d:6169:6c63:6f77::c]:443
    3   216 DNAT       tcp      !br-mailcow *       ::/0                 ::/0                 tcp dpt:80 to:[fd4d:6169:6c63:6f77::c]:80
    0     0 DNAT       tcp      !br-mailcow *       ::/0                 ::/0                 tcp dpt:587 to:[fd4d:6169:6c63:6f77::10]:587
    0     0 DNAT       tcp      !br-mailcow *       ::/0                 ::/0                 tcp dpt:465 to:[fd4d:6169:6c63:6f77::10]:465
    0     0 DNAT       tcp      !br-mailcow *       ::/0                 ::/0                 tcp dpt:25 to:[fd4d:6169:6c63:6f77::10]:25

DNS check:

104.18.32.7
172.64.155.249

Additional Information:

mailcow/acme container logs:

Sat Apr 27 14:30:55 WEST 2024 - Waiting for Docker API...
Sat Apr 27 14:30:55 WEST 2024 - Docker API OK
Sat Apr 27 14:30:55 WEST 2024 - Waiting for Postfix...
ping: bad address 'postfix'
Sat Apr 27 14:30:57 WEST 2024 - Postfix OK
Sat Apr 27 14:30:57 WEST 2024 - Waiting for Dovecot...
Sat Apr 27 14:30:57 WEST 2024 - Dovecot OK
Sat Apr 27 14:30:57 WEST 2024 - Waiting for database...
Sat Apr 27 14:30:57 WEST 2024 - Database OK
Sat Apr 27 14:30:57 WEST 2024 - Waiting for Nginx...
Sat Apr 27 14:30:57 WEST 2024 - Nginx OK
Sat Apr 27 14:30:57 WEST 2024 - Waiting for resolver...
Sat Apr 27 14:30:58 WEST 2024 - Resolver OK
Sat Apr 27 14:30:58 WEST 2024 - Waiting for domain table...
OK
Sat Apr 27 14:30:58 WEST 2024 - Initializing, please wait...
Could not read certificate from <stdin>
Could not read certificate from <stdin>
Sat Apr 27 14:30:58 WEST 2024 - Using existing domain rsa key /var/lib/acme/acme/key.pem
Sat Apr 27 14:30:58 WEST 2024 - Using existing Lets Encrypt account key /var/lib/acme/acme/account.pem
Sat Apr 27 14:30:58 WEST 2024 - Detecting IP addresses...
Sat Apr 27 14:31:37 WEST 2024 - OK: 185.113.142.56, 0000:0000:0000:0000:0000:0000:0000:0000
Sat Apr 27 14:31:37 WEST 2024 - Found AAAA record for autodiscover.polido.pt: 2a03:0:142:0:bad:c0de:39ac:29ad - skipping A record check
Sat Apr 27 14:31:37 WEST 2024 - Cannot match your IP 0000:0000:0000:0000:0000:0000:0000:0000 against hostname autodiscover.polido.pt (DNS returned 2a03:0000:0142:0000:0bad:c0de:39ac:29ad)
Sat Apr 27 14:31:37 WEST 2024 - Found AAAA record for autoconfig.polido.pt: 2a03:0:142:0:bad:c0de:39ac:29ad - skipping A record check
Sat Apr 27 14:31:37 WEST 2024 - Cannot match your IP 0000:0000:0000:0000:0000:0000:0000:0000 against hostname autoconfig.polido.pt (DNS returned 2a03:0000:0142:0000:0bad:c0de:39ac:29ad)
Sat Apr 27 14:31:37 WEST 2024 - Found AAAA record for mail.polido.pt: 2a03:0:142:0:bad:c0de:39ac:29ad - skipping A record check
Sat Apr 27 14:31:37 WEST 2024 - Cannot match your IP 0000:0000:0000:0000:0000:0000:0000:0000 against hostname mail.polido.pt (DNS returned 2a03:0000:0142:0000:0bad:c0de:39ac:29ad)
Sat Apr 27 14:31:37 WEST 2024 - Cannot validate any hostnames, skipping Let's Encrypt for 1 hour.
Sat Apr 27 14:31:37 WEST 2024 - Use SKIP_LETS_ENCRYPT=y in mailcow.conf to skip it permanently.
OK

curl –connect-timeout 3 -m 10 -L6s ip6.mailcow.email command output on the server:

root@mail:~# curl –connect-timeout 3 -m 10 -L6s ip6.mailcow.email
root@mail:~#

curl –connect-timeout 3 -m 10 -L6s ip6.mailcow.email command output inside the mailcow/acme container:

/ # curl –connect-timeout 3 -m 10 -L6s ip6.mailcow.email
/ #

Native IPv6 NAT status:

active

Cloudflare DNS records:

Screenshot 2024-04-27 150634

Hosting Provider:

Innov4Web

Reverse DNS status:

Reverse DNS is configured for both IPv4 and IPv6 on my server.

Hostname and IPv4/IPv6 addresses associated with my Mailcow server:

Hostname: mail.polido.pt
IPv4 Address: 185.113.142.56
IPv6 Address: 2a03:0:142:0:bad:c0de:39ac:29ad

Mailcow UI:

image

Notes:

  1. DNS records displayed in the Mailcow UI. It does not prompt me to add an AAAA record for IPv6, but I have manually added this record in the Cloudflare DNS settings:

image

  1. All of this is being done on a fresh installation of Debian 11.

  2. My hosting provider, Innov4Web, utilizes SolusVM for server control panel management and IPv6 is enabled on the server:

image

dragoangel commented 2 months ago

You need run curl -6 https://ifconfig.me/ from host and from docker compose exec postfix-mailcow curl -6 https://ifconfig.me/

dragoangel commented 2 months ago

Did you tried running ./update.sh and did you removed old IPv6 nat stuff and properly set /etc/docker/daemon.json to work with ipv6?

7zx commented 2 months ago

Did you tried running ./update.sh and did you removed old IPv6 nat stuff and properly set /etc/docker/daemon.json to work with ipv6?

Regarding the output from the commands:

root@mail:/opt/mailcow-dockerized# curl -6 https://ifconfig.me/
2a03:0:142:0:bad:c0de:39ac:29ad
root@mail:/opt/mailcow-dockerized#
root@mail:/opt/mailcow-dockerized# docker compose exec postfix-mailcow curl -6 https://ifconfig.me/
2a03:0:142:0:bad:c0de:39ac:29ad
root@mail:/opt/mailcow-dockerized#

IPv6 NAT was recommended during after i first ran the ./update.sh command, and I attempted to configure IPv6 without it, encountering the same issue. Additionally, I did not modify /etc/docker/daemon.json, assuming that Mailcow would handle this automatically, similar to how it managed IPv4.

The daemon.json file contains the following:

{"ipv6":true,"fixed-cidr-v6":"fd00:dead:beef:c0::/80","experimental":true,"ip6tables":true}

I have also executed the ./update.sh command multiple times without resolving the IPv6 connectivity problem.

dragoangel commented 2 months ago

Did you tried running ./update.sh and did you removed old IPv6 nat stuff and properly set /etc/docker/daemon.json to work with ipv6?

Regarding the output from the commands:

root@mail:/opt/mailcow-dockerized# curl -6 https://ifconfig.me/
2a03:0:142:0:bad:c0de:39ac:29ad
root@mail:/opt/mailcow-dockerized#
root@mail:/opt/mailcow-dockerized# docker compose exec postfix-mailcow curl -6 https://ifconfig.me/
2a03:0:142:0:bad:c0de:39ac:29ad
root@mail:/opt/mailcow-dockerized#

IPv6 NAT was recommended during after i first ran the ./update.sh command, and I attempted to configure IPv6 without it, encountering the same issue. Additionally, I did not modify /etc/docker/daemon.json, assuming that Mailcow would handle this automatically, similar to how it managed IPv4.

The daemon.json file contains the following:

{"ipv6":true,"fixed-cidr-v6":"fd00:dead:beef:c0::/80","experimental":true,"ip6tables":true}

I have also executed the ./update.sh command multiple times without resolving the IPv6 connectivity problem.

Em... you have working IPv6, at least from container... Did you tried send mail to gmail and check over which IP you would receive it? Also what you see in ACME? Do ACME container detect IPv6 properly?

https://github.com/mailcow/mailcow-dockerized/blob/36b5cccd186090d726de62b6b00d1e842e67aacd/data/Dockerfiles/acme/functions.sh#L54

I see that you accepting connection over IPv6 without issues...

7zx commented 2 months ago

Did you tried send mail to gmail and check over which IP you would receive it?

ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@polido.pt header.s=dkim header.b=gZjpwXpe;
       spf=pass (google.com: domain of goncalo@polido.pt designates 185.113.142.56 as permitted sender) smtp.mailfrom=goncalo@polido.pt;
       dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=polido.pt
Return-Path: <goncalo@polido.pt>
Received: from mail.polido.pt (mail.polido.pt. [185.113.142.56])
        by mx.google.com with ESMTPS id f8-20020a05600c4e8800b0041907540685si10467857wmq.129.2024.04.27.08.53.13
        for <goncalopolido@gmail.com>
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Sat, 27 Apr 2024 08:53:13 -0700 (PDT)
Received-SPF: pass (google.com: domain of goncalo@polido.pt designates 185.113.142.56 as permitted sender) client-ip=185.113.142.56;
Authentication-Results: mx.google.com;
       dkim=pass header.i=@polido.pt header.s=dkim header.b=gZjpwXpe;
       spf=pass (google.com: domain of goncalo@polido.pt designates 185.113.142.56 as permitted sender) smtp.mailfrom=goncalo@polido.pt;
       dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=polido.pt

Do ACME container detect IPv6 properly?

root@mail:~# ip -6 addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 2a03:0:142:0:bad:c0de:39ac:29ad/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::216:3cff:fe57:b4dc/64 scope link
valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 state DOWN
inet6 fd00:dead:beef:c0::1/80 scope global tentative
valid_lft forever preferred_lft forever
inet6 fe80::1/64 scope link tentative
valid_lft forever preferred_lft forever
4: br-mailcow: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP
inet6 fd4d:6169:6c63:6f77::1/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::42:10ff:fef2:e203/64 scope link
valid_lft forever preferred_lft forever
inet6 fe80::1/64 scope link
valid_lft forever preferred_lft forever
6: veth5c807e5@if5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP
inet6 fe80::a8ee:faff:feb1:dcf7/64 scope link
valid_lft forever preferred_lft forever
8: veth672d9f7@if7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP
inet6 fe80::602f:3cff:fe7f:188c/64 scope link
valid_lft forever preferred_lft forever
10: veth63c75a9@if9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP
inet6 fe80::ac72:4cff:fef6:3230/64 scope link
valid_lft forever preferred_lft forever
12: vethb927b2f@if11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP
inet6 fe80::54bd:9dff:feb2:f8b6/64 scope link
valid_lft forever preferred_lft forever
14: veth11ed4a5@if13: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP
inet6 fe80::4ceb:71ff:febf:4a7f/64 scope link
valid_lft forever preferred_lft forever
16: vetha8817de@if15: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP
inet6 fe80::7c75:33ff:fe08:fcc0/64 scope link
valid_lft forever preferred_lft forever
18: veth6c860fb@if17: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP
inet6 fe80::44d0:60ff:fe21:e781/64 scope link
valid_lft forever preferred_lft forever
20: veth31ab411@if19: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP
inet6 fe80::14bf:8fff:fed0:64d3/64 scope link
valid_lft forever preferred_lft forever
22: veth6f5ccff@if21: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP
inet6 fe80::f08c:7bff:fed4:7b7c/64 scope link
valid_lft forever preferred_lft forever
24: vethc2a7e7d@if23: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP
inet6 fe80::54c6:ffff:feda:ee29/64 scope link
valid_lft forever preferred_lft forever
26: veth4b2bdf2@if25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP
inet6 fe80::5e:57ff:fee9:635f/64 scope link
valid_lft forever preferred_lft forever
28: veth3c98b74@if27: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP
inet6 fe80::b418:fdff:fefa:b737/64 scope link
valid_lft forever preferred_lft forever
30: veth0d4b122@if29: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP
inet6 fe80::f053:a9ff:fe0d:a64a/64 scope link
valid_lft forever preferred_lft forever
32: vethfb9312f@if31: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP
inet6 fe80::cf2:a4ff:fe23:c780/64 scope link
valid_lft forever preferred_lft forever
34: vethb393ca0@if33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP
inet6 fe80::70b4:6fff:febf:342a/64 scope link
valid_lft forever preferred_lft forever
36: veth38f5a18@if35: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP
inet6 fe80::cccb:86ff:fe0b:4a15/64 scope link
valid_lft forever preferred_lft forever
38: veth1d99276@if37: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP
inet6 fe80::3a:52ff:fe61:2db8/64 scope link
valid_lft forever preferred_lft forever
root@mail:~# docker exec -it mailcowdockerized-acme-mailcow-1 /bin/bash
1230f1835b64:/# ip -6 addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
23: eth0@if24: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 state UP
inet6 fd4d:6169:6c63:6f77::b/64 scope global flags 02
valid_lft forever preferred_lft forever
inet6 fe80::42:acff:fe16:109/64 scope link
valid_lft forever preferred_lft forever
1230f1835b64:/# ping6 ipv6.google.com
PING ipv6.google.com (2a00:1450:4003:808::200e): 56 data bytes
64 bytes from 2a00:1450:4003:808::200e: seq=0 ttl=120 time=10.671 ms
64 bytes from 2a00:1450:4003:808::200e: seq=1 ttl=120 time=10.631 ms
64 bytes from 2a00:1450:4003:808::200e: seq=2 ttl=120 time=10.773 ms
64 bytes from 2a00:1450:4003:808::200e: seq=3 ttl=120 time=10.645 ms
^C
--- ipv6.google.com ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 10.631/10.680/10.773 ms
1230f1835b64:/#
dragoangel commented 2 months ago

I mean acme logs, and about postfix: you sure you not set stuff like prefer ipv4 etc? I don't see any reason why you have it not working as it already works even in inside container

7zx commented 2 months ago

I don't see any reason why you have it not working as it already works even in inside container

Because this is a bug and it should be reported? I've also included the ACME logs above... While the service is functional, the intention is for it to display my IPv4 and IPv6 on the Mailcow UI and operate with both IPv4 and IPv6 since both are enabled on my server and set on my DNS records and currently, this isn't fully reflected, which is why I'm trying to find out why this is happening.

Here are my ACME logs again:

image

dragoangel commented 2 months ago

Did you tried to reproduce same cli commands I referred couple of comments ago?

  local IPV6=
  local IPV6_SRCS=
  local TRY=
  IPV6_SRCS[0]="ip6.mailcow.email"
  IPV6_SRCS[1]="ip6.nevondo.com"
  until [[ ! -z ${IPV6} ]] || [[ ${TRY} -ge 10 ]]; do
    IPV6=$(curl --connect-timeout 3 -m 10 -L6s ${IPV6_SRCS[$RANDOM % ${#IPV6_SRCS[@]} ]} | grep "^\([0-9a-fA-F]\{0,4\}:\)\{1,7\}[0-9a-fA-F]\{0,4\}$")
    [[ ! -z ${TRY} ]] && sleep 1
    TRY=$((TRY+1))
  done
  echo ${IPV6}
7zx commented 2 months ago

What command? Isn't this from: https://github.com/mailcow/mailcow-dockerized/blob/36b5cccd186090d726de62b6b00d1e842e67aacd/data/Dockerfiles/acme/functions.sh#L54

dragoangel commented 2 months ago

Btw 2gb and 1 core? Sorry but you need expect ooms very strongly

7zx commented 2 months ago

Btw 2gb and 1 core? Sorry but you need expect ooms very strongly

How is this related to my IPv6 issue 😂? Also regarding the server specs, I receive and send over 100 emails daily without encountering any issues. The server operates smoothly despite running on 2GB RAM and 1 core.

dragoangel commented 2 months ago

Btw 2gb and 1 core? Sorry but you need expect ooms very strongly

How is this related to my IPv6 issue 😂? Also regarding the server specs, I receive and send over 100 emails daily without encountering any issues. The server operates smoothly despite running on 2GB RAM and 1 core.

It's not related. But any separate software from bunch mailcow contains by itself easily can consume all your ram, especially dovecot, rspamd, not speaking about clamav.

About your issue with ipv6 you still not tried what I asked or not provided details?

7zx commented 2 months ago

I didn’t understand what you want me to do, can you reformulate?

dragoangel commented 2 months ago

Just run commands one by one from function that get ipv6 in acme.sh, aka debug. On host and in container

7zx commented 2 months ago

Just run commands one by one from function that get ipv6 in acme.sh, aka debug. On host and in container

OK: 185.113.142.56, 0000:0000:0000:0000:0000:0000:0000:0000
Found AAAA record for autodiscover.polido.pt: 2a03:0:142:0:bad:c0de:39ac:29ad - skipping A record check
Cannot match your IP 0000:0000:0000:0000:0000:0000:0000:0000 against hostname autodiscover.polido.pt (DNS returned 2a03:0000:0142:0000:0bad:c0de:39ac:29ad)
Found AAAA record for autoconfig.polido.pt: 2a03:0:142:0:bad:c0de:39ac:29ad - skipping A record check
Cannot match your IP 0000:0000:0000:0000:0000:0000:0000:0000 against hostname autoconfig.polido.pt (DNS returned 2a03:0000:0142:0000:0bad:c0de:39ac:29ad)
Found AAAA record for mail.polido.pt: 2a03:0:142:0:bad:c0de:39ac:29ad - skipping A record check
Cannot match your IP 0000:0000:0000:0000:0000:0000:0000:0000 against hostname mail.polido.pt (DNS returned 2a03:0000:0142:0000:0bad:c0de:39ac:29ad)
Cannot validate any hostnames, skipping Let's Encrypt for 1 hour.
Use SKIP_LETS_ENCRYPT=y in mailcow.conf to skip it permanently.
dragoangel commented 2 months ago

What you have when doing just basic curl ip6.mailcow.email and curl ip6.nevondo.com?

7zx commented 2 months ago

What you have when doing just basic curl ip6.mailcow.email and curl ip6.nevondo.com?

timeout outside and inside the acme container

dragoangel commented 2 months ago

What you have when doing just basic curl ip6.mailcow.email and curl ip6.nevondo.com?

timeout outside and inside the acme container

Then this totally explains why mailcow can't detect IP. Did you contacted your ISP about that you can't reach this resources?

milkmaker commented 2 months ago

THIS IS A AUTOMATED MESSAGE!

It seems your issue is not a bug. Therefore we highly advise you to get support!

You can get support either by:

This issue will be closed. If you think your reported issue is not a support case feel free to comment above and if so the issue will reopened.

dragoangel commented 2 months ago

ups :D

anyway, it's really not a place to discuss network connectivity issues. You need get this ips working.

@DerLinkman is there is a chance that somebody could be banned on firewall etc in front of this resources? I think - no

milkmaker commented 2 days ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.