如何在mailcow禁用IPV6地址(三)

这是mailcow自建邮局系列的第三篇教程,对自建邮局感兴趣的朋友可以参考我前两篇文章:

当你的服务器不支持IPV6地址时可以禁用mailcow的IPV6监听,从而降低资源消耗(mailcow有启动一个IPV6 NAT的容器)和避免出现奇怪的问题,这篇文章将继续分享如何禁用mailcow的IPV6

禁用mailcow IPV6

修改docker-compose.yml,将:

enable_ipv6: true

修改为:

enable_ipv6: false

同时还需要禁用ipv6nat-mailcow 容器,在mailcow的目录下新建一个docker-compose.override.yml,并复制下面的内容保存:

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

然后重启容器:

docker-compose down
docker-compose up -d

在 unbound-mailcow 中禁用 IPv6,只需要修改data/conf/unbound/unbound.conf这个配置文件:

#将
do-ip6: yes
#修改为
do-ip6: no

然后重启对应容器:

docker-compose restart unbound-mailcow

接下来禁用postfix的IPV6,需要修改data/conf/postfix/extra.cf这个配置文件,改成下面的内容:

smtp_address_preference = ipv4
inet_protocols = ipv4

然后重启容器:

docker-compose restart postfix-mailcow

最后还需要修改nginx的监听,用下面的sed命令替换就行了:

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

其它说明

  1. 如果您的服务器支持IPV6,则无需禁用IPV6地址
  2. 修改文件前请注意备份配置文件
sanradar
sanradar
文章: 104

36 评论

  1. Hello there, just became aware of your blog through Google, and found that it is
    truly informative. I am gonna watch out for brussels.

    I will be grateful if you continue this in future.
    Numerous people will be benefited from your writing. Cheers!
    Lista escape room

  2. I was very happy to uncover this website. I need to to thank you for ones time due to this wonderful read!! I definitely loved every part of it and I have you saved to fav to see new things in your site.

  3. Hello there, I do believe your blog could be having browser compatibility issues. Whenever I take a look at your site in Safari, it looks fine but when opening in I.E., it has some overlapping issues. I just wanted to provide you with a quick heads up! Other than that, fantastic website.

  4. Hello there! I simply wish to give you a huge thumbs up for your great info you have got right here on this post. I’ll be returning to your site for more soon.

  5. Hello there! This blog post could not be written any better! Looking at this post reminds me of my previous roommate! He continually kept talking about this. I most certainly will send this post to him. Fairly certain he’ll have a very good read. Many thanks for sharing!

  6. Hi! I could have sworn I’ve visited this web site before but after going through a few of the posts I realized it’s new to me. Anyhow, I’m definitely happy I stumbled upon it and I’ll be book-marking it and checking back regularly!

  7. Right here is the right website for anyone who wishes to find out about this topic. You know a whole lot its almost tough to argue with you (not that I really will need to…HaHa). You definitely put a new spin on a subject that’s been written about for years. Great stuff, just great.

  8. May I just say what a relief to discover somebody that genuinely knows what they are talking about over the internet. You actually realize how to bring an issue to light and make it important. A lot more people should read this and understand this side of your story. I can’t believe you’re not more popular since you certainly have the gift.

  9. I’m extremely pleased to uncover this great site. I need to to thank you for ones time for this fantastic read!! I definitely really liked every bit of it and i also have you saved as a favorite to see new things in your blog.

  10. Hi there! I just would like to give you a huge thumbs up for your excellent info you have got here on this post. I will be returning to your web site for more soon.

  11. This is a really good tip particularly to those new to the blogosphere. Brief but very precise info… Many thanks for sharing this one. A must read post.

  12. Aw, this was an incredibly nice post. Taking the time and actual effort to produce a superb article… but what can I say… I put things off a whole lot and never manage to get anything done.

  13. Hello! Do you know if they make any plugins to help with SEO?
    I’m trying to get my blog to rank for some targeted keywords but I’m
    not seeing very good success. If you know of any please share.
    Appreciate it! You can read similar text here: Eco blankets

  14. Oh my goodness! Impressive article dude! Thank you so much, However I am having issues with your RSS. I don’t understand why I am unable to join it. Is there anyone else getting similar RSS issues? Anyone who knows the answer can you kindly respond? Thanks.

  15. Way cool! Some extremely valid points! I appreciate you writing this write-up and also the rest of the site is also very good.

  16. I have to thank you for the efforts you have put in writing this website. I’m hoping to view the same high-grade blog posts from you later on as well. In truth, your creative writing abilities has motivated me to get my own, personal site now 😉

  17. Good post. I learn something totally new and challenging on websites I stumbleupon every day. It’s always helpful to read content from other writers and practice something from other websites.

  18. Oh my goodness! Incredible article dude! Thanks, However I am experiencing troubles with your RSS. I don’t understand the reason why I am unable to join it. Is there anyone else getting the same RSS problems? Anybody who knows the solution will you kindly respond? Thanx.

  19. Your style is so unique in comparison to other people I’ve read stuff from. Thank you for posting when you have the opportunity, Guess I’ll just bookmark this site.

留下评论

您的邮箱地址不会被公开。 必填项已用 * 标注