@mcktrrequested 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-127.0.0.0/8 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)
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.
Unfortunately esmtp seems not to be maintained anymore, nullmailer seems to require a service and ssmtp seems not to be compatible with GNU mail which is expected by Icinga 2’s mail scripts. But thank you for the tips anyway!