diff --git a/.env.example b/.env.example index 63d19ec..3fc13c5 100644 --- a/.env.example +++ b/.env.example @@ -28,6 +28,8 @@ ROUNDCUBE_PORT=8091 # address when MAIL_HOSTNAME is unavailable from the Roundcube container. ROUNDCUBE_IMAP_HOST=${MAIL_HOSTNAME} ROUNDCUBE_SMTP_HOST=${MAIL_HOSTNAME} +# Set to true only for local testing with Stalwart's generated self-signed certificate. +ROUNDCUBE_ALLOW_SELF_SIGNED_CERT=false # Roundcube database RC_DB_NAME=roundcube diff --git a/README.md b/README.md index cc54a1d..1577e28 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ The real `.env` file is ignored by Git. Do not commit credentials or recovery se Roundcube uses `MAIL_HOSTNAME` for IMAP and SMTP submission by default. To connect Roundcube to Stalwart by IP instead, add `ROUNDCUBE_IMAP_HOST=` and `ROUNDCUBE_SMTP_HOST=` to `.env`. These change only Roundcube's IMAP and SMTP endpoints; `MAIL_HOSTNAME` remains the Stalwart hostname and Docker network alias. +For a local Stalwart test installation using its generated self-signed certificate, set `ROUNDCUBE_ALLOW_SELF_SIGNED_CERT=true` in `.env`. This disables certificate verification for Roundcube's IMAP and SMTP connections and must be set to `false` after configuring a trusted Stalwart certificate. + ## Generate a DES key On Linux or macOS: @@ -71,7 +73,7 @@ The default configuration expects the skin at: relative to this repository. Override the location in `.env` with `ROUNDCUBE_SKIN_PATH` if needed. The skin directory is mounted read-only and selected with `ROUNDCUBE_SKIN_NAME`. -The bundled `roundcube-config/eternity-logo.php` override sets the login logo to the Eternity skin's `images/logo.svg` through Roundcube's `static.php` asset endpoint. This is required because Eternity inherits Elastic's login template, which would otherwise display Elastic's default logo. Keep this file and its mount in `docker-compose.yml` when using the Eternity skin. +The bundled `roundcube-config/eternity-logo.php` override sets the login and mailbox logos to the Eternity skin's `images/logo.svg` through Roundcube's `static.php` asset endpoint. This is required because Eternity inherits Elastic's templates, which would otherwise display Elastic's default logo. Keep this file and its mount in `docker-compose.yml` when using the Eternity skin. ## Start and stop diff --git a/docker-compose.yml b/docker-compose.yml index c56e7dd..2b9d5b7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -79,6 +79,7 @@ services: volumes: - ${DATA_ROOT:-/opt/eternitymail}/roundcube-config:/var/roundcube/config - ./roundcube-config/eternity-logo.php:/var/roundcube/config/eternity-logo.php:ro + - ./roundcube-config/stalwart-tls.php:/var/roundcube/config/stalwart-tls.php:ro - ${ROUNDCUBE_SKIN_PATH:-../ep-roundcube-skin/eternity}:/var/www/html/skins/${ROUNDCUBE_SKIN_NAME:-eternity}:ro environment: @@ -96,6 +97,7 @@ services: ROUNDCUBEMAIL_SMTP_SERVER: tls://${ROUNDCUBE_SMTP_HOST:-${MAIL_HOSTNAME}} ROUNDCUBEMAIL_SMTP_PORT: 587 + ROUNDCUBE_ALLOW_SELF_SIGNED_CERT: ${ROUNDCUBE_ALLOW_SELF_SIGNED_CERT:-false} ROUNDCUBEMAIL_USERNAME_DOMAIN: ${MAIL_DOMAIN} diff --git a/roundcube-config/eternity-logo.php b/roundcube-config/eternity-logo.php index 80ac6af..fa2b815 100644 --- a/roundcube-config/eternity-logo.php +++ b/roundcube-config/eternity-logo.php @@ -1,5 +1,5 @@ 'static.php/skins/eternity/images/logo.svg', + '*' => 'static.php/skins/eternity/images/logo.svg', ]; \ No newline at end of file diff --git a/roundcube-config/stalwart-tls.php b/roundcube-config/stalwart-tls.php new file mode 100644 index 0000000..646df12 --- /dev/null +++ b/roundcube-config/stalwart-tls.php @@ -0,0 +1,12 @@ + false, + 'verify_peer_name' => false, + 'allow_self_signed' => true, + ]; + + $config['imap_conn_options'] = ['ssl' => $tls_options]; + $config['smtp_conn_options'] = ['ssl' => $tls_options]; +} \ No newline at end of file