這是本文件的舊版!


安裝設定 MailU (Docker Compose) Mail Server

  • 安裝環境 : OS:Ubuntu 20.04 +Docker vCore:1 RAM:2G HD:55G
  • 設定資訊 : Exp.
    • DNS :
      • mail01.ichiayi.com. IN A 140.82.11.111
      • mail01.ichiayi.com. IN MX 10 mail01.ichiayi.com.
    • Reverse DNS :
      • 140.82.11.111 → mail01.ichiayi.com
    • DKIM/SPF & DMARC Entries
      • 等安裝好 MailU 再透過 admin 生成相關資訊到 DNS 進行設定
    • 郵件資料路徑
      • 預設 /mailu
    • 主機防火牆要開放連入 Port
      • 25, 80, 110, 143, 443, 465, 587, 993 或 995

安裝程序

  1. 開啟主機防火牆

    ufw allow proto tcp from any to any port 25,80,110,143,443,465,587,993,995 comment 'Open SSH/Web/Mail ports'
    ufw allow proto udp from any to any port 161 comment 'Open SNMP ports'

  2. 使用 https://setup.mailu.io/2.0/ 產生設定檔
    1. Version : 2.0
    2. Step1:
      1. Mailu storage path: /mailu
      2. Main mail domain and server display name. : mail01.ichiayi.com
      3. Postmaster local part : admin
      4. TLS certificates : letsencrypt
      5. Authentication rate limit per IP for failed login : 5 /hour
      6. Authentication rate limit per user : 50 /day
      7. Outgoing message rate limit (per user) : 5000 /day
      8. Website name : mail01 for ichiayi.com
      9. Linked Website URL : https://www.ichiayi.com
      10. Enable the admin UI : /admin
    3. Step 2 - Pick some features
      1. Enable Web email client : none
    4. Step 3 - expose Mailu to the world
      1. IPv4 listen address : 0.0.0.0
      2. Subnet of the docker network : 172.18.0.1/16
      3. Public hostnames : ichiayi-mailu.ichiayi.com
  3. 依照 https://setup.mailu.io/2.0/ 建議執行
    1. Step 1 - Download your configuration files

      mkdir /mailu
      cd /mailu
      wget https://setup.mailu.io/2.0/file/0827c1b0-1fad-479d-xxxx-23a71d37744f/docker-compose.yml
      wget https://setup.mailu.io/2.0/file/0827c1b0-1fad-479d-xxxx-23a71d37744f/mailu.env

    2. Step 2 - Review the configuration : 確認 docker-compose.yml 與 mailu.env 內容是否正常
    3. Step 3 - Start the Compose project

      cd /mailu
      docker compose -p mailu up -d

    • 等啟動 MailU 服務後, 設定管理者密碼 Exp. My_12345Password

      docker compose -p mailu exec admin flask mailu admin admin mail01.ichiayi.com My_12345Password

    • 連上 Web 管理介面 https://mail01.ichiayi.com/admin
      • Administration → Mail domains → Actions → Details 可以看到 DNS SPF entries / DNS TLSA entry / DNS client auto-configuration entries 的設定資訊
  • tech/mailu.1692526144.txt.gz
  • 上一次變更: 2023/08/20 18:09
  • jonathan