[SOGo] SOGo refuses to bind to IPv6, so force IPv4 in proxy_pass, fixes #1006
This commit is contained in:
		
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -3,8 +3,7 @@ data/conf/sogo/sieve.creds
 | 
				
			|||||||
data/conf/dovecot/dovecot-master.passwd
 | 
					data/conf/dovecot/dovecot-master.passwd
 | 
				
			||||||
mailcow.conf
 | 
					mailcow.conf
 | 
				
			||||||
mailcow.conf_backup
 | 
					mailcow.conf_backup
 | 
				
			||||||
data/conf/nginx/listen*active
 | 
					data/conf/nginx/*.active
 | 
				
			||||||
data/conf/nginx/server_name.active
 | 
					 | 
				
			||||||
data/conf/postfix/sql
 | 
					data/conf/postfix/sql
 | 
				
			||||||
data/conf/dovecot/sql
 | 
					data/conf/dovecot/sql
 | 
				
			||||||
data/conf/nextcloud-*.bak
 | 
					data/conf/nextcloud-*.bak
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -101,7 +101,7 @@ server {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  location ^~ /Microsoft-Server-ActiveSync {
 | 
					  location ^~ /Microsoft-Server-ActiveSync {
 | 
				
			||||||
    proxy_pass http://sogo:20000/SOGo/Microsoft-Server-ActiveSync;
 | 
					    include /etc/nginx/conf.d/sogo_eas.active;
 | 
				
			||||||
    proxy_connect_timeout 1000;
 | 
					    proxy_connect_timeout 1000;
 | 
				
			||||||
    proxy_next_upstream timeout error;
 | 
					    proxy_next_upstream timeout error;
 | 
				
			||||||
    proxy_send_timeout 1000;
 | 
					    proxy_send_timeout 1000;
 | 
				
			||||||
@@ -123,7 +123,7 @@ server {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  location ^~ /SOGo {
 | 
					  location ^~ /SOGo {
 | 
				
			||||||
    proxy_pass http://sogo:20000;
 | 
					    include /etc/nginx/conf.d/sogo.active;
 | 
				
			||||||
    proxy_set_header X-Real-IP $remote_addr;
 | 
					    proxy_set_header X-Real-IP $remote_addr;
 | 
				
			||||||
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 | 
					    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 | 
				
			||||||
    proxy_set_header Host $http_host;
 | 
					    proxy_set_header Host $http_host;
 | 
				
			||||||
@@ -283,7 +283,7 @@ server {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  location ^~ /Microsoft-Server-ActiveSync {
 | 
					  location ^~ /Microsoft-Server-ActiveSync {
 | 
				
			||||||
    proxy_pass http://sogo:20000/SOGo/Microsoft-Server-ActiveSync;
 | 
					    include /etc/nginx/conf.d/templates/sogo_proxy.template;
 | 
				
			||||||
    proxy_connect_timeout 1000;
 | 
					    proxy_connect_timeout 1000;
 | 
				
			||||||
    proxy_next_upstream timeout error;
 | 
					    proxy_next_upstream timeout error;
 | 
				
			||||||
    proxy_send_timeout 1000;
 | 
					    proxy_send_timeout 1000;
 | 
				
			||||||
@@ -305,7 +305,7 @@ server {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  location ^~ /SOGo {
 | 
					  location ^~ /SOGo {
 | 
				
			||||||
    proxy_pass http://sogo:20000;
 | 
					    include /etc/nginx/conf.d/sogo.active;
 | 
				
			||||||
    proxy_set_header X-Real-IP $remote_addr;
 | 
					    proxy_set_header X-Real-IP $remote_addr;
 | 
				
			||||||
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 | 
					    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 | 
				
			||||||
    proxy_set_header Host $http_host;
 | 
					    proxy_set_header Host $http_host;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								data/conf/nginx/templates/sogo.template
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								data/conf/nginx/templates/sogo.template
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					proxy_pass http://${IPV4_NETWORK}.248:20000;
 | 
				
			||||||
							
								
								
									
										1
									
								
								data/conf/nginx/templates/sogo_eas.template
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								data/conf/nginx/templates/sogo_eas.template
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					proxy_pass http://${IPV4_NETWORK}.248:20000/SOGo/Microsoft-Server-ActiveSync;
 | 
				
			||||||
							
								
								
									
										0
									
								
								data/conf/nginx/templates/sogo_proxy.template
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								data/conf/nginx/templates/sogo_proxy.template
									
									
									
									
									
										Normal file
									
								
							@@ -14,7 +14,7 @@ services:
 | 
				
			|||||||
        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
					        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
				
			||||||
      networks:
 | 
					      networks:
 | 
				
			||||||
        mailcow-network:
 | 
					        mailcow-network:
 | 
				
			||||||
          ipv4_address: ${IPV4_NETWORK}.254
 | 
					          ipv4_address: ${IPV4_NETWORK:-172.22.1}.254
 | 
				
			||||||
          aliases:
 | 
					          aliases:
 | 
				
			||||||
            - unbound
 | 
					            - unbound
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -31,7 +31,7 @@ services:
 | 
				
			|||||||
        - MYSQL_PASSWORD=${DBPASS}
 | 
					        - MYSQL_PASSWORD=${DBPASS}
 | 
				
			||||||
      restart: always
 | 
					      restart: always
 | 
				
			||||||
      dns:
 | 
					      dns:
 | 
				
			||||||
        - ${IPV4_NETWORK}.254
 | 
					        - ${IPV4_NETWORK:-172.22.1}.254
 | 
				
			||||||
      ports:
 | 
					      ports:
 | 
				
			||||||
        - "${SQL_PORT:-127.0.0.1:13306}:3306"
 | 
					        - "${SQL_PORT:-127.0.0.1:13306}:3306"
 | 
				
			||||||
      sysctls:
 | 
					      sysctls:
 | 
				
			||||||
@@ -49,12 +49,12 @@ services:
 | 
				
			|||||||
      environment:
 | 
					      environment:
 | 
				
			||||||
        - TZ=${TZ}
 | 
					        - TZ=${TZ}
 | 
				
			||||||
      dns:
 | 
					      dns:
 | 
				
			||||||
        - ${IPV4_NETWORK}.254
 | 
					        - ${IPV4_NETWORK:-172.22.1}.254
 | 
				
			||||||
      sysctls:
 | 
					      sysctls:
 | 
				
			||||||
        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
					        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
				
			||||||
      networks:
 | 
					      networks:
 | 
				
			||||||
        mailcow-network:
 | 
					        mailcow-network:
 | 
				
			||||||
          ipv4_address: ${IPV4_NETWORK}.249
 | 
					          ipv4_address: ${IPV4_NETWORK:-172.22.1}.249
 | 
				
			||||||
          aliases:
 | 
					          aliases:
 | 
				
			||||||
            - redis
 | 
					            - redis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -68,7 +68,7 @@ services:
 | 
				
			|||||||
      volumes:
 | 
					      volumes:
 | 
				
			||||||
        - ./data/conf/clamav/:/etc/clamav/
 | 
					        - ./data/conf/clamav/:/etc/clamav/
 | 
				
			||||||
      dns:
 | 
					      dns:
 | 
				
			||||||
        - ${IPV4_NETWORK}.254
 | 
					        - ${IPV4_NETWORK:-172.22.1}.254
 | 
				
			||||||
      sysctls:
 | 
					      sysctls:
 | 
				
			||||||
        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
					        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
				
			||||||
      networks:
 | 
					      networks:
 | 
				
			||||||
@@ -94,7 +94,7 @@ services:
 | 
				
			|||||||
      sysctls:
 | 
					      sysctls:
 | 
				
			||||||
        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
					        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
				
			||||||
      dns:
 | 
					      dns:
 | 
				
			||||||
        - ${IPV4_NETWORK}.254
 | 
					        - ${IPV4_NETWORK:-172.22.1}.254
 | 
				
			||||||
      hostname: rspamd
 | 
					      hostname: rspamd
 | 
				
			||||||
      networks:
 | 
					      networks:
 | 
				
			||||||
        mailcow-network:
 | 
					        mailcow-network:
 | 
				
			||||||
@@ -135,7 +135,7 @@ services:
 | 
				
			|||||||
      sysctls:
 | 
					      sysctls:
 | 
				
			||||||
        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
					        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
				
			||||||
      dns:
 | 
					      dns:
 | 
				
			||||||
        - ${IPV4_NETWORK}.254
 | 
					        - ${IPV4_NETWORK:-172.22.1}.254
 | 
				
			||||||
      networks:
 | 
					      networks:
 | 
				
			||||||
        mailcow-network:
 | 
					        mailcow-network:
 | 
				
			||||||
          aliases:
 | 
					          aliases:
 | 
				
			||||||
@@ -157,9 +157,10 @@ services:
 | 
				
			|||||||
      sysctls:
 | 
					      sysctls:
 | 
				
			||||||
        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
					        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
				
			||||||
      dns:
 | 
					      dns:
 | 
				
			||||||
        - ${IPV4_NETWORK}.254
 | 
					        - ${IPV4_NETWORK:-172.22.1}.254
 | 
				
			||||||
      networks:
 | 
					      networks:
 | 
				
			||||||
        mailcow-network:
 | 
					        mailcow-network:
 | 
				
			||||||
 | 
					          ipv4_address: ${IPV4_NETWORK:-172.22.1}.248
 | 
				
			||||||
          aliases:
 | 
					          aliases:
 | 
				
			||||||
            - sogo
 | 
					            - sogo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -195,7 +196,7 @@ services:
 | 
				
			|||||||
          soft: 20000
 | 
					          soft: 20000
 | 
				
			||||||
          hard: 40000
 | 
					          hard: 40000
 | 
				
			||||||
      dns:
 | 
					      dns:
 | 
				
			||||||
        - ${IPV4_NETWORK}.254
 | 
					        - ${IPV4_NETWORK:-172.22.1}.254
 | 
				
			||||||
      sysctls:
 | 
					      sysctls:
 | 
				
			||||||
        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
					        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
				
			||||||
      hostname: ${MAILCOW_HOSTNAME}
 | 
					      hostname: ${MAILCOW_HOSTNAME}
 | 
				
			||||||
@@ -226,7 +227,7 @@ services:
 | 
				
			|||||||
        - "${SUBMISSION_PORT:-587}:587"
 | 
					        - "${SUBMISSION_PORT:-587}:587"
 | 
				
			||||||
      restart: always
 | 
					      restart: always
 | 
				
			||||||
      dns:
 | 
					      dns:
 | 
				
			||||||
        - ${IPV4_NETWORK}.254
 | 
					        - ${IPV4_NETWORK:-172.22.1}.254
 | 
				
			||||||
      sysctls:
 | 
					      sysctls:
 | 
				
			||||||
        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
					        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
				
			||||||
      hostname: ${MAILCOW_HOSTNAME}
 | 
					      hostname: ${MAILCOW_HOSTNAME}
 | 
				
			||||||
@@ -241,7 +242,7 @@ services:
 | 
				
			|||||||
      sysctls:
 | 
					      sysctls:
 | 
				
			||||||
        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
					        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
				
			||||||
      dns:
 | 
					      dns:
 | 
				
			||||||
        - ${IPV4_NETWORK}.254
 | 
					        - ${IPV4_NETWORK:-172.22.1}.254
 | 
				
			||||||
      networks:
 | 
					      networks:
 | 
				
			||||||
        mailcow-network:
 | 
					        mailcow-network:
 | 
				
			||||||
          aliases:
 | 
					          aliases:
 | 
				
			||||||
@@ -256,6 +257,8 @@ services:
 | 
				
			|||||||
      command: /bin/sh -c "envsubst < /etc/nginx/conf.d/templates/listen_plain.template > /etc/nginx/conf.d/listen_plain.active &&
 | 
					      command: /bin/sh -c "envsubst < /etc/nginx/conf.d/templates/listen_plain.template > /etc/nginx/conf.d/listen_plain.active &&
 | 
				
			||||||
        envsubst < /etc/nginx/conf.d/templates/listen_ssl.template > /etc/nginx/conf.d/listen_ssl.active &&
 | 
					        envsubst < /etc/nginx/conf.d/templates/listen_ssl.template > /etc/nginx/conf.d/listen_ssl.active &&
 | 
				
			||||||
        envsubst < /etc/nginx/conf.d/templates/server_name.template > /etc/nginx/conf.d/server_name.active &&
 | 
					        envsubst < /etc/nginx/conf.d/templates/server_name.template > /etc/nginx/conf.d/server_name.active &&
 | 
				
			||||||
 | 
					        envsubst < /etc/nginx/conf.d/templates/sogo.template > /etc/nginx/conf.d/sogo.active &&
 | 
				
			||||||
 | 
					        envsubst < /etc/nginx/conf.d/templates/sogo_eas.template > /etc/nginx/conf.d/sogo_eas.active &&
 | 
				
			||||||
        nginx -qt &&
 | 
					        nginx -qt &&
 | 
				
			||||||
        until ping phpfpm -c1 > /dev/null; do sleep 1; done &&
 | 
					        until ping phpfpm -c1 > /dev/null; do sleep 1; done &&
 | 
				
			||||||
        until ping sogo -c1 > /dev/null; do sleep 1; done &&
 | 
					        until ping sogo -c1 > /dev/null; do sleep 1; done &&
 | 
				
			||||||
@@ -265,6 +268,7 @@ services:
 | 
				
			|||||||
        - HTTPS_PORT=${HTTPS_PORT:-443}
 | 
					        - HTTPS_PORT=${HTTPS_PORT:-443}
 | 
				
			||||||
        - HTTP_PORT=${HTTP_PORT:-80}
 | 
					        - HTTP_PORT=${HTTP_PORT:-80}
 | 
				
			||||||
        - MAILCOW_HOSTNAME=${MAILCOW_HOSTNAME}
 | 
					        - MAILCOW_HOSTNAME=${MAILCOW_HOSTNAME}
 | 
				
			||||||
 | 
					        - IPV4_NETWORK=
 | 
				
			||||||
      volumes:
 | 
					      volumes:
 | 
				
			||||||
        - ./data/web:/web:ro
 | 
					        - ./data/web:/web:ro
 | 
				
			||||||
        - ./data/conf/rspamd/dynmaps:/dynmaps:ro
 | 
					        - ./data/conf/rspamd/dynmaps:/dynmaps:ro
 | 
				
			||||||
@@ -278,7 +282,7 @@ services:
 | 
				
			|||||||
      sysctls:
 | 
					      sysctls:
 | 
				
			||||||
        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
					        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
				
			||||||
      dns:
 | 
					      dns:
 | 
				
			||||||
        - ${IPV4_NETWORK}.254
 | 
					        - ${IPV4_NETWORK:-172.22.1}.254
 | 
				
			||||||
      networks:
 | 
					      networks:
 | 
				
			||||||
        mailcow-network:
 | 
					        mailcow-network:
 | 
				
			||||||
          aliases:
 | 
					          aliases:
 | 
				
			||||||
@@ -293,7 +297,7 @@ services:
 | 
				
			|||||||
      sysctls:
 | 
					      sysctls:
 | 
				
			||||||
        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
					        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
				
			||||||
      dns:
 | 
					      dns:
 | 
				
			||||||
        - ${IPV4_NETWORK}.254
 | 
					        - ${IPV4_NETWORK:-172.22.1}.254
 | 
				
			||||||
      environment:
 | 
					      environment:
 | 
				
			||||||
        - LOG_LINES=${LOG_LINES}
 | 
					        - LOG_LINES=${LOG_LINES}
 | 
				
			||||||
        - ADDITIONAL_SAN=${ADDITIONAL_SAN}
 | 
					        - ADDITIONAL_SAN=${ADDITIONAL_SAN}
 | 
				
			||||||
@@ -327,13 +331,13 @@ services:
 | 
				
			|||||||
      privileged: true
 | 
					      privileged: true
 | 
				
			||||||
      environment:
 | 
					      environment:
 | 
				
			||||||
        - TZ=${TZ}
 | 
					        - TZ=${TZ}
 | 
				
			||||||
        - IPV4_NETWORK=${IPV4_NETWORK}
 | 
					        - IPV4_NETWORK=${IPV4_NETWORK:-172.22.1}
 | 
				
			||||||
        - SNAT_TO_SOURCE=${SNAT_TO_SOURCE:-n}
 | 
					        - SNAT_TO_SOURCE=${SNAT_TO_SOURCE:-n}
 | 
				
			||||||
      network_mode: "host"
 | 
					      network_mode: "host"
 | 
				
			||||||
      sysctls:
 | 
					      sysctls:
 | 
				
			||||||
        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
					        - net.ipv6.conf.all.disable_ipv6=${SYSCTL_IPV6_DISABLED:-0}
 | 
				
			||||||
      dns:
 | 
					      dns:
 | 
				
			||||||
        - ${IPV4_NETWORK}.254
 | 
					        - ${IPV4_NETWORK:-172.22.1}.254
 | 
				
			||||||
      volumes:
 | 
					      volumes:
 | 
				
			||||||
        - /lib/modules:/lib/modules:ro
 | 
					        - /lib/modules:/lib/modules:ro
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -395,8 +399,8 @@ networks:
 | 
				
			|||||||
    ipam:
 | 
					    ipam:
 | 
				
			||||||
      driver: default
 | 
					      driver: default
 | 
				
			||||||
      config:
 | 
					      config:
 | 
				
			||||||
        - subnet: ${IPV4_NETWORK}.0/24
 | 
					        - subnet: ${IPV4_NETWORK:-172.22.1}.0/24
 | 
				
			||||||
        - subnet: ${IPV6_NETWORK}
 | 
					        - subnet: ${IPV6_NETWORK:-fd4d:6169:6c63:6f77::/64}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
volumes:
 | 
					volumes:
 | 
				
			||||||
  vmail-vol-1:
 | 
					  vmail-vol-1:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user