# Icinga2 Notifications going to Junk emails in outlook

**URL:** <https://community.icinga.com/t/icinga2-notifications-going-to-junk-emails-in-outlook/2234>\
**Category:** Icinga 2\
**Created:** [September 16, 2019, 6:38pm UTC](https://community.icinga.com/t/icinga2-notifications-going-to-junk-emails-in-outlook/2234 "2019-09-16T18:38:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mani.vajrala](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@mani.vajrala](https://community.icinga.com/u/mani.vajrala)\
**Post date:** [September 16, 2019, 6:38pm UTC](https://community.icinga.com/t/icinga2-notifications-going-to-junk-emails-in-outlook/2234/1 "2019-09-16T18:38:52Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://community.icinga.com/user_avatar/community.icinga.com/dnsmichi/32/7721_2.png) [@dnsmichi](https://community.icinga.com/u/dnsmichi)\
**Post date:** [September 16, 2019, 7:17pm UTC](https://community.icinga.com/t/icinga2-notifications-going-to-junk-emails-in-outlook/2234/2 "2019-09-16T19:17:47Z")

</div>

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/](https://www.linode.com/docs/email/running-a-mail-server/)

---

<div class="post-metadata">

**Author:** ![mani.vajrala](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@mani.vajrala](https://community.icinga.com/u/mani.vajrala)\
**Post date:** [September 18, 2019, 7:35pm UTC](https://community.icinga.com/t/icinga2-notifications-going-to-junk-emails-in-outlook/2234/3 "2019-09-18T19:35:51Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://community.icinga.com/user_avatar/community.icinga.com/dnsmichi/32/7721_2.png) [@dnsmichi](https://community.icinga.com/u/dnsmichi)\
**Post date:** [September 19, 2019, 6:53am UTC](https://community.icinga.com/t/icinga2-notifications-going-to-junk-emails-in-outlook/2234/4 "2019-09-19T06:53:30Z")

</div>

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](https://community.icinga.com/t/change-mail-from-for-icinga-notifications/190)

---

<div class="post-metadata">

**Author:** ![mani.vajrala](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@mani.vajrala](https://community.icinga.com/u/mani.vajrala)\
**Post date:** [September 23, 2019, 4:47pm UTC](https://community.icinga.com/t/icinga2-notifications-going-to-junk-emails-in-outlook/2234/5 "2019-09-23T16:47:57Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://community.icinga.com/user_avatar/community.icinga.com/dnsmichi/32/7721_2.png) [@dnsmichi](https://community.icinga.com/u/dnsmichi)\
**Post date:** [September 23, 2019, 5:24pm UTC](https://community.icinga.com/t/icinga2-notifications-going-to-junk-emails-in-outlook/2234/6 "2019-09-23T17:24:30Z")

</div>

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.
