# Testing alerting email action

**URL:** <https://discuss.elastic.co/t/testing-alerting-email-action/255030>\
**Category:** Elastic Observability\
**Tags:** elastic-stack-monitoring, elastic-stack-alerting\
**Created:** [November 11, 2020, 9:11am UTC](https://discuss.elastic.co/t/testing-alerting-email-action/255030 "2020-11-11T09:11:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmwant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bmwant/32/78810_2.png) [@bmwant](https://discuss.elastic.co/u/bmwant)\
**Post date:** [November 11, 2020, 9:11am UTC](https://discuss.elastic.co/t/testing-alerting-email-action/255030/1 "2020-11-11T09:11:10Z")

</div>

Hey, I'm trying to setup email notifications and here's my current config within `/etc/kibana/kibana.yml`. I have self-managed ELK installation (Kibana 7.9.2) on Ubuntu.

```auto
xpack.actions.preconfigured:
 default-email:
   name: preconfigured-email-action-type
   actionTypeId: .email
   config:
     from: "alerting@look.com"
     host: smtp-mail.outlook.com
     port: 587
     secure: true
   secrets:
     user: "alerting@look.com"
     password: "super-strong-password"

```

I see this preconfigured action but it doesnt seem to be working.

The issue is the configuration is correct (when testing for example via simple python script)

```python
    context = ssl.create_default_context()
    with smtplib.SMTP(SERVER, port=PORT) as server:
        server.ehlo()
        server.starttls(context=context)
        server.login(USERNAME, PASSWORD)
        server.sendmail(FROM, TO, message)
        server.quit()

```

Is there a way to test/validate this config?  
Where to find/enable extra logging to see whether something is wrong with the integration?

---

<div class="post-metadata">

**Author:** ![bmwant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bmwant/32/78810_2.png) [@bmwant](https://discuss.elastic.co/u/bmwant)\
**Post date:** [November 11, 2020, 11:07am UTC](https://discuss.elastic.co/t/testing-alerting-email-action/255030/2 "2020-11-11T11:07:52Z")

</div>

Ok, so I was able to spot the issue with `journalctl -u kibana -f` and logs say something about wrong SSL configuration

```auto
Nov 11 10:54:41 elk kibana[7917]: {"type":"log","@timestamp":"2020-11-11T10:54:41Z","tags":["info","plugins","eventLog"],"pid":7917,"message":"event logged: {\"event\":
{\"provider\":\"actions\",\"action\":\"execute\",\"start\":\"2020-11-11T10:54:41.490Z\",\"end\":\"2020-11-11T10:54:41.573Z\",\"duration\":83000000,\"outcome\":\"failure\"},\"kibana\":
{\"saved_objects\":[{\"rel\":\"primary\",\"type\":\"action\",\"id\":\"default-email\"}],\"server_uuid\":\"f3f4884d-7f82-49ac-b27e-46cced486b31\"},
\"message\":\"action execution failure: .email:default-email: preconfigured-email-action-type\",
\"error\":{\"message\":\"error sending email: 140006590531392:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:\\n\"},
\"@timestamp\":\"2020-11-11T10:54:41.573Z\",\"ecs\":{\"version\":\"1.5.0\"}}"}

```

```auto
error sending email: 140006590531392:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332

```

Now looking for the way to properly configure this part.

---

<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:** [November 4, 2022, 8:17am UTC](https://discuss.elastic.co/t/testing-alerting-email-action/255030/3 "2022-11-04T08:17:25Z")

</div>


