a year ago
I am using python to send messages through SMTP. I get an internal server error. I have configured correctly the host, port and user/pass for the SMTP service (mailersend)
It gives a WORKER TIMEOUT on sock.conect() -- sounds like a networking issue blocking outboud traffic?
```
File "/app/main.py", line 46, in forgot_password
resp, success = mail_client.send_mail([email], subject, body, "IT Team")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/utils.py", line 37, in send_mail
with smtplib.SMTP_SSL(self.__host, self.__port, context=context) as server:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.nix-profile/lib/python3.11/smtplib.py", line 1050, in init
SMTP.__init__(self, host, port, local_hostname, timeout,
File "/root/.nix-profile/lib/python3.11/smtplib.py", line 255, in init
(code, msg) = self.connect(host, port)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.nix-profile/lib/python3.11/smtplib.py", line 341, in connect
self.sock = self._get_socket(host, port, self.timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.nix-profile/lib/python3.11/smtplib.py", line 1056, in getsocket
new_socket = super()._get_socket(host, port, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.nix-profile/lib/python3.11/smtplib.py", line 312, in getsocket
return socket.create_connection((host, port), timeout,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.nix-profile/lib/python3.11/socket.py", line 836, in create_connection
sock.connect(sa)
File "/opt/venv/lib/python3.11/site-packages/gunicorn/workers/base.py", line 204, in handle_abort
sys.exit(1)
SystemExit: 1
```
1 Replies
a year ago
Hello,
We do not block any outbound traffic.
I would get in contact with your email provider to make sure they aren't blocking your application when its deployed to Railway.
Status changed to Closed brody • about 1 year ago