Email Send Issue
maxexcloo opened this issue · comments
First of all, thanks for open sourcing this tool! I really like using it to monitor my cron jobs 👍🏻
I've been having an issue with SMTP emailing, I have checked my user/pass and settings a few times and haven't been able to resolve it, other tools on the server work fine to send email with the same user/pass combo.
My ENV for Docker:
environment:
- DEBUG=False
- DEFAULT_FROM_EMAIL=max@excloo.com
- EMAIL_HOST_PASSWORD=PASS
- EMAIL_HOST_USER=max@excloo.com
- EMAIL_HOST=smtp.gmail.com
- EMAIL_PORT=587
- EMAIL_USE_TLS=True
- SITE_NAME=Healthchecks
- SITE_ROOT=https://healthchecks.excloo.com
- TZ=Australia/Sydney
The error:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
self.run()
File "/app/healthchecks/hc/lib/emails.py", line 26, in run
self.message.send()
File "/lsiopy/lib/python3.11/site-packages/django/core/mail/message.py", line 300, in send
return self.get_connection(fail_silently).send_messages([self])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lsiopy/lib/python3.11/site-packages/django/core/mail/backends/smtp.py", line 128, in send_messages
new_conn_created = self.open()
^^^^^^^^^^^
File "/lsiopy/lib/python3.11/site-packages/django/core/mail/backends/smtp.py", line 95, in open
self.connection.login(self.username, self.password)
File "/usr/lib/python3.11/smtplib.py", line 750, in login
raise last_exception
File "/usr/lib/python3.11/smtplib.py", line 739, in login
(code, resp) = self.auth(
^^^^^^^^^^
File "/usr/lib/python3.11/smtplib.py", line 662, in auth
raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (535, b'5.7.8 Username and Password not accepted. For more information, go to\n5.7.8 https://support.google.com/mail/?p=BadCredentials o18-20020a170903009200b001ddbdd14872sm4449550pld.112 - gsmtp')
Thanks for the report. Can you reproduce the problem with the official Docker image?
Yes, initially I was using that image (with identical settings) and had the same error, not entirely sure what’s going on - can try some tests if there’s any info
I can provide?
It seems to have fixed itself somehow, very very strange...
can i work on this bug?
anybody already working on this issue? Please let me know?
@maxexcloo could it have been a case of you editing the wrong configuration file? Or perhaps the container not getting restarted and so using old values?
Is there something more we should do here, or can we close this issue?
Let’s close it for now, honestly not sure why it suddenly worked but maybe something was blocking the mail also - will close for now.