mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 23:15:49 +03:00
[GH-ISSUE #494] smtplib.SMTPAuthenticationError: (535, b'5.7.3 Authentication unsuccessful') #364
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#364
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @technobasant on GitHub (Mar 13, 2021).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/494
Unable to a sent email from the application:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "./hc/lib/emails.py", line 28, in run
msg.send()
File "/usr/local/lib/python3.9/site-packages/django/core/mail/message.py", line 284, in send
return self.get_connection(fail_silently).send_messages([self])
File "/usr/local/lib/python3.9/site-packages/django/core/mail/backends/smtp.py", line 102, in send_messages
new_conn_created = self.open()
File "/usr/local/lib/python3.9/site-packages/django/core/mail/backends/smtp.py", line 69, in open
self.connection.login(self.username, self.password)
File "/usr/local/lib/python3.9/smtplib.py", line 734, in login
raise last_exception
File "/usr/local/lib/python3.9/smtplib.py", line 723, in login
(code, resp) = self.auth(
File "/usr/local/lib/python3.9/smtplib.py", line 646, in auth
raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (535, b'5.7.3 Authentication unsuccessful')
@cuu508 commented on GitHub (Mar 15, 2021):
Have you checked your SMTP credentials (host, port, username, password) are correct?
@technobasant commented on GitHub (Mar 21, 2021):
@cuu508
Yeah, I have double checked everything, Still got the error, I was able to connect Gmail server using the below settings ENVs on settings.py though,
SMTP credentials for sending email
EMAIL_HOST = os.getenv("EMAIL_HOST", ""e
EMAIL_PORT = envint("EMAIL_PORT", "587")
EMAIL_HOST_USER = os.getenv("EMAIL_HOST_USER", "")
EMAIL_HOST_PASSWORD = os.getenv("EMAIL_HOST_PASSWORD", "")
EMAIL_USE_TLS = envbool("EMAIL_USE_TLS", "True")
EMAIL_USE_VERIFICATION = envbool("EMAIL_USE_VERIFICATION", "True")
The problem still exists, I was unable to set email server using ENV variables and got an above-mentioned error. This seems like Django isseue
@cuu508 commented on GitHub (Mar 21, 2021):
So, problem solved?
@technobasant commented on GitHub (Mar 21, 2021):
@cuu508
I want to set up a separate dedicated mail server for this app and it failed, I was testing with a Gmail account, and its works, I am still not sure why the Auth error is thrown when I can log in with the same credentials?
@cuu508 commented on GitHub (Mar 21, 2021):
Have you checked the SMTP (not POP3, not IMAP) credentials with a different client, and they work?
If you're using port 25, have you checked port 25 is not blocked?
@technobasant commented on GitHub (Mar 21, 2021):
@cuu508
As for the port its open, that's not the issue, POP3 and IMAP I have to test it but I am confident that I am using SMPT credentials..
@cuu508 commented on GitHub (Mar 21, 2021):
Verify the SMTP credentials work with a different client. If you configure, say, Thunderbird, to send email through your SMTP server, does it work?
On residential and even some datacenter locations the port 25 may be blocked by the ISP.
@gelodefaultbrain commented on GitHub (Jan 24, 2022):
It's so weird, when I tried this code on my COMPUTER it worked
but if I tried to run it on a server based from the UK it doesn't work
@aarshcode commented on GitHub (Apr 1, 2023):
Were you able to solve the problem?
I am also facing the same problem. On my own system, I am able to execute the send mail script but on GitHub actions, it gives me an authentication error.
@cuu508 commented on GitHub (Apr 3, 2023):
@aarshcode I don't think this is a Healthchecks-specific problem. You should check Github docs and/or Github support to see if sending emails from GHA is allowed, and what ports and what protocols are allowed.
@harshd3001 commented on GitHub (Jul 24, 2023):
I'm facing the same issue can someone help me with this
it should me this error when i trying loging in gmail with smtp
(535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8 https://support.google.com/mail/?p=BadCredentials f9-20020a170902e98900b001bb892a7a67sm5003108plb.1 - gsmtp')
my email and app password is correct the script runs fine when i run it in my computer but in workflow actions it is giving this error.
@cuu508 commented on GitHub (Jul 28, 2023):
@harshd3001 You should check Github docs and/or Github support to see if sending emails from GHA is allowed, and what ports and what protocols are allowed.
@Doyewole69 commented on GitHub (Mar 26, 2024):
you should create an app password on your gmail account that should solve the problem
@linuxd3v commented on GitHub (May 13, 2024):
When I had this error - It turned out to be that updating the docker-compose smtp settings just wasnt enough, because real smtp configuration was stored in local_settings.py.
I think healthchecks populates the local_settings.py smtp config on container start, but if you updated the docker container smtp env varibles - it doesnt actually update the local_settings.py.
which was the problem in my case - I just had to update the smtp settings in local_settings.py.
@cuu508 commented on GitHub (May 16, 2024):
@linuxd3v were you using the linuxserver image by any chance?
The healthchecks official image does not write local_settings.py and always uses the environment variables that are passed in.
@linuxd3v commented on GitHub (May 16, 2024):
@cuu508 yes - I'm using the linuxserver/healthchecks.
I think when I started using healthchecks (it's been several years) - the official healthchecks/healthchecks image might not have been available yet.