lejmr/iredmail-docker

Every new start of container resets Postmaster's password

Closed this issue · 2 comments

I changed password via User Interface Settings, but when I restarted container again via docker-compose up the password is reset to the one which is provided in my docker-compose file (i.e. password):

version: '3.5'
services:
  iredmail:
    image: lejmr/iredmail:mysql-latest
    container_name: iredmail-container
    restart: unless-stopped
    hostname: mail.example.com
    privileged: yes
    ports:
      - "25:25"
      - "587:587"
    volumes:
      - /var/www/mail/mysql:/var/lib/mysql
      - /var/www/mail/vmail:/var/vmail
      - /var/www/mail/clamav:/var/lib/clamav
      - /etc/localtime:/etc/localtime:ro
    environment:
      - MYSQL_ROOT_PASSWORD=password
      - POSTMASTER_PASSWORD={PLAIN}password
      - IREDAPD_PLUGINS="['reject_null_sender', 'reject_sender_login_mismatch', 'greylisting', 'throttle', 'amavisd_wblist', 'sql_alias_access_policy']"
      - VIRTUAL_HOST=mail.example.com
      - VIRTUAL_PORT=443
      - VIRTUAL_PROTO=https
      - LETSENCRYPT_HOST=mail.example.com
      - LETSENCRYPT_EMAIL=email@example.com

I think iredmail-docker should not reset password every new start, because of security concerns.

I have an idea on how to fix it but I don't know how to do this or if there will be unintended consequences. Find where the password is being saved. Create a volume for where the password is saved. Then when you remount, your use the volume over and over again. Thus password would persist through remounting.

lejmr commented

This is actually expected behaviour.. I kind of find it useful to have this option for situation when you forget your password.. Even though wiki page for situations when one forgets passwords can be prepared...