Current location: home page > Linux O&M > How to disable IPV6 address in mailcow (3)

How to disable IPV6 address in mailcow (3)

Published on: August 17, 2022 Linux O&M 0 comments 9,970 views
This website provides Linux server operation and maintenance, automated script writing and other services. If you need, please contact the blogger on WeChat: xiaozme

This is the third tutorial in the mailcow self built post office series. For those who are interested in self built post offices, please refer to my previous two articles:

When your server does not support IPV6 addresses, you can disable IPV6 listening of mailcow to reduce resource consumption (mailcow has a container to start an IPV6 NAT) and avoid strange problems. This article will continue to share how to disable IPV6 of mailcow

Disable mailcow IPV6

modify docker-compose.yml , will:

 enable_ipv6: true

Revised as:

 enable_ipv6: false

You also need to disable the ipv6 nat mailcow container and create a new one in the mailcow directory docker-compose.override.yml , and copy the following content to save:

 version: '2.1' services: ipv6nat-mailcow: image: bash:latest restart: "no" entrypoint: ["echo", "ipv6nat disabled in compose.override.yml"]

Then restart the container:

 docker-compose down docker-compose up -d

Disable IPv6 in unbound mailcow, and only need to modify data/conf/unbound/unbound.conf This configuration file:

 #Set do-ip6: yes #Modify to do-ip6: no

Then restart the corresponding container:

 docker-compose restart unbound-mailcow

Next, disable the IPV6 of postfix. You need to modify it data/conf/postfix/extra.cf Change the configuration file to the following content:

 smtp_address_preference = ipv4 inet_protocols = ipv4

Then restart the container:

 docker-compose restart postfix-mailcow

Finally, you need to modify the listening of nginx and replace it with the following sed command:

 sed -i '/::/d' data/conf/nginx/listen_* sed -i '/::/d' data/conf/nginx/templates/listen* sed -i 's/,\[::\]//g' data/conf/dovecot/dovecot.conf sed -i 's/\[::\]://g' data/conf/nginx/dynmaps.conf sed -i 's/\[::\]://g' data/conf/phpfpm/php-fpm.d/pools.conf

Other instructions

  1. If your server supports IPV6, you do not need to disable the IPV6 address
  2. Please backup the configuration file before modifying the file
  3. Some contents of this article refer to: https://mailcow.github.io/mailcow-dockerized-docs/post_installation/firststeps-disable_ipv6/

If you need to build your own post office server, please contact my QQ:446199062 perhaps WeChat: xiaozme


Post reply

Your email address will not be disclosed. Required items have been used * tagging