docker icon indicating copy to clipboard operation
docker copied to clipboard

POSTFIXADMIN_SETUP_PASSWORD does nothing

Open alaw005 opened this issue 1 year ago • 2 comments

I set the POSTFIXADMIN_SETUP_PASSWORD using environment variable but this appears to do nothing as I can't login to setup.php page using the specified password.

alaw005 avatar May 28 '23 00:05 alaw005

The following is a work around

Install using docker compose

docker-compose.yml file is

ersion: "3.9"

services:

  postfixadmin:
    image: postfixadmin
    ports:
      - "8080:80"
    environment:
      POSTFIXADMIN_DB_TYPE: sqlite
    volumes:
      - dovecot-postfixadmin:/var/www

  dovecot:
    image: dovecot/dovecot:2.3.20
    ports:
      - "143:143"
    volumes:
      - dovecot-config:/etc/dovecot
      - dovecot-mail:/srv/mail

volumes:
  dovecot-config:
  dovecot-mail:
  dovecot-postfixadmin:

Note the POSTFIXADMIN_SETUP_PASSWORD environment variable for specifying a setup_password does not work so need to do the following to generate it and get postfixadmin going.

docker compose up -d

Navigate to webpage

http://dockerhost.local:8080/setup.php

Enter setup password in relevant section

Copy the hash generated

Edit /var/www/html/config.local.php from the volume created by docker compose

(or connect to container and edit within container)

Add the generated hash to relevant row:

$CONF['setup_password'] = 'copiedhashfromabove';

Now restart docker (noting will only be saved if using volumes)

You can now connect to the setup.php page again and create and admin user

http://dockerhost.local:8080/setup.php

Once admin user is created can log into postfix admin using

http://dockerhost.local:8080

alaw005 avatar May 28 '23 00:05 alaw005

You have set the environment variable to copiedhashfromabove. Not to the plain text password.

CodeWithMa avatar May 28 '23 16:05 CodeWithMa