Giter Club home page Giter Club logo

docker's Introduction

GitHubBuild Coverage Status GitHub repo size IRC Chat - #postfixadmin

PostfixAdmin

An open source, web based interface for managing domains/mailboxes/aliases etc on a Postfix based mail server.

Integrates with :

  • Postfix
  • IMAP/POP3 server (e.g. Dovecot or Courier)
  • Database backend (choose one of: sqlite, mysql, postgresql)
  • Fetchmail (optional)

Features

  • Unlimited domains/aliases/mailboxes
  • Optional storage quota support
  • Optional password expiry (beta)
  • Multiple password hashing formats
  • Supports PostgreSQL, MySQL, MariaDB, SQLite database backends (choose one)
  • Supports retrieval of mail from a remote POP3 server (via fetchmail)
  • Vacation / Autoresponder / Out Of Office support
  • Users have the ability to login, change their password or vacation (out of office) status.
  • Integration with Squirrelmail / Roundcube (via plugins)
  • Optional XMLRPC based API
  • Supports PHP7.2+ (older versions of PHP should work with older releases)

Some screenshots of Postfixadmin in action (as admin and user)

Releases / Development note

  • While you can install PostfixAdmin from 'git' using the 'master' branch, 'master' is our main development version. It may work. It may contain funky new exciting stuff. It may "eat your data".
  • If you want an easy life, use a published release - see: https://github.com/postfixadmin/postfixadmin/releases or its branch (e.g. postfixadmin_3.3)
  • Latest significant changes should be listed in the appropriate CHANGELOG.TXT file.

Useful Links

Related Projects

  • https://github.com/aqeltech/Dockerised-GUI-Mailserver
  • https://github.com/mailserver2/mailserver mailserver2/mailserver is a simple and full-featured mail server build as a set of multiple docker images. Features: Postfix, PostfixAdmin, Dovecot, Rspamd, Clamav, Zeyple, Sieve, Fetchmail, Rainloop, Unbound/NSD, Træfik, {Let's Encrypt,custom,Self-signed Certificate} SSL, Supports PostgeSQL, MySQL, (beta) LDAP backends. Automated builds on DockerHub and Integration tests with Travis CI

docker's People

Contributors

bofh90 avatar davidgoodwin avatar j0wi avatar krufab avatar mathieupotier avatar qwc avatar ramank775 avatar srfrancia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

docker's Issues

default login

Maybe it's possible to implement a admin user with default credentials-
Actually I must create the first user over the database.

Alpine misses the tzdata package and does not handle timezone correctly

The fpm-alpine image misses the tzdata package and does not handle the timezone correctly, leading to inconsistent behavior compared to apache and fpm.

docker run --rm -it -e "TZ=Europe/Luxembourg" postfixadmin:fpm date
Fri Mar 27 22:49:49 CET 2020
docker run --rm -it -e "TZ=Europe/Luxembourg" postfixadmin:fpm-alpine date
Fri Mar 27 21:49:56 UTC 2020

Passwords should not be logged

On container startup, passwords are logged in plaintext. I've replaced them with REDACTED below, but they're plaintext. If you feel this is useful diagnostic information, please hide it behind a debug flag.

postfixadmin  | Postfixadmin not found in /var/www/html - copying now...
postfixadmin  | Complete! Postfixadmin has been successfully copied to /var/www/html
postfixadmin  | Write config to /var/www/html/config.local.php
postfixadmin  | <?php
postfixadmin  |                 $CONF['database_type'] = 'pgsql';
postfixadmin  |                 $CONF['database_host'] = 'REDACTED';
postfixadmin  |                 $CONF['database_port'] = '5432';
postfixadmin  |                 $CONF['database_user'] = 'postfixadmin';
postfixadmin  |                 $CONF['database_password'] = 'REDACTED';
postfixadmin  |                 $CONF['database_name'] = 'postfixadmin';
postfixadmin  |                 $CONF['setup_password'] = 'REDACTED';
postfixadmin  |                 $CONF['smtp_server'] = 'REDACTED';
postfixadmin  |                 $CONF['smtp_port'] = '25';
postfixadmin  |                 $CONF['encrypt'] = 'php_crypt:SHA512';
postfixadmin  |                 $CONF['configured'] = true;
postfixadmin  |                 ?>

curl: (52) Empty reply from server

hello mate.
I tried below on Amazon linux2:

git clone https://github.com/postfixadmin/docker.git
cd docker
cat << EOF > docker-compose.yml
version: '3'

services:
   db:
     image: mysql:5.7
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: notSecureChangeMe
       MYSQL_DATABASE: postfixadmin
       MYSQL_USER: postfixadmin
       MYSQL_PASSWORD: postfixadminPassword

   postfixadmin:
     depends_on:
       - db
     image: postfixadmin-image:latest
     ports:
       - "8000:80"
     restart: always
     environment:
       POSTFIXADMIN_DB_TYPE: mysqli
       POSTFIXADMIN_DB_HOST: db
       POSTFIXADMIN_DB_USER: postfixadmin
       POSTFIXADMIN_DB_NAME: postfixadmin
       POSTFIXADMIN_DB_PASSWORD: postfixadminPassword
       POSTFIXADMIN_SMTP_SERVER: postfix
       POSTFIXADMIN_SMTP_PORT: 25
EOF
docker build --pull --rm -t postfixadmin-image fpm
sudo /usr/local/bin/docker-compose up

then postfixadmin looked work fine. Butcurl localhost:8000showed sad result

curl: (52) Empty reply from server

I can't judge even from where the problem come.
hope this log helped you

