Skip to content

Mail transfer agent options

https://wiki.debian.org/Debate/DefaultMTA

System mail like cron need an MTA installed on the system, otherwise cron won't send mails: (CRON) info (No MTA installed, discarding output)

Problem: How to configure a simple MTA which

  • forwards system/cron mail
  • is reachable from containers

There are two options:

  1. Install an MTA on the host, make it reachable from containers
  2. Deploy an smtp-relay as docker-container. BUT on the host there needs to be another MTA installed that would forward mails to the smtp-relay
  3. Ignore host system mail when using a smtp-relay container

Issues with the container approach:

dma

dma https://github.com/corecode/dma https://wiki.debian.org/Debate/DefaultMTA/DMA https://salsa.debian.org/debian/dma Slick, no daemon, simple config, queing support

dma issues

Cronmail is rejected and queues up together with bounces see also Make MASQUERADE config setting override -f This is not solved with compiled latest master... Related debian bug report

msmtp-mta

Installation:

apt install msmtp-mta
systemctl start msmtpd
systemctl enable msmtpd

issues

Cronmails:

  • In order to send mails users need to symlink a system-wide /etc/msmtprc to a user specific ~/.msmtprc !
  • Cronmails come in with a FROM: root@FQDN, so the mailhub domain is added, not the sending host domain !

Other MTA options

All these (besides other) packages replace/conflict with the virtual mail-transport-agent package:

Small MTAs useful for smtp-relaying

Fully blown MTAs

  • exim4-daemon-light / exim4-daemon-heavy complicated config
  • postfix

ssmtp

  • no daemon, extremly slick, no queue support
  • Cronmail will fail like other mails sent simply to root without a fqdn:

    text $ echo hi | mail root smtp_1 | 503 H=($FQDN) [172.17.0.1] F=<root@$FQDN> rejected after DATA: header syntax (unqualified address not permitted: failing address

in "To:" header is: root): unqualified address not permitted: failing address in "To:" header is: root

Unmaintained MTAs