(535, b'5.7.3 Authentication unsuccessful) in railway, but working on localhost

18 Views Asked by At

I've been struggling with this for a while now.. i can't wrap my head around the issue. So when I submit the contact form of my Flask application locally, i receive the content of the contact form. Also a SMTP Test was successful. But when i use railway.app, it doesn't work. The security defaults in Azure are disabled and I use the shared variables in railway for the password and e-mail (They are displayed correctly). The solution presented here didn't work for me, i could not install openssl 1.0.* in the powershell..

These are the deployment logs

[2023-12-16 08:37:00 +0000] [7] [INFO] Starting gunicorn 21.2.0
[2023-12-16 08:37:00 +0000] [7] [INFO] Listening at: http://0.0.0.0:7841 (7)
[2023-12-16 08:37:00 +0000] [7] [INFO] Using worker: sync
[2023-12-16 08:37:00 +0000] [11] [INFO] Booting worker with pid: 11
[2023-12-16 08:38:43,037] ERROR in app: Exception on /contact [POST]
Traceback (most recent call last):
File "/opt/venv/lib/python3.8/site-packages/flask/app.py", line 1455, in wsgi_app
response = self.full_dispatch_request()
File "/opt/venv/lib/python3.8/site-packages/flask/app.py", line 869, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/opt/venv/lib/python3.8/site-packages/flask/app.py", line 867, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/venv/lib/python3.8/site-packages/flask/app.py", line 852, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/app/webpage.py", line 38, in contact
mail.send(msg)
File "/opt/venv/lib/python3.8/site-packages/flask_mail.py", line 491, in send
with self.connect() as connection:
File "/opt/venv/lib/python3.8/site-packages/flask_mail.py", line 144, in __enter__
self.host = self.configure_host()
File "/opt/venv/lib/python3.8/site-packages/flask_mail.py", line 165, in configure_host
host.login(self.mail.username, self.mail.password)
File "/root/.nix-profile/lib/python3.8/smtplib.py", line 748, in login
raise last_exception
File "/root/.nix-profile/lib/python3.8/smtplib.py", line 737, in login
(code, resp) = self.auth(
File "/root/.nix-profile/lib/python3.8/smtplib.py", line 660, in auth
raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (535, b'5.7.3 Authentication unsuccessful [MW4PR04CA0191.namprd04.prod.outlook.com 2023-12-16T08:38:43.019Z 08DBFDC9C3396171]')

What am I missing? Love

0

There are 0 best solutions below