Roundcube Community Forum

 

RoundCube Docker and docker mail server not working

Started by zumo, September 30, 2024, 06:28:39 PM

Previous topic - Next topic

zumo

Hello,

I'm trying to configure roundcube docker with docker mail server, but I'm getting several errors.
Both containers are in the same network, but getting an error of "504 Gateway Time-out".
I've configured the `/etc/hosts` with all the DNS names it should not go to the GW IP address.
The weird part is sometimes it works and others times out.
Another issue is the plugin, I've followed the docker instructions but I don't understand why is not working.
Another situation is the `COMPOSER_ROOT_VERSION`, I don't believe that the version is correct.


Log snippet below.

roundcube  | roundcubemail found in /var/www/html - installing update...
roundcube  | Target installation already in version 1.6.9. Do you want to update again? (y/N)
roundcube  | Copying files to target location...done.
roundcube  |
roundcube  | Running update script at target...
roundcube  | ERROR: Failed to load plugin file /var/www/html/plugins/twofactor_gauthenticator/twofactor_gauthenticator.php
roundcube  | $config['imap_conn_options'] = array(
roundcube  |        'ssl' => array(
roundcube  |                'verify_peer' => false,
roundcube  | //              'verify_depth' => 3,
roundcube  | //              'cafile'      => '/etc/openssl/certs/ca.crt',
roundcube  |                ),
roundcube  | );
roundcube  | Executing database schema update.
roundcube  | /usr/bin/composer
roundcube  | Executing /usr/bin/composer to update dependencies...
roundcube  | Loading composer repositories with package information
roundcube  | Updating dependencies
roundcube  | Lock file operations: 0 installs, 1 update, 0 removals
roundcube  |  - Upgrading symfony/deprecation-contracts (v2.5.3 => v3.5.0)
roundcube  | Writing lock file
roundcube  | Installing dependencies from lock file
roundcube  | Package operations: 0 installs, 1 update, 0 removals
roundcube  |  - Downloading symfony/deprecation-contracts (v3.5.0)
roundcube  |  - Upgrading symfony/deprecation-contracts (v2.5.3 => v3.5.0): Extracting archive
roundcube  | Generating autoload files
roundcube  | 4 packages you are using are looking for funding.
roundcube  | Use the `composer fund` command to find out more!
roundcube  | No security vulnerability advisories found.
roundcube  | This instance of Roundcube is up-to-date.
roundcube  | Have fun!
roundcube  | All done.
roundcube  | Installing dependencies from lock file
roundcube  | Verifying lock file contents can be installed on current platform.
roundcube  | Nothing to install, update or remove
roundcube  | Generating optimized autoload files
roundcube  | 4 packages you are using are looking for funding.
roundcube  | Use the `composer fund` command to find out more!
roundcube  | wait-for-it.sh: waiting 30 seconds for mariadb:3306
roundcube  | wait-for-it.sh: mariadb:3306 is available after 0 seconds
roundcube  | Installing plugins from the list
roundcube  | Plugins: alexandregz/twofactor_gauthenticator,
roundcube  |
roundcube  | In PackageDiscoveryTrait.php line 339:
roundcube  |                                                                               
roundcube  |  Could not find a version of package alexandregz/twofactor_gauthenticator ma 
roundcube  |  tching your minimum-stability (stable). Require it with an explicit version 
roundcube  |    constraint allowing its desired stability.                                 
roundcube  |                                                                               
roundcube  |
roundcube  | require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-m|--minimal-changes] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>...]
roundcube  |
roundcube  | Write Docker config to /var/www/html/config/config.docker.inc.php
roundcube  | ERROR: Failed to load plugin file /var/www/html/plugins/twofactor_gauthenticator/twofactor_gauthenticator.php
roundcube  | Checking for database schema updates...
roundcube  | Generating locales (this might take a while)...
roundcube  |  en_US.UTF-8... done
roundcube  | Generation complete.
roundcube  | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.20.0.5. Set the 'ServerName' directive globally to suppress this message
roundcube  | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.20.0.5. Set the 'ServerName' directive globally to suppress this message
roundcube  | [Mon Sep 30 22:14:00.012656 2024] [mpm_prefork:notice] [pid 1:tid 1] AH00163: Apache/2.4.62 (Debian) PHP/8.1.29 configured -- resuming normal operations
roundcube  | [Mon Sep 30 22:14:00.012690 2024] [core:notice] [pid 1:tid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
roundcube  | errors: PHP Error: Failed to load plugin file /var/www/html/plugins/twofactor_gauthenticator/twofactor_gauthenticator.php in /var/www/html/program/lib/Roundcube/rcube_plugin_api.php on line 193 (GET /)
roundcube  | 172.16.0.254 - - [30/Sep/2024:22:14:06 +0000] "GET / HTTP/1.1" 200 2952 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"

...
roundcube  | errors: PHP Error: Failed to load plugin file /var/www/html/plugins/twofactor_gauthenticator/twofactor_gauthenticator.php in /var/www/html/program/lib/Roundcube/rcube_plugin_api.php on line 193 (POST /?_task=login&_action=login)
roundcube  | 172.16.0.254 - - [30/Sep/2024:22:15:17 +0000] "GET /favicon.ico HTTP/1.1" 200 1991 "https://webmail.***.**/?_task=login" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
roundcube  | errors: <d25f5445> IMAP Error: Login failed for zumo@***.** against mail.***.** from 172.16.0.254 (X-Forwarded-For: 192.168.255.2). Could not connect to ssl://mail.***.**:993: Connection timed out in /var/www/html/program/lib/Roundcube/rcube_imap.php on line 211 (POST /?_task=login&_action=login)
roundcube  | 172.16.0.254 - - [30/Sep/2024:22:14:47 +0000] "POST /?_task=login HTTP/1.1" 401 0 "https://webmail.***.**/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"

Docker compose file.

services:
  roundcube:
    image: roundcube/roundcubemail:latest
    container_name: roundcube
    restart: unless-stopped
    ports:
      - "8082:80"
    environment:
      - ROUNDCUBEMAIL_DEFAULT_HOST=${DEFAULT_HOST}
      - ROUNDCUBEMAIL_DEFAULT_PORT=993
      - ROUNDCUBEMAIL_SMTP_SERVER=${SMTP_SERVER}
      - ROUNDCUBEMAIL_SMTP_PORT=465
      - COMPOSER_ALLOW_SUPERUSER=1
      - ROUNDCUBEMAIL_USERNAME_DOMAIN=${USERNAME_DOMAIN}
      - ROUNDCUBEMAIL_INSTALL_PLUGINS=1
      - ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE=25M
      - ROUNDCUBEMAIL_COMPOSER_PLUGINS=alexandregz/twofactor_gauthenticator,
      - ROUNDCUBEMAIL_PLUGINS=twofactor_gauthenticator
      - COMPOSER_ROOT_VERSION=1.6.9
      - ROUNDCUBEMAIL_DB_TYPE=mysql
      - ROUNDCUBEMAIL_DB_HOST=${DB_HOST}
      - ROUNDCUBEMAIL_DB_PASSWORD=${DB_PASSWORD}
      - ROUNDCUBEMAIL_DB_USER=${DB_USER}
      - ROUNDCUBEMAIL_DB_PORT=3306
      - ROUNDCUBEMAIL_DB_NAME=${DB_NAME}
    volumes:
      - ./roundcube-data:/var/log/roundcube/log/data
      - ./roundcube-logs:/var/log/roundcube/log/logs
      - ./config/:/var/roundcube/config/
      - /etc/ssl/certs/ca-certificates.crt:/etc/openssl/certs/ca.crt
    networks:
      - dockermail_default
      - maria-db

volumes:
  roundcube-data:
  roundcube-logs:

networks:
  dockermail_default:
    external: true
  maria-db:
    external: true

Also I've added this code to the config hopping that it would be an issue with the CA, but no dice.

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

If anyone can provide a hint of what I'm I doing wrong, I would be grateful