# No emails received from logstash for email output plugin

**URL:** <https://discuss.elastic.co/t/no-emails-received-from-logstash-for-email-output-plugin/143432>\
**Category:** Logstash\
**Created:** [August 8, 2018, 6:28am UTC](https://discuss.elastic.co/t/no-emails-received-from-logstash-for-email-output-plugin/143432 "2018-08-08T06:28:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![naga\_kunchala](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@naga\_kunchala](https://discuss.elastic.co/u/naga_kunchala)\
**Post date:** [August 8, 2018, 6:28am UTC](https://discuss.elastic.co/t/no-emails-received-from-logstash-for-email-output-plugin/143432/1 "2018-08-08T06:28:10Z")

</div>

I do not get any emails from logstash for the below config. Could anyone please help me what is going wrong, also please let me know where can I trace the email logs. There is no any error on running the the config file.

if "INFO" in [MessageType] {  
email {  
to =\> "mymail\_id@ec.com"  
from =\> "logstash.alert@example.com"  
username =\> "mymail\_id@ec.com"  
password =\> "Amma@456"  
port =\> "465"  
via =\> "sendmail"  
use\_tls =\> true  
address =\> "[https://outlook.office365.com/mapi/emsmdb/?MailboxId=d68b1c17-86f8-4b15-9764-d110f5b6b3f1@ec.com](https://outlook.office365.com/mapi/emsmdb/?MailboxId=d68b1c17-86f8-4b15-9764-d110f5b6b3f1@ec.com)"  
body =\> "%{message}"

```
            }

    stdout { }

```

file{ path =\> "/home/TESTING/trap\_testing/CONSOL/INFO.log"}

}

---

<div class="post-metadata">

**Author:** ![naga\_kunchala](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@naga\_kunchala](https://discuss.elastic.co/u/naga_kunchala)\
**Post date:** [August 8, 2018, 6:35am UTC](https://discuss.elastic.co/t/no-emails-received-from-logstash-for-email-output-plugin/143432/2 "2018-08-08T06:35:16Z")

</div>

could you please help me on this what i did wrong

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 8, 2018, 7:14am UTC](https://discuss.elastic.co/t/no-emails-received-from-logstash-for-email-output-plugin/143432/3 "2018-08-08T07:14:15Z")

</div>

If there's nothing in your log perhaps the `if "INFO" in [MessageType] {` conditional isn't true.

> port =\> "465"  
> via =\> "sendmail"  
> use\_tls =\> true  
> address =\> "[https://outlook.office365.com/mapi/emsmdb/?MailboxId=d68b1c17-86f8-4b15-9764-d110f5b6b3f1@ec.com](https://outlook.office365.com/mapi/emsmdb/?MailboxId=d68b1c17-86f8-4b15-9764-d110f5b6b3f1@ec.com)"

The `address` option should contain the address of an SMTP server. Also, with `via => "sendmail"` the `port`, `use_tls`, and `address` options are ignored.

---

<div class="post-metadata">

**Author:** ![naga\_kunchala](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@naga\_kunchala](https://discuss.elastic.co/u/naga_kunchala)\
**Post date:** [August 8, 2018, 8:11am UTC](https://discuss.elastic.co/t/no-emails-received-from-logstash-for-email-output-plugin/143432/4 "2018-08-08T08:11:44Z")

</div>

port , use\_tls, and address deleted from my configuration file but i am not getting email alert to mail id. please find the modified file

if "INFO" in [MessageType] {  
email {  
to =\> "mymail\_id@ec.com"  
from =\> "logstash.alert@example.com"  
username =\> "mymail\_id@ec.com"  
password =\> "Amma@456"  
via =\> "sendmail"  
body =\> "%{message}"

```
        }

stdout { }

```

file{ path =\> "/home/TESTING/trap\_testing/CONSOL/INFO.log"}

}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 8, 2018, 9:47am UTC](https://discuss.elastic.co/t/no-emails-received-from-logstash-for-email-output-plugin/143432/5 "2018-08-08T09:47:55Z")

</div>

Again, how do you know the conditional is true so that the email output even runs? Are you running a local MTA that accepts and sends email to the destination? If not you shouldn't use `via => "sendmail"`.

---

<div class="post-metadata">

**Author:** ![naga\_kunchala](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@naga\_kunchala](https://discuss.elastic.co/u/naga_kunchala)\
**Post date:** [August 8, 2018, 10:09am UTC](https://discuss.elastic.co/t/no-emails-received-from-logstash-for-email-output-plugin/143432/6 "2018-08-08T10:09:07Z")

</div>

Hi Magnusbaeck,

i checked conditional is true, i received the output on console. but did not get email alerts.

---

<div class="post-metadata">

**Author:** ![naga\_kunchala](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@naga\_kunchala](https://discuss.elastic.co/u/naga_kunchala)\
**Post date:** [August 8, 2018, 12:33pm UTC](https://discuss.elastic.co/t/no-emails-received-from-logstash-for-email-output-plugin/143432/7 "2018-08-08T12:33:52Z")

</div>

Hi Magnusbaeck,

i am getting email alerts to my mail id, but some times not received. may i know the reason. if you have any idea please reply me

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 8, 2018, 1:01pm UTC](https://discuss.elastic.co/t/no-emails-received-from-logstash-for-email-output-plugin/143432/8 "2018-08-08T13:01:01Z")

</div>

Check the logs of your local mail server to get clues about when the message disappears (i.e. does the message reach the mail server or not).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 5, 2018, 1:01pm UTC](https://discuss.elastic.co/t/no-emails-received-from-logstash-for-email-output-plugin/143432/9 "2018-09-05T13:01:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
