将 Roundcube 与 docker-mailserver 集成

Integrating Roundcube with docker-mailserver

我尝试在我的服务器上设置一个 docker-mail 服务器,之后我尝试与 Mozilla Thunderbird 集成并且成功了

比起我尝试使用 roundcube 作为邮件客户端,但它给出了这样的日志响应错误:

Jul 13 05:24:28 mail dovecot: imap-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=172.18.0.1, lip=172.18.0.2, TLS handshaking: SSL_accept() failed: error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca: SSL alert number 48, session=<YSq2c/rGtLusEgAB>

有我的docker-compose.yml的roundcube

version: '2'

services:
  roundcubemail:
    image: roundcube/roundcubemail:latest
    container_name: roundcubemail
    volumes:
      - ./www:/var/www/html
    networks:
      - database-network
      - proxy
    environment:
      - ROUNDCUBEMAIL_DB_TYPE=mysql
      - ROUNDCUBEMAIL_DB_HOST=${DB_HOST}
      - ROUNDCUBEMAIL_DB_PORT=${DB_PORT}
      - ROUNDCUBEMAIL_DB_NAME=${DB_DATABASE}
      - ROUNDCUBEMAIL_DB_USER=${DB_USERNAME}
      - ROUNDCUBEMAIL_DB_PASSWORD=${DB_PASSWORD}
      - ROUNDCUBEMAIL_SKIN=elastic
      - ROUNDCUBEMAIL_DEFAULT_HOST=ssl://${APP_HOST}
      - ROUNDCUBEMAIL_DEFAULT_PORT=993
      - ROUNDCUBEMAIL_SMTP_SERVER=ssl://${APP_HOST}
      - ROUNDCUBEMAIL_SMTP_PORT=465
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.roundcubemail.entrypoints=http"
      - "traefik.http.routers.roundcubemail.rule=Host(`${APP_HOST}`)"
      - "traefik.http.middlewares.roundcubemail-https-redirect.redirectscheme.scheme=https"
      - "traefik.http.routers.roundcubemail.middlewares=roundcubemail-https-redirect"
      - "traefik.http.routers.roundcubemail-secure.entrypoints=https"
      - "traefik.http.routers.roundcubemail-secure.rule=Host(`${APP_HOST}`)"
      - "traefik.http.routers.roundcubemail-secure.tls=true"
      - "traefik.http.routers.roundcubemail-secure.tls.certresolver=http"
      - "traefik.http.routers.roundcubemail-secure.service=roundcubemail"
      - "traefik.http.services.roundcubemail.loadbalancer.server.port=80"
      - "traefik.docker.network=proxy"

networks:
  database-network:
    external: true
  proxy:
    external: true

将您的 roundcube 配置为接受自签名证书,因为默认情况下它不接受。您必须使 ca.crt 可用于 roundcube 服务器(启用 cafile 参数)或禁用对等验证(并保留 cafile 参数注释),编辑 config['imap_conn_options']变量:

$config['imap_conn_options'] = array(
    'ssl' => array(
    'verify_peer' => false,
    //  'verify_depth' => 3,
    //  'cafile'       => '/etc/openssl/certs/ca.crt',
    ),
);

此处确认的解决方案:https://www.roundcubeforum.net/index.php?topic=25321.0