Msmtp config file directory for Icinga2?

Hi,
I successfully configured my msmtp to send mails from Debian root and my user account.
For the user account, I had the same error as I have now with Icinga but fixed it by placing the msmtp config file in /home/username/ , chmod 600 it and it worked.
Sadly Icinga is not sending out mails yet, probably because I do not know where to put the configuration files for Icinga.

I’ve tried creating and moving files to /home/nagios/ and also moving them to /var/lib/nagios without success.

/var/log/icinga2/icinga2.log output is:

[2020-11-04 15:04:32 +0100] information/Notification: Sending reminder ‘Problem’ notification
‚NOTIFICATION_NAME!mail-icingaadmin’ for user ‘icingaadmin’
[2020-11-04 15:04:32 +0100] information/Notification: Completed sending ‘Problem’ notification
NOTIFICATION_NAME!mail-icingaadmin’ for checkable NOTIFICATION_NAME ’ and user
‘icingaadmin’ using command ‘mail-host-notification’.
[2020-11-04 15:04:32 +0100] warning/PluginNotificationTask: Notification command for object
NOTIFICATION_NAME ’ (PID: 3460, arguments: ‘/etc/icinga2/scripts/mail-host-notification.sh’ ‘-4’
‘IPADDRESS’ ‘-6’ ‘’ ‘-b’ ‘’ ‘-c’ ‘’ ‘-d’ ‘2020-11-04 15:04:32 +0100’ ‘-l’ ’ NOTIFICATION_NAME ’ ‘-n’ ’
NOTIFICATION_NAME ’ ‘-o’ ‘PING CRITICAL - Packet loss = 100%’ ‘-r’ ‘MAILADRESS’ ‘-s’ ‘DOWN’ ‘-t’
‘PROBLEM’ ‘-v’ ‘false’) terminated with exit code 36, output: msmtp: Konto default nicht gefunden:
Keine Konfigurationsdatei verfügbar
mail: Senden der Daten an /usr/bin/msmtp -t fehlgeschlagen: Prozess wurde mit einem von Null
verschiedenen Status beendet
mail: Nachricht kann nicht gesendet werden: Prozess wurde mit einem von Null verschiedenen Status
beendet

Thanks in advance for any help.

If anyone else has this problem in the future, here’s what fixed it for me:
the system config file for msmtprc in /etc/ has to be chmod 644 and not chmod 600. Then Icinga can send out mails.

1 Like