Mailu
Mailu is a simple yet full-featured mail server as a set of Docker images. It is free software (both as in free beer and as in free speech), open to suggestions and external contributions. The project aims at providing people with an easily setup, easily maintained and full-featured mail server while not shipping proprietary software nor unrelated features often found in popular groupware.
Installation
Setting up the DNS
加一筆 A 與 MX 紀錄指向郵件主機
mail.mydomain.com. IN A a.b.c.d
mydomain.com. IN MX 10 mail.mydomain.com.
DKIM/SPF & DMARC Entries
DKIM 的 key 要從 Admin 管理介面 > Mail domains > Details > Generate keys。
Create the configuration file
透過這個網站產生 Docker 需要設定檔 docker-compose.yml
, mailu.env
。
必要的資訊如下:
Step 1 - pick a flavor
- Compose
Step 2 - Initial configuration
- Mailu storage path: /mailu
- Main mail domain and server display name: mydomain.com
- Postmaster local part: admin
- Choose how you wish to handle security: letsencrypt
- Website name: Webmail - mailu
- Linked Website URL: https://mail.mydomain.com
- Enable the admin UI (and path to the admin UI): unCheck
不啟用 admin UI 的外部網路存取
Step 3 - pick some features
- Enable Web email client (and path to the Web email client): roundcube , /webmail
Step 4 - expose Mailu to the world
- IPv4 listen address: <the public address of the server>
- Subnet of the docker network: 192.168.203.0/24
這裡的子網路是指 docker 的 br-XXXX 介面。
- Public hostnames: mail.mydomain.com
Database preferences
- Which database back end would you like to use: sqlite
Download the configuration file
mkdir /mailu
cd /mailu
wget http://setup.mailu.io/1.7/file/64c4e566-dda9-4e09-abcb-9b8732dc873b/docker-compose.yml
wget http://setup.mailu.io/1.7/file/64c4e566-dda9-4e09-abcb-9b8732dc873b/mailu.env
Start the Compose project
cd /mailu
docker-compose -p mailu up -d
create the primary administrator user account
docker-compose -p mailu exec admin flask mailu admin myadmin mydomain.com THISISPASSWORD
Login as admin to verify
open the URL: http://127.0.0.1:8080/ui
login with the account that you just created.
Mail Management
Webmail
https://mail.mydomain.com/webmail
user
docker-compose exec admin flask mailu user myuser mydomain.com 'password123'
user-delete
docker-compose exec admin flask mailu user-delete foo@mydomain.com