Postfix Admin is a web based interface to configure and manage a Postfix based email server for many users. Features include support for virtual domains and aliases, quotas, and vacation/out-of-the-office messages. It requires PHP, Postfix and one of MySQL or PostgreSQL.
The following components must be available at runtime:
docker run -e PFA_DB_USER=user \
-e PFA_DB_PASSWORD=topsecret \
-e PFA_DB_NAME=postfixadmin \
-e PFA_SETUP_PASS=your_setup_password \
-e PFA_HOSTNAME=your_server_hostname \
-e PFA_DOMAIN=your_domain \
-e VIRTUAL_PORT=3000 \
--name your-postfixadmin-name \
webkutir/postfixadmin
...via docker_compose
Example compose.yaml
for webkutir/postfixadmin
:
services:
db:
image: mysql:8.0
restart: always
environment:
MYSQL_RANDOM_ROOT_PASSWORD: 1
MYSQL_DATABASE: postfixadmin
MYSQL_USER: user
MYSQL_PASSWORD: topsecret
postfixadmin:
depends_on:
- db
image: webkutir/postfixadmin
ports:
- 3000:3000
restart: always
environment:
PFA_DB_USER: user
PFA_DB_PASSWORD: topsecret
PFA_DB_NAME: postfixadmin
PFA_SETUP_PASS: your_setup_password
PFA_HOSTNAME: your_server_hostname
PFA_DOMAIN: your_domain
VIRTUAL_PORT: 3000
Run docker compose up -d --build
, wait for it to initialize completely, and visit http://localhost:3000
or http://host-ip:3000
(as appropriate).
This image requires various environment variables to be set. The container startup will fail when the setup is incomplete.
Variable | Description | Default Value |
---|---|---|
PFA_SETUP_PASS |
Mandatory The PostfixAdmin setup password. | |
PFA_DB_USER |
Mandatory The name of the database user. Attention! You shall not use an administrator account. | |
PFA_DB_PASSWORD |
Mandatory The password of the database user | |
PFA_DB_NAME |
Mandatory The name of the database | |
PFA_HOSTNAME |
Mandatory Your mail server's Hostname | |
PFA_DOMAIN |
Mandatory Your mail server's Domain | |
VIRTUAL_PORT |
Mandatory Port on which your server will run | 3000 |
PFA_DB_HOST |
The hostname or IP address of the database server. You can specify port with this like localhost:8080 | localhost |
PFA_DB_TYPE |
Type of your Database mysqli or pgsql | mysqli |
PFA_POSTFIX_SERVER |
The hostname of your SMTP server. Postfix requires this to send out initial e-mail for mailboxes. You can specify port with this like localhost:8080 | localhost |
PFA_THEME_FAVICON |
Path of your own Favicon file. | images/favicon.ico |
PFA_THEME_LOGO |
Path of your own Logo file. | images/logo.png |
webkutir/postfixadmin exposes port 80 and 443 (the WebUI). No TLS support is built in. So you shall put your container behind an Ingress or Reverse Proxy that enforces HTTPS.
Once you have started your PostfixAdmin container successfully, it is now time to perform the first-time setup for your mailserver. Open the web interface and navigate to /index.php
.
PFA_SETUP_PASS
./login.php
.You can further customize the configuration by placing a config.site.php
into the /var/www/html
folder by using a volume mapping.
This Docker image is mature and supports my own mailserver in production. There are no known issues at the moment.