roundcube / roundcubemail

The Roundcube Webmail suite
https://roundcube.net
GNU General Public License v3.0
5.91k stars 1.64k forks source link

SMTP not working when in same Docker Stack as Mailserver #9705

Open felixlabrot opened 3 hours ago

felixlabrot commented 3 hours ago

Prerequisites

Describe the issue

This is actually two bugs which occur uppon setup.

I have a Roundcube installation via Docker which is included in the same Docker Stack as the Mailserver is. It is possible to login and read mails.

No. 1: Attempting to delete an email results in the error message "UID MOVE: Account not found". Only after manually setting the "Deleted Items" folder in the special folder settings it works. This setting has to be done by every user manually. This is extremely problematic as explaining this to every new user is just insane and not practically doable.

No. 2: Also SMTP is in complete denial. When attempting to send an email it shows the message that it is working forever. No mail is sent and no error shows up. It just keeps loading forever.

This is the Docker Stack:

volumes:
  stalwart-data:
  roundcube-data:
  roundcube-database:

services:
  stalwartmail:
    container_name: stalwartmail
    image: stalwartlabs/mail-server:latest
    volumes:
      - stalwart-data:/opt/stalwart-mail
    ports:
      - 443:443
      - 8080:8080
      - 25:25
      - 587:587
      - 465:465
      - 143:143
      - 993:993
      - 4190:4190
      - 110:110
      - 995:995
    restart: always

  roundcube:
    container_name: roundcube-server
    image: roundcube/roundcubemail:latest-apache
    ports:
      - 8000:80
    volumes:
      - roundcube-data:/var/www/html
    environment:
      ROUNDCUBEMAIL_DEFAULT_HOST: stalwartmail
      ROUNDCUBEMAIL_DEFAULT_PORT: 143
      ROUNDCUBEMAIL_SMTP_SERVER: tls://stalwartmail
      ROUNDCUBEMAIL_SMTP_PORT: 465
      ROUNDCUBEMAIL_REQUEST_PATH: /
      ROUNDCUBEMAIL_PLUGINS: archive,zipdownload
      ROUNDCUBEMAIL_INSTALL_PLUGINS: true
      ROUNDCUBEMAIL_SKIN: elastic
      ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE: 10M
      ROUNDCUBEMAIL_DB_TYPE: mysql
      ROUNDCUBEMAIL_DB_HOST: roundcubedatabase
      ROUNDCUBEMAIL_DB_PORT: 3306
      ROUNDCUBEMAIL_DB_USER: roundcubemail
      ROUNDCUBEMAIL_DB_PASSWORD: xxxxxx
      ROUNDCUBEMAIL_DB_NAME: roundcubemail
    restart: always
    depends_on:
      - roundcubedatabase

  roundcubedatabase:
    container_name: roundcube-database
    image: mariadb:latest
    volumes:
      - roundcube-database:/var/lib/mysql
    environment:
      MARIADB_ROOT_PASSWORD: xxxxxx
      MARIADB_USER: roundcubemail
      MARIADB_PASSWORD: xxxxxx
      MARIADB_DATABASE: roundcubemail
    restart: always

I have manually added this config:

$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
$config['smtp_auth_type'] = 'PLAIN';
$config['smtp_conn_options'] = [
  'ssl' => [
    'verify_peer' => false,
    'peer_name' => 'mail.example.com',
  ]
];

The SMTP server expects plaintext authentication and runs in TLS mode with a valid certificate, but TLS doesn't work within Docker due to different hostnames.

What browser(s) are you seeing the problem on?

No response

What version of PHP are you using?

No response

What version of Roundcube are you using?

1.6.9

JavaScript errors

No response

PHP errors

No response

MrSuddenJoy commented 2 hours ago

This is extremely problematic as explaining this to every new user is just insane and not practically doable.

@felixlabrot why is this? Cannot you just put global anouncement?

felixlabrot commented 2 hours ago

This is extremely problematic as explaining this to every new user is just insane and not practically doable.

@felixlabrot why is this? Cannot you just put global anouncement?

That could be done but for something that should work out of the box (and does in Thunderbird) it is generally inacceptable to tell people to manually configure something for the possibility to delete mails. That is not user friendly for internal use. When using for customers it looks highly unprofessional that something this simple is broken on first login and has to be manually configured.