Table of Contents

Run A MTA (Mail Transfer Agent) for Other Docker Containers

/etc/systemd/system/EXAMPLE-smtp.service
[Unit]
Description=SMTP Proxy for EXAMPLE
After=docker.service
Requires=docker.service
BindsTo=docker.service
 
[Service]
SyslogIdentifier=EXAMPLE-smtp.service
ExecStart=/usr/bin/systemd-docker run \
  --rm \
  --name %n \
  --net mynet --ip 100.64.5.3 \
  --env MAILNAME=git.EXAMPLE.com \
  namshi/smtp
Restart=always
RestartSec=30s
Type=notify
NotifyAccess=all
TimeoutStartSec=120
TimeoutStopSec=30
 
[Install]
WantedBy=multi-user.target

Notes

See Alsos