After running the sentry on-premise docker container (version 8.20) and passing in the following eviromental variables:
-e SENTRY_EMAIL_HOST="smtp.sendgrid.net"
-e SENTRY_EMAIL_PORT=465
-e SENTRY_EMAIL_USE_TLS="True"
-e SENTRY_EMAIL_USER="apikey"
-e SENTRY_EMAIL_PASSWORD= '****'
I am receiving the following:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
R = retval = fun(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__
return self.run(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/sentry/tasks/base.py", line 54, in _wrapped
result = func(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/sentry/tasks/email.py", line 76, in send_email
send_messages([message])
File "/usr/local/lib/python2.7/site-packages/sentry/utils/email.py", line 415, in send_messages
sent = connection.send_messages(messages)
File "/usr/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 87, in send_messages
new_conn_created = self.open()
File "/usr/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 48, in open
local_hostname=DNS_NAME.get_fqdn())
File "/usr/local/lib/python2.7/smtplib.py", line 256, in __init__
(code, msg) = self.connect(host, port)
File "/usr/local/lib/python2.7/smtplib.py", line 317, in connect
(code, msg) = self.getreply()
File "/usr/local/lib/python2.7/smtplib.py", line 365, in getreply
+ str(e))
SMTPServerDisconnected: Connection unexpectedly closed: timed out
Any one have an idea what might be the cause?
According to Sendgrid Documentation
You can also connect via SSL on port 465.
It seems that currently django.core.mail.backends.smtp.EmailBackend does not support sending emails over ssl and only TSL.
I changed the port to 587 and emails are going through as expected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With