Introduction

If you only want a simple SMTP server, run command:

docker run --name postfix -d --network $network -e MY_NETWORKS=172.18.0.0/16,127.0.0.1 -e MAILNAME=mail.dev  --rm tozd/postfix:alpine-38 ash

Or check this page https://blog.edmdesigner.com/send-email-from-linux-command-line/

Installation

  • Download mail-in-a-box and start installation. (This command also be used for upgrading)
curl -s https://mailinabox.email/setup.sh | sudo -E bash
  • Settings
    email: [email protected] (used for admin panel)
    hostname: mail.domain.com
    timezone: Asia/Shanghai
    

Maintenance

Check Mail-in-a-Box version

cd ~/mailinabox
git branch

Backup

cd mailinabox
sudo management/backup.py
cd /home/user-data
tar czf backup.tar.gz backup/encrypted backup/secret_key.txt
mv backup.tar.gz ~/

Restore

tar xzf backup.tar.gz
export PASSPHRASE=$(cat /root/backup/secret_key.txt)
sudo -E duplicity restore --force file:///root/backup/encrypted /home/user-data/

# Check the admin page, re-provision the SSL certificate.

# Re-configure the box
mailinabox

# Check the admin page again. See the status and fix DNS config if anything is incorrect.

Change hostname

  • Re-running setup.
  • Change hostname during setup.
  • Change DNS accordingly.

Reference