Icinga2 Notifications going to Junk emails in outlook

After SMTP configuration on Icinga2 Master. Started getting notifications & somehow notifications to going to junk folder in outlook… Do i have to manually update to route to inbox or any settings that i am missing in Icinga2 master?

The mail relay or server which sends the actual mail message needs to fulfill trusted requirements such as having an MX record for the DNS zone, an A as well as PTR record. Otherwise the receiving mail servers will not trust them and mark them as spam.

Here’s some further reading on the matter: https://www.linode.com/docs/email/running-a-mail-server/

1 Like

Thanks for your response. One more question, i would like to add here. When i am getting the emails from nagios@SLC-ICINGA2-01… I never defined this anywhere. Is there anyway i can change this to something else?

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.


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

Thanks for your response Michael. We have been using Amazon SES which should fulfill trusted requirements already… We have been using the ssmtp & postfix as external mail services.
Any configurations i missed from icinga2?

In case you are using the local Postfix as MTA on your Icinga box, you should be fine with using the notification commands and setting the notification_from custom variable in your notification apply rules. Create a dummy notification, and try it.