# How to configure secure\_password for an xpack email?

**URL:** <https://discuss.elastic.co/t/how-to-configure-secure-password-for-an-xpack-email/233957>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting, docker\
**Created:** [May 22, 2020, 7:55pm UTC](https://discuss.elastic.co/t/how-to-configure-secure-password-for-an-xpack-email/233957 "2020-05-22T19:55:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![manofjoy](https://avatars.discourse-cdn.com/v4/letter/m/ecb155/32.png) [@manofjoy](https://discuss.elastic.co/u/manofjoy)\
**Post date:** [May 22, 2020, 7:55pm UTC](https://discuss.elastic.co/t/how-to-configure-secure-password-for-an-xpack-email/233957/1 "2020-05-22T19:55:12Z")

</div>

1. I have configured email/smtp/user in my docker-compose.yml file.
2. Added action to send email from watcher.
3. Watcher executed and throwing error. I need to configure secure\_password when i add into docker compose, ElasticSearch is not allowing sensitive data in the configuration. Should use keystore or some other way. Please help.

1\> docker-compose.yml configuration:  
services:  
es-master:  
container\_name: es-master  
environment:  
- node.name=es-master  
- xpack.watcher.enabled=true  
- xpack.notification.email.account.outlook\_account.profile=outlook  
- xpack.notification.email.account.outlook\_account.smtp.auth=true  
- xpack.notification.email.account.outlook\_account.smtp.starttls.enable=true  
- xpack.notification.email.account.outlook\_account.smtp.host=emailhostserver  
- xpack.notification.email.account.outlook\_account.smtp.port=25  
- [xpack.notification.email.account.outlook\_account.smtp.user=MANOJ.G@companyemail.com](mailto:xpack.notification.email.account.outlook_account.smtp.user=MANOJ.G@companyemail.com)

2\> error from watcher \_execute:  
"actions" : [  
{  
"id" : "send\_email",  
"type" : "email",  
"status" : "failure",  
"error" : {  
"root\_cause" : [  
{  
"type" : "messaging\_exception",  
"reason" : "failed to send email with subject [TEST: Watcher Notification] via account [outlook\_account]"  
}  
],  
"type" : "messaging\_exception",  
"reason" : "failed to send email with subject [TEST: Watcher Notification] via account [outlook\_account]",  
"caused\_by" : {  
"type" : "authentication\_failed\_exception",  
"reason" : "failed to connect, no password specified?"  
}  
}  
}  
]

3\> specified pwd in docker-compose.yml  
`- xpack.notification.email.account.outlook_account.smtp.secure_password=abceEdmdb`

Observed error:-

`"Caused by: java.lang.IllegalArgumentException: Setting [xpack.notification.email.account.outlook_account.smtp.secure_password] is a secure setting and must be stored inside the Elasticsearch keystore, but was found inside elasticsearch.yml",`

How to configure secure\_password, please help?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [May 26, 2020, 10:47am UTC](https://discuss.elastic.co/t/how-to-configure-secure-password-for-an-xpack-email/233957/2 "2020-05-26T10:47:38Z")

</div>

See [https://www.elastic.co/guide/en/elasticsearch/reference/master/docker.html#docker-keystore-bind-mount](https://www.elastic.co/guide/en/elasticsearch/reference/master/docker.html#docker-keystore-bind-mount)

You need to create a keystore and mount it into your image.

---

<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:** [June 23, 2020, 10:47am UTC](https://discuss.elastic.co/t/how-to-configure-secure-password-for-an-xpack-email/233957/3 "2020-06-23T10:47:44Z")

</div>

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