Icinga2 Notifications going to Junk emails in outlook

By default, the local MTA which is called by the mail binary, uses the current daemon user name. Historically, the Debian packages use nagios instead of icinga (don’t ask). That being said, the notification script is executed as nagios user and as such, the “sender from” uses username@fqdn.

You can either adopt this to a different local username in /etc/aliases, or you’ll pass this as parameter to the mail command. In recent Icinga versions, there was effort taken in this direction, and with setting the notification_from custom variable in your notification apply rule, you can override this setting.

In the background, the NotificationCommand passes this string to the mail notification scripts in /etc/icinga2/scripts. Inside the scripts, it detects Debian or something else and passes the corresponding parameter. So if the notification_from setting doesn’t work immediately, you have to debug the script then.

Cheers,
Michael

PS: Almost forgot about it, I’ve written a howto for this: Change "mail from" for Icinga notifications