lejmr/iredmail-docker

hostname error and cant' login into iredadmin

Closed this issue · 1 comments

uwla commented

Hello!
I've just got an icu domain and I'm trying to setup iRedmail under mail.mydomain.icu. There are two problems though:

  • For some reason, the container is thinking that my domain is icu, but it should be mydomain.icu. For example, when I log in into Roundcube I have to use postmaster@icu. I expected it to be postmaster@mydomain.icu
  • Can't login into iredadmin. It seems like there is no iredadmin user. It's frustating

Here are some useful information from the container's shell:

[root@andre iredmail]# mysql -u root

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.65-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> select username,password from vmail.mailbox;
+----------------+-----------------------------+
| username       | password                    |
+----------------+-----------------------------+
| postmaster@icu | {PLAIN}passwordplaceholder  |
+----------------+-----------------------------+
1 row in set (0.00 sec)

MariaDB [(none)]> select * from vmail.domain_admins;
+----------------+--------+---------------------+---------------------+---------------------+--------+
| username       | domain | created             | modified            | expired             | active |
+----------------+--------+---------------------+---------------------+---------------------+--------+
| postmaster@icu | ALL    | 2020-08-08 18:54:45 | 1970-01-01 01:01:01 | 9999-12-31 00:00:00 |      1 |
+----------------+--------+---------------------+---------------------+---------------------+--------+
1 row in set (0.00 sec)

MariaDB [(none)]>  select * from sogo.users;
+----------------+----------------+-----------------------------+------------+----------------+--------+
| c_uid          | c_name         | c_password                  | c_cn       | mail           | domain |
+----------------+----------------+-----------------------------+------------+----------------+--------+
| postmaster@icu | postmaster@icu | {PLAIN}passwordplaceholder  | postmaster | postmaster@icu | icu    |
+----------------+----------------+-----------------------------+------------+----------------+--------+
1 row in set (0.01 sec)

MariaDB [(none)]>  select username from roundcubemail.users;
+----------------+
| username       |
+----------------+
| postmaster@icu |
+----------------+
1 row in set (0.00 sec)

MariaDB [(none)]> select * from vmail.admin;
Empty set (0.01 sec)

Here is docker-compose.yml

version: '3.5'
services:
  iredmail:
    image: lejmr/iredmail:mysql-latest
    container_name: iredmail
    restart: unless-stopped
    hostname: ${DOMAIN}
    privileged: yes
    ports:
      - "25:25"
      - "587:587"
    volumes:
      - ${PATH_MYSQL}/var/lib/mysql
      - ${PATH_VMAIL}/var/vmail
      - ${PATH_CLAMAV}:/var/lib/clamav
      - /etc/localtime:/etc/localtime:ro
    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - POSTMASTER_PASSWORD={PLAIN}${POSTMASTER_PASSWORD}
      - IREDAPD_PLUGINS="['reject_null_sender', 'reject_sender_login_mismatch', 'greylisting', 'throttle', 'amavisd_wblist', 'sql_alias_access_policy']"
      - VIRTUAL_HOST=${VIRTUAL_HOST}
      - VIRTUAL_PORT=${VIRTUAL_PORT}
      - VIRTUAL_PROTO=${VIRTUAL_PROTO}
      - SSL_POLICY=Mozilla-Modern
      - LETSENCRYPT_HOST=${LETSENCRYPT_HOST}
      - LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}

networks:
   default:
     external:
       name: ${NETWORK}

The .env file

MYSQL_ROOT_PASSWORD=passwordplaceholder
POSTMASTER_PASSWORD=passwordplaceholder
DOMAIN=mydomain.icu
VIRTUAL_HOST=mail.mydomain.icu
VIRTUAL_PORT=443
VIRTUAL_PROTO=https
LETSENCRYPT_HOST=mail.mydomain.icu
LETSENCRYPT_EMAIL=myemail@gmail.com
NETWORK=proxy
PATH_MYSQL=/mnt/block_storage1/iredmail/mysql
PATH_CLAMAV=/mnt/block_storage1/iredmail/clamav
PATH_VMAIL=/mnt/block_storage1/iredmail/vmail

Please help me. I've been trying to solve this for quite a while. I've checked out iredmail forum but still could not get it running

uwla commented

I solved the problem by changing DOMAIN from mydomain.icu to mail.mydomain.icu
I can't believe it was something so simple.... I hope this thread helps someone