# ElastAlert Error smtplib.SMTPSenderRefused: (530, b'5.7.0 Authentication Required. Learn more at\\n5.7.0

**URL:** <https://discuss.elastic.co/t/elastalert-error-smtplib-smtpsenderrefused-530-b5-7-0-authentication-required-learn-more-at-n5-7-0/344766>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-monitoring, elastic-stack-alerting, docker\
**Created:** [October 10, 2023, 10:00pm UTC](https://discuss.elastic.co/t/elastalert-error-smtplib-smtpsenderrefused-530-b5-7-0-authentication-required-learn-more-at-n5-7-0/344766 "2023-10-10T22:00:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![huzaifa224](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/huzaifa224/32/105868_2.png) [@huzaifa224](https://discuss.elastic.co/u/huzaifa224)\
**Post date:** [October 10, 2023, 10:00pm UTC](https://discuss.elastic.co/t/elastalert-error-smtplib-smtpsenderrefused-530-b5-7-0-authentication-required-learn-more-at-n5-7-0/344766/1 "2023-10-10T22:00:32Z")

</div>

I am trying to configure elastalert 2 to read from elasticsearch index and send alert according to configured rule, i am using gmail smtp and app password to achieve this. Every thing is running fine but when i try to test it, its giving me the authentication error however i have changed app password multiple time but nothing did work.  
First i gave the smtp\_auth\_file location to read the creds but that didn't work and Elastalert won'tstart then i have define the user and pass in file then its get start but giving authentication error  
Here is my elastalert config file.

```auto
rules_folder: /opt/elastalert/rules
run_every:
  seconds: 10

buffer_time:
  minutes: 15

es_host: x.x.x.x
es_port: 9200

es_username: elastic
es_password: upmFVKkXXgaLONnUzhp

writeback_index: elastalerting
writeback_alias: elastalerting

alert_time_limit:
  days: 2

  #smtp_user: elk-noti@gmail.com
  #smtp_password: fsdp gwvm emyo jdiq
smtp_host: "smtp.gmail.com"
smtp_port: 587
smtp_ssl: false
from_addr: "elk-noti@gmail.com"
#smtp_auth_file: "/opt/elastalert/authen.yaml"
user: elk-noti@gmail.com
password: fsdojdipgwvmemyq

```

---

<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 7, 2023, 10:01pm UTC](https://discuss.elastic.co/t/elastalert-error-smtplib-smtpsenderrefused-530-b5-7-0-authentication-required-learn-more-at-n5-7-0/344766/2 "2023-11-07T22:01:23Z")

</div>

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