log:
Creating docker_db_1 ... done                                                                                           Creating docker_postfixadmin_1 ... done                                                                                 Attaching to docker_db_1, docker_postfixadmin_1
db_1            | 2021-02-10 07:51:38+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
db_1            | 2021-02-10 07:51:38+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db_1            | 2021-02-10 07:51:38+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started.
db_1            | 2021-02-10 07:51:38+00:00 [Note] [Entrypoint]: Initializing database files
db_1            | 2021-02-10T07:51:38.549296Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
db_1            | 2021-02-10T07:51:38.549360Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
db_1            | 2021-02-10T07:51:38.549516Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
postfixadmin_1  | WARNING: setup.php password not set
postfixadmin_1  | Postfixadmin not found in /var/www/html - copying now...
postfixadmin_1  | Complete! Postfixadmin has been successfully copied to /var/www/html
postfixadmin_1  | bash: connect: Connection refused
postfixadmin_1  | bash: /dev/tcp/db/3306: Connection refused
db_1            | 2021-02-10T07:51:39.394160Z 0 [Warning] InnoDB: New log files created, LSN=45790
db_1            | 2021-02-10T07:51:39.630322Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
db_1            | 2021-02-10T07:51:39.700105Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: ceedcabd-6b74-11eb-8b37-0242ac120002.
db_1            | 2021-02-10T07:51:39.702078Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
postfixadmin_1  | bash: connect: Connection refused
postfixadmin_1  | bash: /dev/tcp/db/3306: Connection refused
db_1            | 2021-02-10T07:51:40.231595Z 0 [Warning] CA certificate ca.pem is self signed.
postfixadmin_1  | bash: connect: Connection refused
postfixadmin_1  | bash: /dev/tcp/db/3306: Connection refused
db_1            | 2021-02-10T07:51:40.494870Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
postfixadmin_1  | bash: connect: Connection refused
postfixadmin_1  | bash: /dev/tcp/db/3306: Connection refused
postfixadmin_1  | bash: connect: Connection refused
postfixadmin_1  | bash: /dev/tcp/db/3306: Connection refused
postfixadmin_1  | bash: connect: Connection refused
postfixadmin_1  | bash: /dev/tcp/db/3306: Connection refused
postfixadmin_1  | bash: connect: Connection refused
postfixadmin_1  | bash: /dev/tcp/db/3306: Connection refused
db_1            | 2021-02-10 07:51:42+00:00 [Note] [Entrypoint]: Database files initialized
db_1            | 2021-02-10 07:51:42+00:00 [Note] [Entrypoint]: Starting temporary server
db_1            | 2021-02-10 07:51:42+00:00 [Note] [Entrypoint]: Waiting for server startup
db_1            | 2021-02-10T07:51:42.641593Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
db_1            | 2021-02-10T07:51:42.641646Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
db_1            | 2021-02-10T07:51:42.807262Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
db_1            | 2021-02-10T07:51:42.809136Z 0 [Note] mysqld (mysqld 5.7.33) starting as process 77 ...
db_1            | 2021-02-10T07:51:42.813848Z 0 [Note] InnoDB: PUNCH HOLE support available
db_1            | 2021-02-10T07:51:42.814208Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db_1            | 2021-02-10T07:51:42.814538Z 0 [Note] InnoDB: Uses event mutexes
db_1            | 2021-02-10T07:51:42.814857Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
db_1            | 2021-02-10T07:51:42.815189Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
db_1            | 2021-02-10T07:51:42.815504Z 0 [Note] InnoDB: Using Linux native AIO
db_1            | 2021-02-10T07:51:42.816067Z 0 [Note] InnoDB: Number of pools: 1
db_1            | 2021-02-10T07:51:42.816506Z 0 [Note] InnoDB: Using CPU crc32 instructions
db_1            | 2021-02-10T07:51:42.818523Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
db_1            | 2021-02-10T07:51:42.827445Z 0 [Note] InnoDB: Completed initialization of buffer pool
postfixadmin_1  | bash: connect: Connection refused
postfixadmin_1  | bash: /dev/tcp/db/3306: Connection refused
db_1            | 2021-02-10T07:51:42.841376Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
db_1            | 2021-02-10T07:51:42.860935Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
db_1            | 2021-02-10T07:51:42.875631Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db_1            | 2021-02-10T07:51:42.876061Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
db_1            | 2021-02-10T07:51:42.908741Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
db_1            | 2021-02-10T07:51:42.910002Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
db_1            | 2021-02-10T07:51:42.910332Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
db_1            | 2021-02-10T07:51:42.910890Z 0 [Note] InnoDB: Waiting for purge to start
db_1            | 2021-02-10T07:51:42.961436Z 0 [Note] InnoDB: 5.7.33 started; log sequence number 2746831
db_1            | 2021-02-10T07:51:42.962370Z 0 [Note] Plugin 'FEDERATED' is disabled.
db_1            | 2021-02-10T07:51:42.968912Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
db_1            | 2021-02-10T07:51:42.970935Z 0 [Note] InnoDB: Buffer pool(s) load completed at 210210  7:51:42
db_1            | 2021-02-10T07:51:42.971660Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
db_1            | 2021-02-10T07:51:42.972009Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
db_1            | 2021-02-10T07:51:42.973366Z 0 [Warning] CA certificate ca.pem is self signed.
db_1            | 2021-02-10T07:51:42.973765Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
db_1            | 2021-02-10T07:51:42.975752Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
db_1            | 2021-02-10T07:51:42.984495Z 0 [Note] Event Scheduler: Loaded 0 events
db_1            | 2021-02-10T07:51:42.985094Z 0 [Note] mysqld: ready for connections.
db_1            | Version: '5.7.33'  socket: '/var/run/mysqld/mysqld.sock'  port: 0  MySQL Community Server (GPL)
postfixadmin_1  | bash: connect: Connection refused
postfixadmin_1  | bash: /dev/tcp/db/3306: Connection refused
db_1            | 2021-02-10 07:51:43+00:00 [Note] [Entrypoint]: Temporary server started.
postfixadmin_1  | bash: connect: Connection refused
postfixadmin_1  | bash: /dev/tcp/db/3306: Connection refused
db_1            | Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
db_1            | Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
postfixadmin_1  | bash: connect: Connection refused
postfixadmin_1  | bash: /dev/tcp/db/3306: Connection refused
postfixadmin_1  | bash: connect: Connection refused
postfixadmin_1  | bash: /dev/tcp/db/3306: Connection refused
postfixadmin_1  | bash: connect: Connection refused
postfixadmin_1  | bash: /dev/tcp/db/3306: Connection refused
db_1            | Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
db_1            | Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
db_1            | 2021-02-10 07:51:45+00:00 [Note] [Entrypoint]: Creating database postfixadmin
db_1            | 2021-02-10 07:51:45+00:00 [Note] [Entrypoint]: Creating user postfixadmin
db_1            | 2021-02-10 07:51:45+00:00 [Note] [Entrypoint]: Giving user postfixadmin access to schema postfixadmin
db_1            |
db_1            | 2021-02-10 07:51:45+00:00 [Note] [Entrypoint]: Stopping temporary server
db_1            | 2021-02-10T07:51:45.514884Z 0 [Note] Giving 0 client threads a chance to die gracefully
db_1            | 2021-02-10T07:51:45.515457Z 0 [Note] Shutting down slave threads
db_1            | 2021-02-10T07:51:45.515784Z 0 [Note] Forcefully disconnecting 0 remaining clients
db_1            | 2021-02-10T07:51:45.516084Z 0 [Note] Event Scheduler: Purging the queue. 0 events
db_1            | 2021-02-10T07:51:45.516481Z 0 [Note] Binlog end
db_1            | 2021-02-10T07:51:45.517196Z 0 [Note] Shutting down plugin 'ngram'
db_1            | 2021-02-10T07:51:45.517512Z 0 [Note] Shutting down plugin 'partition'
db_1            | 2021-02-10T07:51:45.517811Z 0 [Note] Shutting down plugin 'BLACKHOLE'
db_1            | 2021-02-10T07:51:45.518112Z 0 [Note] Shutting down plugin 'ARCHIVE'
db_1            | 2021-02-10T07:51:45.518416Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
db_1            | 2021-02-10T07:51:45.518744Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
db_1            | 2021-02-10T07:51:45.519049Z 0 [Note] Shutting down plugin 'MyISAM'
db_1            | 2021-02-10T07:51:45.519358Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
db_1            | 2021-02-10T07:51:45.519663Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
db_1            | 2021-02-10T07:51:45.519974Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
db_1            | 2021-02-10T07:51:45.520277Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
db_1            | 2021-02-10T07:51:45.520591Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
db_1            | 2021-02-10T07:51:45.520928Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
db_1            | 2021-02-10T07:51:45.521238Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
db_1            | 2021-02-10T07:51:45.521537Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
db_1            | 2021-02-10T07:51:45.521740Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
db_1            | 2021-02-10T07:51:45.521827Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
db_1            | 2021-02-10T07:51:45.521877Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
db_1            | 2021-02-10T07:51:45.521948Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
db_1            | 2021-02-10T07:51:45.522071Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
db_1            | 2021-02-10T07:51:45.522172Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
db_1            | 2021-02-10T07:51:45.522219Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
db_1            | 2021-02-10T07:51:45.522287Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
db_1            | 2021-02-10T07:51:45.522403Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
db_1            | 2021-02-10T07:51:45.522481Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
db_1            | 2021-02-10T07:51:45.522562Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
db_1            | 2021-02-10T07:51:45.522680Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
db_1            | 2021-02-10T07:51:45.522767Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
db_1            | 2021-02-10T07:51:45.522816Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
db_1            | 2021-02-10T07:51:45.522884Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
db_1            | 2021-02-10T07:51:45.522890Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
db_1            | 2021-02-10T07:51:45.522893Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
db_1            | 2021-02-10T07:51:45.522896Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
db_1            | 2021-02-10T07:51:45.522899Z 0 [Note] Shutting down plugin 'INNODB_CMP'
db_1            | 2021-02-10T07:51:45.522901Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
db_1            | 2021-02-10T07:51:45.522904Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
db_1            | 2021-02-10T07:51:45.522907Z 0 [Note] Shutting down plugin 'INNODB_TRX'
db_1            | 2021-02-10T07:51:45.522910Z 0 [Note] Shutting down plugin 'InnoDB'
db_1            | 2021-02-10T07:51:45.523088Z 0 [Note] InnoDB: FTS optimize thread exiting.
db_1            | 2021-02-10T07:51:45.523981Z 0 [Note] InnoDB: Starting shutdown...
db_1            | 2021-02-10T07:51:45.624407Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
db_1            | 2021-02-10T07:51:45.624640Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 210210  7:51:45
postfixadmin_1  | bash: connect: Connection refused
postfixadmin_1  | bash: /dev/tcp/db/3306: Connection refused
postfixadmin_1  | bash: connect: Connection refused
postfixadmin_1  | bash: /dev/tcp/db/3306: Connection refused
db_1            | 2021-02-10T07:51:46.833246Z 0 [Note] InnoDB: Shutdown completed; log sequence number 12664129
db_1            | 2021-02-10T07:51:46.835365Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
db_1            | 2021-02-10T07:51:46.835747Z 0 [Note] Shutting down plugin 'MEMORY'
db_1            | 2021-02-10T07:51:46.836078Z 0 [Note] Shutting down plugin 'CSV'
db_1            | 2021-02-10T07:51:46.836419Z 0 [Note] Shutting down plugin 'sha256_password'
db_1            | 2021-02-10T07:51:46.836738Z 0 [Note] Shutting down plugin 'mysql_native_password'
db_1            | 2021-02-10T07:51:46.837226Z 0 [Note] Shutting down plugin 'binlog'
db_1            | 2021-02-10T07:51:46.837860Z 0 [Note] mysqld: Shutdown complete
db_1            |
postfixadmin_1  | bash: connect: Connection refused
postfixadmin_1  | bash: /dev/tcp/db/3306: Connection refused
postfixadmin_1  | bash: connect: Connection refused
postfixadmin_1  | bash: /dev/tcp/db/3306: Connection refused
db_1            | 2021-02-10 07:51:47+00:00 [Note] [Entrypoint]: Temporary server stopped
db_1            |
db_1            | 2021-02-10 07:51:47+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.
db_1            |
db_1            | 2021-02-10T07:51:47.528921Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
db_1            | 2021-02-10T07:51:47.528976Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
db_1            | 2021-02-10T07:51:47.698738Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
db_1            | 2021-02-10T07:51:47.701335Z 0 [Note] mysqld (mysqld 5.7.33) starting as process 1 ...
db_1            | 2021-02-10T07:51:47.706244Z 0 [Note] InnoDB: PUNCH HOLE support available
db_1            | 2021-02-10T07:51:47.706595Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db_1            | 2021-02-10T07:51:47.706928Z 0 [Note] InnoDB: Uses event mutexes
db_1            | 2021-02-10T07:51:47.707256Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
db_1            | 2021-02-10T07:51:47.707581Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
db_1            | 2021-02-10T07:51:47.707926Z 0 [Note] InnoDB: Using Linux native AIO
db_1            | 2021-02-10T07:51:47.708493Z 0 [Note] InnoDB: Number of pools: 1
db_1            | 2021-02-10T07:51:47.708945Z 0 [Note] InnoDB: Using CPU crc32 instructions
db_1            | 2021-02-10T07:51:47.710930Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
db_1            | 2021-02-10T07:51:47.719770Z 0 [Note] InnoDB: Completed initialization of buffer pool
db_1            | 2021-02-10T07:51:47.722400Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
db_1            | 2021-02-10T07:51:47.735056Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
db_1            | 2021-02-10T07:51:47.749493Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db_1            | 2021-02-10T07:51:47.750020Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
db_1            | 2021-02-10T07:51:47.777827Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
db_1            | 2021-02-10T07:51:47.779137Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
db_1            | 2021-02-10T07:51:47.779479Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
db_1            | 2021-02-10T07:51:47.780048Z 0 [Note] InnoDB: Waiting for purge to start
db_1            | 2021-02-10T07:51:47.830636Z 0 [Note] InnoDB: 5.7.33 started; log sequence number 12664129
db_1            | 2021-02-10T07:51:47.831518Z 0 [Note] Plugin 'FEDERATED' is disabled.
db_1            | 2021-02-10T07:51:47.838227Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
db_1            | 2021-02-10T07:51:47.838801Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
db_1            | 2021-02-10T07:51:47.839657Z 0 [Warning] CA certificate ca.pem is self signed.
db_1            | 2021-02-10T07:51:47.838782Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
db_1            | 2021-02-10T07:51:47.842645Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
db_1            | 2021-02-10T07:51:47.843427Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
db_1            | 2021-02-10T07:51:47.843804Z 0 [Note] IPv6 is available.
db_1            | 2021-02-10T07:51:47.844715Z 0 [Note]   - '::' resolves to '::';
db_1            | 2021-02-10T07:51:47.845069Z 0 [Note] Server socket created on IP: '::'.
db_1            | 2021-02-10T07:51:47.846157Z 0 [Note] InnoDB: Buffer pool(s) load completed at 210210  7:51:47
db_1            | 2021-02-10T07:51:47.847400Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
db_1            | 2021-02-10T07:51:47.856145Z 0 [Note] Event Scheduler: Loaded 0 events
db_1            | 2021-02-10T07:51:47.856742Z 0 [Note] mysqld: ready for connections.
db_1            | Version: '5.7.33'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)
db_1            | 2021-02-10T07:51:47.869696Z 2 [Note] Got an error reading communication packets
postfixadmin_1  | Write config to /var/www/html/config.local.php
postfixadmin_1  | <?php
postfixadmin_1  |               $CONF['database_type'] = 'mysqli';
postfixadmin_1  |               $CONF['database_host'] = 'db';
postfixadmin_1  |               $CONF['database_port'] = '3306';
postfixadmin_1  |               $CONF['database_user'] = 'postfixadmin';
postfixadmin_1  |               $CONF['database_password'] = 'postfixadminPassword';
postfixadmin_1  |               $CONF['database_name'] = 'postfixadmin';
postfixadmin_1  |               $CONF['setup_password'] = 'changeme';
postfixadmin_1  |               $CONF['smtp_server'] = 'postfix';
postfixadmin_1  |               $CONF['smtp_port'] = '25';
postfixadmin_1  |               $CONF['configured'] = true;
postfixadmin_1  |               ?>
postfixadmin_1  |  ** Running database / environment upgrade.php
postfixadmin_1  | <p>Updating database:</p><p>- old version: 0; target version: 1843</p>
postfixadmin_1  |
postfixadmin_1  | <div style='color:#999'>&nbsp;&nbsp;(If the update doesn't work, run setup.php?debug=1 to see the detailed error messages and SQL queries.)</div>
postfixadmin_1  | <p>updating to version 1 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 2 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 3 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 4 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 5 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 79 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 81 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 90 (MySQL and PgSQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 169 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 318 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 344 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 373 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 438 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 439 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 473 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 479 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 483 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 495 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 504 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 655 (MySQL and PgSQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 729 (MySQL and PgSQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 945 (MySQL and PgSQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 946 (MySQL and PgSQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1050 (MySQL and PgSQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1283 (MySQL and PgSQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1284 (MySQL and PgSQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1345 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1519 (MySQL and PgSQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1610 (MySQL and PgSQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1685 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1761 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1762 (MySQL and PgSQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1763 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1767 (MySQL and PgSQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1795 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1835 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1836 (MySQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1837 (all databases)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1839 (all databases)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1840 (MySQL and PgSQL)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1842 (all databases)...
postfixadmin_1  |  &nbsp; done
postfixadmin_1  | <p>updating to version 1843 (all databases)...
postfixadmin_1  |  &nbsp; done

MySQL 4.1 functions not available! (php5-mysqli installed?)

Hi there.

First of all many thanks to all the people involved in this project for their time, I really appreciate it.

I was facing below error:

DEBUG INFORMATION:
MySQL 4.1 functions not available! (php5-mysqli installed?)
database_type = 'mysqli' in config.inc.php, are you using a different database?

Please check the documentation and website for more information.

Postfix Admin
Forums

The root cause is that the docker image is missing the https://www.php.net/manual/en/book.mysqli.php PHP extension.

To fix it:

docker exec -ti mailadmin bash
docker-php-ext-install mysqli
exit
docker restart mailadmin; docker logs -f mailadmin

Pasting here the environment variables of the docker container, which I guess are the relevant ones:

            "Env": [
                "POSTFIXADMIN_DB_HOST=mailadmin-db",
                "POSTFIXADMIN_DB_NAME=mailadmin",
                "POSTFIXADMIN_DB_PASSWORD=secret",
                "POSTFIXADMIN_DB_TYPE=mysqli",
                "POSTFIXADMIN_DB_USER=mailadmin",
                "POSTFIXADMIN_SETUP_PASSWORD=secret",
                "POSTFIXADMIN_SMTP_PORT=587",
                "POSTFIXADMIN_SMTP_SERVER=mail",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "PHPIZE_DEPS=autoconf \t\tdpkg-dev \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tmake \t\tpkg-config \t\tre2c",
                "PHP_INI_DIR=/usr/local/etc/php",
                "APACHE_CONFDIR=/etc/apache2",
                "APACHE_ENVVARS=/etc/apache2/envvars",
                "PHP_EXTRA_BUILD_DEPS=apache2-dev",
                "PHP_EXTRA_CONFIGURE_ARGS=--with-apxs2 --disable-cgi",
                "PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64",
                "PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64",
                "PHP_LDFLAGS=-Wl,-O1 -pie",
                "GPG_KEYS=42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312",
                "PHP_VERSION=7.4.14",
                "PHP_URL=https://www.php.net/distributions/php-7.4.14.tar.xz",
                "PHP_ASC_URL=https://www.php.net/distributions/php-7.4.14.tar.xz.asc",
                "PHP_SHA256=f9f3c37969fcd9006c1dbb1dd76ab53f28c698a1646fa2dde8547c3f45e02886",
                "POSTFIXADMIN_VERSION=3.3.3",
                "POSTFIXADMIN_SHA512=363b91eb07f263a0f595e020725cacf9f9de058adaef3987efb3257d0e6fba526b075f8328e47763256278797ec946305d1e4c8ff5c55d77753f9ed72bfa4121",
                "APACHE_DOCUMENT_ROOT=/var/www/html/public"
            ],

Is somebody else facing same issue?

config to set url/basepath for reverse proxy

Bonjour,

Would it be possible to add a configuration to set the absolute path for postfixadmin. This is essential when working with Reverse Proxies. I believe this is what was requested in #37.

Context

I'm building a new servers and decided to go with a Docker first approach, if it can be done with a container, I'm not installing on the OS. To manage all of these containers I'm using traefik as a proxy, this allows me to set postfixadmin in https://domain.com/postfixadmin so it is redirected to the right container. However, in containers, the path is converted to / so when the login.php page is returned it goes to https://domain.com/login.php instead of https://domain.com/postfixadmin/login.php

Would like to see

docker run -d --name postfixadmin \
    --label traefik.enable=true \
    --label 'traefik.http.routers.postfixadmin.rule=Host(`domain.com`) && PathPrefix(`/postfix`)' \
    --label 'traefik.http.routers.postfixadmin.middlewares=postfixadmin-stripprefix' \
    --label 'traefik.http.middlewares.postfixadmin-stripprefix.stripprefix.prefixes=/postfix' \
    --label 'traefik.http.middlewares.postfixadmin-stripprefix.stripprefix.forceslash=false' \
    --label 'traefik.http.middlewares.proto.headers.customrequestheaders.X-Forwarded-Proto=https' \
    --label traefik.http.routers.postfixadmin.entrypoints=https \
    --label traefik.http.routers.postfixadmin.tls=true \
    --label traefik.http.routers.postfixadmin.tls.certresolver=letsencrypt \
    -p 9186:80 \
    -e POSTFIXADMIN_DB_TYPE=mysqli \
    -e POSTFIXADMIN_DB_HOST=mariadb \
    -e POSTFIXADMIN_DB_USER=postfixadmin \
    -e POSTFIXADMIN_DB_PASSWORD=password \
    -e POSTFIXADMIN_DB_NAME=postfixadmin \
    **-e POSTFIXADMIN_ABSOLUTE_URL=/postfixadmin \**
    postfixadmin

Other project example

This would be similar to phpmyadmin's PmaAbsoluteUri configuration
https://docs.phpmyadmin.net/en/latest/config.html#cfg_PmaAbsoluteUri

Thanks

Error with latest image 3.3.13

With latest docker image i am getting this error on rasberrypi previously it works fine
php: error while loading shared libraries: /lib/aarch64-linux-gnu/libxml2.so.2: file too short

fpm-alpine variant "timeout" error

After setting up the fpm-alpine variant I get this error when I run:

+ POSTFIXADMIN_DB_TYPE=mysqli
+ POSTFIXADMIN_DB_HOST=localhost
+ POSTFIXADMIN_DB_USER=username
+ POSTFIXADMIN_DB_PASSWORD=yoo7aaLaak3oNgiS
+ POSTFIXADMIN_SETUP_PASSWORD=
+ [[ php-fpm == apache2* ]]
+ '[' php-fpm == php-fpm ']'
+ '[' -e index.php -a -e scripts/postfixadmin-cli.php ']'
+ echo 'Postfixadmin not found in /var/www/html - copying now...'
Postfixadmin not found in /var/www/html - copying now...
++ ls -A
+ '[' '' ']'
+ tar xf -
+ tar cf - --one-file-system -C /usr/src/postfixadmin .
+ echo 'Complete! Postfixadmin has been successfully copied to /var/www/html'
Complete! Postfixadmin has been successfully copied to /var/www/html
+ case "${POSTFIXADMIN_DB_TYPE}" in
+ : 3306
+ '[' mysqli '!=' sqlite ']'
+ '[' -z username -o -z yoo7aaLaak3oNgiS ']'
+ timeout 15 bash -c 'until echo > /dev/tcp/localhost/3306; do sleep 0.5; done'
timeout: can't execute '15': No such file or directory

But if I start again with the fpm variant this problem does not exist.

log in to postfixadmin

Good morning,
I launched the image then contained it then I managed to enter the postfix admin web page but the problem is that I am asked to email an email address and a password even though I do not have these id then I assume there is a default user.
Is there anyone who can help me?

No longer able to specify custom database_port(POSTFIXADMIN_DB_PORT: 3307)

Hi

In the latest version it is not longer possible to pass the DB port as a environment variable:

This is my docker-compose.yml, its essentially the same example as in the README I only added the MYSQL_TCP_PORT for the mysql container and then also the POSTFIXADMIN_DB_PORT for the postfixadmin container.

version: '3'

services:
   db:
     image: mysql:5.7
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: notSecureChangeMe
       MYSQL_DATABASE: postfixadmin
       MYSQL_USER: postfixadmin
       MYSQL_PASSWORD: postfixadminPassword
       MYSQL_TCP_PORT: 3307

   postfixadmin:
     depends_on:
       - db
     image: postfixadmin
     ports:
       - "8000:80"
     restart: always
     environment:
       POSTFIXADMIN_DB_TYPE: mysqli
       POSTFIXADMIN_DB_HOST: db
       POSTFIXADMIN_DB_PORT: 3307
       POSTFIXADMIN_DB_USER: postfixadmin
       POSTFIXADMIN_DB_NAME: postfixadmin
       POSTFIXADMIN_DB_PASSWORD: postfixadminPassword
       POSTFIXADMIN_SMTP_SERVER: postfix
       POSTFIXADMIN_SMTP_PORT: 25

This is the output and you'll see the error after the Write config to /var/www/html/config.local.php section.

db_1            | 2021-01-17T13:10:15.888201Z 0 [Note] Event Scheduler: Loaded 0 events
db_1            | 2021-01-17T13:10:15.888506Z 0 [Note] mysqld: ready for connections.
db_1            | Version: '5.7.32'  socket: '/var/run/mysqld/mysqld.sock'  port: 3307  MySQL Community Server (GPL)
postfixadmin_1  | Complete! Postfixadmin has been successfully copied to /var/www/html
db_1            | 2021-01-17T13:10:15.935272Z 2 [Note] Got an error reading communication packets
postfixadmin_1  | Write config to /var/www/html/config.local.php
postfixadmin_1  | <?php
postfixadmin_1  | 		$CONF['database_type'] = 'mysqli';
postfixadmin_1  | 		$CONF['database_host'] = 'db';
postfixadmin_1  | 		$CONF['database_port'] = '3307';
postfixadmin_1  | 		$CONF['database_user'] = 'postfixadmin';
postfixadmin_1  | 		$CONF['database_password'] = 'postfixadminPassword';
postfixadmin_1  | 		$CONF['database_name'] = 'postfixadmin';
postfixadmin_1  | 		$CONF['setup_password'] = 'changeme';
postfixadmin_1  | 		$CONF['smtp_server'] = 'postfix';
postfixadmin_1  | 		$CONF['smtp_port'] = '25';
postfixadmin_1  | 		$CONF['configured'] = true;
postfixadmin_1  | 		?>
postfixadmin_1  |  ** Running database / environment upgrade.php
postfixadmin_1  | Exception running PostfixAdmin query: CREATE TABLE IF NOT EXISTS `config` (
postfixadmin_1  |         `id` int(11) not null auto_increment primary key,
postfixadmin_1  |         `name`  VARCHAR(20) /*!40100 CHARACTER SET latin1 COLLATE latin1_general_ci */ NOT NULL DEFAULT '',
postfixadmin_1  |         `value` VARCHAR(20) /*!40100 CHARACTER SET latin1 COLLATE latin1_general_ci */ NOT NULL DEFAULT '',
postfixadmin_1  |         UNIQUE name ( `name` )
postfixadmin_1  |         )
postfixadmin_1  |       COMMENT = 'PostfixAdmin settings' PDOException: SQLSTATE[HY000] [2002] Connection refused in /var/www/html/functions.inc.php:1648
postfixadmin_1  | Stack trace:
postfixadmin_1  | #0 /var/www/html/functions.inc.php(1648): PDO->__construct('mysql:host=db;d...', 'postfixadmin', 'postfixadminPas...', Array)
postfixadmin_1  | #1 /var/www/html/functions.inc.php(1787): db_connect()
postfixadmin_1  | #2 /var/www/html/public/upgrade.php(328): db_execute('CREATE TABLE IF...', Array, true)
postfixadmin_1  | #3 /var/www/html/public/upgrade.php(149): db_query_parsed('\n        CREATE...', 0, ' COMMENT = 'Pos...')
postfixadmin_1  | #4 {main}
postfixadmin_1  |
postfixadmin_1  | Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] Connection refused in /var/www/html/functions.inc.php:1648
postfixadmin_1  | Stack trace:
postfixadmin_1  | #0 /var/www/html/functions.inc.php(1648): PDO->__construct('mysql:host=db;d...', 'postfixadmin', 'postfixadminPas...', Array)
postfixadmin_1  | #1 /var/www/html/functions.inc.php(1812): db_connect()
postfixadmin_1  | #2 /var/www/html/functions.inc.php(1775): db_query('SELECT value FR...', Array)
postfixadmin_1  | #3 /var/www/html/functions.inc.php(2107): db_query_one('SELECT value FR...')
postfixadmin_1  | #4 /var/www/html/public/upgrade.php(152): check_db_version(false)
postfixadmin_1  | #5 {main}
postfixadmin_1  |   thrown in /var/www/html/functions.inc.php on line 1648
db_1            | 2021-01-17T13:10:16.454841Z 3 [Note] Got an error reading communication packets

Regards
^C

fallback to sqlite?

Hi there,

as per doco, "Note: An sqlite database is used as a fallback if you do not have a config.local.php and do not specify the above variables." - no quite, pls see below:

sudo docker run   -p 8080:80         postfixadmin-image
.
.
+ POSTFIXADMIN_DB_TYPE=sqlite
+ POSTFIXADMIN_DB_HOST=
+ POSTFIXADMIN_DB_USER=
+ POSTFIXADMIN_DB_PASSWORD=
+ [[ apache2-foreground == apache2* ]]
+ '[' -e index.php -a -e scripts/postfixadmin-cli.php ']'
+ echo 'Postfixadmin not found in /var/www/html - copying now...'
Postfixadmin not found in /var/www/html - copying now...
++ ls -A
+ '[' '' ']'
+ tar xf -
+ tar cf - --one-file-system -C /usr/src/postfixadmin .
+ echo 'Complete! Postfixadmin has been successfully copied to /var/www/html'
Complete! Postfixadmin has been successfully copied to /var/www/html
+ case "${POSTFIXADMIN_DB_TYPE}" in
+ '[' sqlite '!=' sqlite ']'
+ '[' sqlite = sqlite ']'
+ : /var/local/postfixadmin.db
+ '[' '!' -e /var/local/postfixadmin.db ']'
+ touch /var/local/postfixadmin.db
+ '[' '!' -e config.local.php ']'
+ touch config.local.php
Write config to /var/www/html/config.local.php
+ echo 'Write config to /var/www/html/config.local.php'
+ tee config.local.php
+ echo '<?php
		$CONF['\''database_type'\''] = '\''sqlite'\'';
		$CONF['\''database_host'\''] = '\'''\'';
		$CONF['\''database_user'\''] = '\'''\'';
		$CONF['\''database_password'\''] = '\'''\'';
		$CONF['\''database_name'\''] = '\''/var/local/postfixadmin.db'\'';
		$CONF['\''setup_password'\''] = '\'''\'';
		$CONF['\''configured'\''] = true;
		?>'
<?php
		$CONF['database_type'] = 'sqlite';
		$CONF['database_host'] = '';
		$CONF['database_user'] = '';
		$CONF['database_password'] = '';
		$CONF['database_name'] = '/var/local/postfixadmin.db';
		$CONF['setup_password'] = '';
		$CONF['configured'] = true;
		?>
 ** Running database / environment upgrade.php 
+ '[' -f upgrade.php ']'
+ echo ' ** Running database / environment upgrade.php '
+ php upgrade.php
<p>Updating database:</p><p>- old version: 0; target version: 1836</p>
<div style='color:#999'>&nbsp;&nbsp;(If the update doesn't work, run setup.php?debug=1 to see the detailed error messages and SQL queries.)</div><p>updating to version 1824 (SQLite)... &nbsp; done+ exec apache2-foreground
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
[Mon Feb 19 08:44:49.626314 2018] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.10 (Debian) PHP/7.0.27 configured -- resuming normal operations
[Mon Feb 19 08:44:49.626402 2018] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
172.17.0.1 - - [19/Feb/2018:08:45:19 +0000] "GET /login.php HTTP/1.1" 200 518 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/64.0.3282.140 Chrome/64.0.3282.140 Safari/537.36"
172.17.0.1 - - [19/Feb/2018:08:45:19 +0000] "GET /favicon.ico HTTP/1.1" 200 15388 "http://172.17.0.1:8080/login.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/64.0.3282.140 Chrome/64.0.3282.140 Safari/537.36"
172.17.0.1 - - [19/Feb/2018:08:46:10 +0000] "-" 408 0 "-" "-"
172.17.0.1 - - [19/Feb/2018:08:46:10 +0000] "-" 408 0 "-" "-"
.

Please advice. I do not think the App can access the DB, since:
DEBUG INFORMATION Connect: given database path does not exist, is not writable, or $CONF['database_name'] is empty.

Also, how do we login to the app if DB name is provided?

Cheers

"Docker Compose" instructions have no context

The Readme.md file says

Docker Compose

Try something like the below; changing the usernames/passwords as required.

But it does not say where you would "try something like the below". What is this section talking about at all?

Warning: Depends on: IMAP functions - NOT FOUND

setup.php complains:

Warning: Depends on: IMAP functions - NOT FOUND
To install IMAP support, install php5-imap
Without IMAP support, you won't be able to create subfolders when creating mailboxes.

I'm not clear to what extent this is a problem. I think dovecot creates a skeleton mailbox structure? It's probably good to document this in any case.

Missing info (or typo?) in Readme.md

The README.MD file says this:

fpm-alpine

This image has a very small footprint. It is based on Alpine Linux and starts only a PHP FPM process. Use this variant if you already have a seperate webserver. If you need more tools, that are not available on Alpine Linux, use the fpm image instead.

fpm

This image starts only a PHP FPM container. Use this variant if you already have a seperate webserver.

See that both options say Use this variant if you already have a seperate webserver. Probably one of them should say "if you do not already have a separate webserver"?

ARGON2 support

Hello - i was trying to use argon2 encryption for my passwords but was having trouble getting it to work. I think the issue below said it was implemented but i'm not having any luck trying to configure it. And i was going to try with dovecot:argon2 but i'm not smart enough to tell postfixadmin where the doveadm binary is located (on a different container).

Password Hashing - attempted to use configured encrypt backend (argon2) triggered an error: unknown/invalid $CONF["encrypt"] setting: argon2

#49

docker-compose not working

the image shoulbe just "postfixadmin" , not "postfixadmin-image/latest"

hchang@hqdc039:~/git/postfixadmin$ docker-compose up -d
Creating network "postfixadmin_default" with the default driver
Pulling db (mysql:5.7)...
5.7: Pulling from library/mysql
6ec7b7d162b2: Pull complete
fedd960d3481: Pull complete
7ab947313861: Pull complete
64f92f19e638: Pull complete
3e80b17bff96: Pull complete
014e976799f9: Pull complete
59ae84fee1b3: Pull complete
7d1da2a18e2e: Pull complete
301a28b700b9: Pull complete
529dc8dbeaf3: Pull complete
bc9d021dc13f: Pull complete
Digest: sha256:c3a567d3e3ad8b05dfce401ed08f0f6bf3f3b64cc17694979d5f2e5d78e10173
Status: Downloaded newer image for mysql:5.7
Pulling postfixadmin (postfixadmin-image:latest)...
ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.

Continue with the new image? [yN]y
Pulling postfixadmin (postfixadmin-image:latest)...
ERROR: pull access denied for postfixadmin-image, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
chchang@hqdc039:~/git/postfixadmin$ 

POSTFIXADMIN_SETUP_PASSWORD does nothing

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.

Add support for $CONF['encrypt']

md5 password hashes are pretty weak by today's standards, and it's easy to choose a better one. I'd like to see this default to something like $CONF['encrypt']="SHA512-CRYPT", and/or allow a user setting via an environment variable.

Add dummies quick start guide

I am dummy in mailserver configuration :)

I have configured mailserver based on postfix and docker-mailserver stack. Now I'd like to use postfixadmin to manage the aliases and addresses. How do I integrate it together?

Actually, the question is wider - in general, how does one integrates postfixadmin with whatever postfix installed? Following existing docs help only to actually run the service, but how to connect it together?

usename and password to login

My Docker compose

db:
    image: mysql:5.7
    restart: always
    environment:
       MYSQL_ROOT_PASSWORD: 123
       MYSQL_DATABASE: postfixadmin
       MYSQL_USER: postfixadmin
       MYSQL_PASSWORD: 123

  postfixadmin:
    depends_on:
      - db
    image: postfixadmin
    ports:
      - 8000:80
    restart: always
    environment:
       POSTFIXADMIN_DB_TYPE: mysqli
       POSTFIXADMIN_DB_HOST: db
       POSTFIXADMIN_DB_USER: postfixadmin
       POSTFIXADMIN_DB_NAME: postfixadmin
       POSTFIXADMIN_DB_PASSWORD: 123
       POSTFIXADMIN_SMTP_SERVER: postfix
       POSTFIXADMIN_SMTP_PORT: 25
       POSTFIXADMIN_SETUP_PASSWORD: 123
       POSTFIXADMIN_ENCRYPT: md5crypt 

i tried so many username and password but http://localhost:8000/login.php says Your email address or password is not correct.

how can i find default username and password?

dockerhub

Hello,
I searched after a docker image on hub.docker.com, but I can't find neighter an official image nor a private image from postfixadmin repo on github.

Please add an official docker image on hub.docker.com from postfixadmin.

Volker

`/dev/tcp/db/3306: Connection refused` using MySQL

When using the example Compose file and changing the password parameters, the container crashes with the following error (and config.local.php)

postfixadmin-1  | Postfixadmin not found in /var/www/html - copying now...
postfixadmin-1  | Complete! Postfixadmin has been successfully copied to /var/www/html
postfixadmin-1  | bash: connect: Connection refused
postfixadmin-1  | bash: line 1: /dev/tcp/db/3306: Connection refused
postfixadmin-1  | bash: connect: Connection refused
postfixadmin-1  | bash: line 1: /dev/tcp/db/3306: Connection refused
postfixadmin-1  | bash: connect: Connection refused
postfixadmin-1  | bash: line 1: /dev/tcp/db/3306: Connection refused
postfixadmin-1  | bash: connect: Connection refused
postfixadmin-1  | bash: line 1: /dev/tcp/db/3306: Connection refused
postfixadmin-1  | bash: connect: Connection refused
postfixadmin-1  | bash: line 1: /dev/tcp/db/3306: Connection refused
postfixadmin-1  | Write config to /var/www/html/config.local.php
postfixadmin-1  | <?php
postfixadmin-1  | 		$CONF['database_type'] = 'mysqli';
postfixadmin-1  | 		$CONF['database_host'] = 'db';
postfixadmin-1  | 		$CONF['database_port'] = '3306';
postfixadmin-1  | 		$CONF['database_user'] = 'postfixadmin';
postfixadmin-1  | 		$CONF['database_password'] = 'foobarbaz';
postfixadmin-1  | 		$CONF['database_name'] = 'postfixadmin';
postfixadmin-1  | 		$CONF['setup_password'] = 'changeme';
postfixadmin-1  | 		$CONF['smtp_server'] = 'postfix';
postfixadmin-1  | 		$CONF['smtp_port'] = '25';
postfixadmin-1  | 		$CONF['encrypt'] = 'md5crypt';
postfixadmin-1  | 		$CONF['configured'] = true;
postfixadmin-1  | 		$CONF['dkim'] = 'NO';
postfixadmin-1  | 		$CONF['dkim_all_admins'] = 'NO';
postfixadmin-1  | 		?>

I tried various different things like explicitly setting the port in the MySQL container configuration, setting the host to db;port=3306 in config.local.php, etc. with no luck and all resulted in the same error. For posterity, here is the compose.yaml file used to produce this.

services:
   db:
     image: mysql:5.7
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: foobarbaz
       MYSQL_DATABASE: postfixadmin
       MYSQL_USER: postfixadmin
       MYSQL_PASSWORD: foobarbaz

   postfixadmin:
     depends_on:
       - db
     image: postfixadmin:apache
     ports:
       - "8000:80"
     restart: always
     environment:
       POSTFIXADMIN_DB_TYPE: mysqli
       POSTFIXADMIN_DB_HOST: db
       POSTFIXADMIN_DB_USER: postfixadmin
       POSTFIXADMIN_DB_NAME: postfixadmin
       POSTFIXADMIN_DB_PASSWORD: foobarbaz
       POSTFIXADMIN_SMTP_SERVER: postfix
       POSTFIXADMIN_SMTP_PORT: 25
       POSTFIXADMIN_ENCRYPT: md5crypt

POSTFIXADMIN_DB_NAME_FILE does nothing

From documentation :

All environment vars are supporting the secret's docker strategy.

From docker-entrypoint.sh :

Init vars for running script

POSTFIXADMIN_DB_TYPE=$(get_env_value 'POSTFIXADMIN_DB_TYPE' 'sqlite')
POSTFIXADMIN_DB_HOST=$(get_env_value "POSTFIXADMIN_DB_HOST" "")
POSTFIXADMIN_DB_PORT=$(get_env_value "POSTFIXADMIN_DB_PORT" "")
POSTFIXADMIN_DB_USER=$(get_env_value "POSTFIXADMIN_DB_USER" "")
POSTFIXADMIN_DB_PASSWORD=$(get_env_value "POSTFIXADMIN_DB_PASSWORD" "")
POSTFIXADMIN_SMTP_SERVER=$(get_env_value "POSTFIXADMIN_SMTP_SERVER" "localhost")
POSTFIXADMIN_SMTP_PORT=$(get_env_value "POSTFIXADMIN_SMTP_PORT" "25")
POSTFIXADMIN_ENCRYPT=$(get_env_value "POSTFIXADMIN_ENCRYPT" "md5crypt")

DEFAULT_SETUP_PASSWORD="changeme"
POSTFIXADMIN_SETUP_PASSWORD=$(get_env_value "POSTFIXADMIN_SETUP_PASSWORD" "${DEFAULT_SETUP_PASSWORD}")

Actually, POSTFIXADMIN_DB_NAME_FILE isn't working properly because the line to handle it is missing from the entrypoint script
POSTFIXADMIN_DB_NAME =$(get_env_value "POSTFIXADMIN_DB_NAME" "")

Encryption set to SHA512

To make use of sha512 hashing of passwords, you need to provide the following setting:

$CONF['encrypt'] = "php_crypt:SHA512::{SHA512-CRYPT}";

if you have Dovecot as the backend, like this:

default_pass_scheme = SHA512-CRYPT

APACHE_DOCUMENT_ROOT=/var/www/html/public seems to cause permission issues

Not sure where this is coming from (yet), but the Apache installation that is being consumed by my version (3.3.11) of the docker image seems to contain the wrong document root, leading to the following errors:

AH00112: Warning: DocumentRoot [/var/www/html/public] does not exist

All subsequent requests to data are then denied with the following log entries:

[Fri Dec 02 09:25:04.695495 2022] [authz_core:error] [pid 34] [client 10.0.1.17:40206] AH01630: client denied by server configuration: /var/www/html/public, referer: https://...

I am still investigating where this is coming from - it worked before and I didn't see a change coming. But docker says that 10h ago there was a new image pushed onto the very version.

"Running" instructions unclear

The Readme.md file says:

Running
No config.local.php / no existing setup

If you do not have a config.local.php

It does not say what a config.local.php file is, where it is located, why you would have it or anything else. What is it talking about?

postfixadmin not found

I created a config.local.php and run this like this:

docker run --name postfixadmin -p 8080:80 postfixadmin-image

When I do it it completes without error but only the apache test config comes up in a browser. I see this from the output:

+ echo 'Postfixadmin not found in /var/www/html - copying now...'
Postfixadmin not found in /var/www/html - copying now...

By "without error" I mean that it ends with this:

+ '[' -f upgrade.php ']'
+ exec php-fpm
[10-Jan-2019 04:49:21] NOTICE: fpm is running, pid 1
[10-Jan-2019 04:49:21] NOTICE: ready to handle connections

But /var/www/html does not contain anything but the apache test config. Am I missing something?

Add variant with dovecot-core

Hi folks,

Would be nice to have a variant that contains dovecot-core (for debian) so we have doveadm for ARGON2I passwords.

gosu prevents running container as unprivileged user

When running a container with a fixed unprivileged UID, gosu can not be executed. It would be really nice if gosu could be made optional, for example when a specific environment variable is present.

Currently, I set user: 12345678:12345678, userns_mode: host in docker-compose.yml and provide volumes for /var/www/html and /etc/dovecot/private where this UID may read/write in order to run an unprivileged container, but I need to remove gosu from the entrypoint to make it work.

docker-compose

Hello,

the docker-compose makes no sense without definition of persitent-volumes. And because I have no specification of files used in container, I even can't manage to create the volumes myself.

Can not run docker image with command line parameters

First I build the fpm image. Then when I run it using command line options for the mySQL database I get this error

bash: /dev/tcp/localhost/3306: Cannot assign requested address
bash: connect: Cannot assign requested address
bash: /dev/tcp/localhost/3306: Cannot assign requested address
bash: connect: Cannot assign requested address
bash: /dev/tcp/localhost/3306: Cannot assign requested address
bash: connect: Cannot assign requested address
bash: /dev/tcp/localhost/3306: Cannot assign requested address
bash: connect: Cannot assign requested address
bash: /dev/tcp/localhost/3306: Cannot assign requested address
^Cbash: connect: Cannot assign requested address

Maybe I have a bad cli parameter but the error is too vague for me to debug specifically. Have you seen this error before?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.