Icinga in Docker: which eMail client to use for notifications?

Hi there!

@mcktr requested the ability to send notifications via eMail from our Icinga 2 Docker image. There’s one problem: the container runs only Icinga 2, so even if one wouldn’t use a public MTA, but a local one, it would be an extra container – and over the network anyway.

As I’m not very familiar with server MUAs, so I need your help: What program you’d expect behind mail in the container and why exactly? Requirements:

  • Non- MTA can be specified easily, preferably via a mounted .PROGRAMNAMErc or env vars (may be specified at Docker level as Icinga 2 passes its own env to subprocesses)
  • These ones have to still work


What you would need here is a sendmail compatible solution that directly sends to a mail relay instead of the local mta. I have no preference here, but I have seen esmtp, ssmtp and nullmailer in action in different environments. I would investigate which one is easiest to install and configure so passing config to the container is as simply as possible, but there could also be other things to consider.


I just saw that postfix is installed in the container.

But for my understanding the postfix daemon is not usable since the container runs only one process: the Icinga 2 daemon, correct?

For me ssmtp or. msmtp looks promising, no running daemon is needed.

(german blog post)

Unfortunately the ssmtp debian package is currently unmaintained, msmtp looks like an alternative.

Both provide a symlink for sendmail, so sending E-Mails using mail should work.

Best regards