2025/09/12

因為之前用的rainloop webmail在今年的弱掃出現風險
但看起來作者已經不再更新維護了


找了找 目前大約只剩 roundcube webmail 還有維護更新


使用 docker


首先依官方的說明

docker run -e ROUNDCUBEMAIL_DEFAULT_HOST=mail -e ROUNDCUBEMAIL_SMTP_SERVER=mail -p 8000:80 -d roundcube/roundcubemail

啟動後可以收信 但不能寄信

查文件才發現預設的smtp不是連 25

所以改一下

docker run --restart=always -e ROUNDCUBEMAIL_DEFAULT_HOST=mail.aaa.tw -e ROUNDCUBEMAIL_SMTP_SERVER=mail.aaa.tw -e ROUNDCUBEMAIL_SMTP_PORT=25 -p 8888:80 -d roundcube/roundcubemail

指定 port 25

改完後 mail server 上的 log 是有連記錄了
但還是無法寄 出現如下問題








看起來是roundcube會強制使用認証

參考文件後 再改一下啟動參數

docker run --restart=always -e ROUNDCUBEMAIL_SMTP_PASS='' -e ROUNDCUBEMAIL_SMTP_USER='' -e ROUNDCUBEMAIL_SMTP_AUTH_TYPE='' -e ROUNDCUBEMAIL_DEFAULT_HOST=mail.aaa.tw -e ROUNDCUBEMAIL_SMTP_SERVER=mail.aaa.tw -e ROUNDCUBEMAIL_SMTP_PORT=25 -p 8888:80 -d roundcube/roundcubemail

但還是沒用
進到docker去看後才發現以下參數沒有被吃進去

ROUNDCUBEMAIL_SMTP_PASS=''
ROUNDCUBEMAIL_SMTP_USER='' 
ROUNDCUBEMAIL_SMTP_AUTH_TYPE=''

只能換另一個方法
先把原來的 config.inc.php 先 co出來

<?php
    $config['plugins'] = [];
    $config['log_driver'] = 'stdout';
    $config['zipdownload_selection'] = true;
    $config['des_key'] = 'dK8orO1JOTEWY';
    $config['enable_spellcheck'] = true;
    $config['spellcheck_engine'] = 'pspell';
    include(__DIR__ . '/config.docker.inc.php');

加入以上參數放在宿主 於啟動時帶入
檔案修改後如下

<?php
    $config['plugins'] = [];
    $config['log_driver'] = 'stdout';
    $config['zipdownload_selection'] = true;
    $config['des_key'] = 'dK8orO1JOTEWY';
    $config['enable_spellcheck'] = true;
    $config['spellcheck_engine'] = 'pspell';
    $config['smtp_auth_type'] = ''; 
    $config['smtp_user'] = '';
    $config['smtp_pass'] = '';
    include(__DIR__ . '/config.docker.inc.php');

修改參數啟動docker

docker run --restart=always -v /tmp/config.inc.php:/var/www/html/config/config.inc.php:ro -e ROUNDCUBEMAIL_DEFAULT_HOST=mail.aaa.tw -e ROUNDCUBEMAIL_SMTP_SERVER=mail.aaa.tw -e ROUNDCUBEMAIL_SMTP_PORT=25 -e ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE=25M -p 8888:80 -d roundcube/roundcubemail

寄信就沒問題了

沒有留言: