【问题标题】:RainLoop+tomav/docker-mailserver: Cannot connect to server from RainLoop Webmail clientRainLoop+tomav/docker-mailserver:无法从 RainLoop Webmail 客户端连接到服务器
【发布时间】:2018-06-30 07:23:07
【问题描述】:

首先,我按照以下指南进行操作:https://www.davd.eu/byecloud-building-a-mailserver-with-modern-webmail/

我正在尝试为我的服务器创建一个邮件服务器,但我想我会先在本地测试上述实现。确保我至少可以启动并运行所有东西,这样我就可以在服务器上尝试之前看到我应该期待什么。这是我所做的:

  1. 将“127.0.0.1 mail.fancydomain.tld”添加到“/etc/hosts”(我想从使用 mail.fancydomain.tld 开始,而不是邮件服务器所在的实际域,以尽量减少跟踪时的任何更改指南)
  2. 我创建了这个“docker-compose.yml”:

       version: "3"
    
        services:
          rainloop:
            image: hardware/rainloop
            links:
              - mail
            volumes:
              - ./data/rainloop:/rainloop/data
    
          mail:
            image: tvial/docker-mailserver:latest
            restart: always
            hostname: mail
            domainname: fancydomain.tld
            container_name: mail
            ports:
              - "25:25"
              - "143:143"
              - "587:587"
              - "993:993"
              - "4190:4190"
            volumes:
              - ./data/mail/data:/var/mail
              - ./data/mail/state:/var/mail-state
              - ./mail/config:/tmp/docker-mailserver/
              - ./data/entry/acme/acme-v01.api.letsencrypt.org/sites/mail.fancydomain.tld:/tmp/ssl:ro
            environment:
              - ENABLE_SPAMASSASSIN=1
              - ENABLE_CLAMAV=1
              - ENABLE_FAIL2BAN=1
              - ENABLE_POSTGREY=1
              - ONE_DIR=1
              - DMS_DEBUG=0
              - ENABLE_MANAGESIEVE=1
            cap_add:
              - NET_ADMIN
    
          entry:
            image: abiosoft/caddy:0.10.4
            restart: always
            privileged: true
            links:
              - rainloop
            ports:
              - "80:80"
              - "443:443"
            volumes:
              - ./entry/Caddyfile:/etc/Caddyfile
              - ./data/entry:/root/.caddy
    

    这个“docker-compose.yml”和前面提到的网站提供的有一点不同。我所做的只是按照指南中针对仅在本地运行它的人的指示删除以“SSL_”为前缀的环境变量。

  3. 我在当前工作目录中创建了一个名为“entry”的目录,并创建了一个包含以下内容的“Caddyfile”:

       http://mail.fancydomain.tld {
            proxy / rainloop:8888 {
                transparent
            }
        }
    

    同样,与网站上提供的内容略有不同。出于与第 2 步相同的原因,我在域前加上了“http://”。

  4. 我用docker-compose up -d成功启动了容器
  5. 我跑了:curl -o setup.sh https://raw.githubusercontent.com/tomav/docker-mailserver/master/setup.sh; chmod a+x ./setup.sh 来获取设置脚本。
  6. 我使用这些确切的凭据运行:./setup.sh email add webmaster@fancydomain.tld fancypassword,再次最小化要跟踪的更改。
  7. 我通过运行 ./setup.sh config dkim 设置了 DKIM 记录,但我没有进一步处理这些记录...因为我不确定如何在本地处理这些记录。
  8. 我通过“http://mail.fancydomain.tld/”成功连接到 RainLoop Webmail 客户端,然后继续使用“http://mail.fancydomain.tld/?admin”使用凭据登录:Login=admin Password=12345
  9. 我继续“域”>“添加域”并使用这样填写表格:

    Name: fancydomain.tld
        IMAP
          Server: mail
          Port: 143
          Secure: STARTTLS
        SMTP
          Server: mail
          Port: 587
          Secure: STARTTLS
          Use short login: Checked
          Use authentication: Checked
        SIEVE
          Allow sieve scripts: Checked
          Server: mail
          Port: 4190
          Secure: STARTTLS
    
  10. 从这里我返回到“http://mail.fancydomain.tld”并尝试使用以下登录名登录 Webmail 客户端:Login=webmaster@fancydomain.tld Password=fancypassword

这是我得到错误的地方:“无法连接到服务器”

我不知道从这里去哪里。我完全不知道如何排除故障。我可以就我应该做些什么来排除故障并找出错误所在获得一些帮助吗?

谢谢!

2018 年 7 月 1 日更新:所以...我将“127.0.0.1 邮件”添加到“/etc/hosts”中,并且成功了! RainLoop 现在可以连接到我的邮件服务器了!但这带来了一个新问题。对于第 9 步,我尝试使用“mail.fancydomain.tld”而不是三个“服务器”字段的“邮件”,根据测试,连接被拒绝。为什么整个域会拒绝连接,而短域则不会?

【问题讨论】:

    标签: docker docker-compose mail-server


    【解决方案1】:

    解决方案是确保两个容器 RainLoop 和 Mail 共享一个桥接网络。那么所有的配置都可以保持不变。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-08-06
      • 1970-01-01
      • 2012-10-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多