Describe the bug
SMTP stopped working (since end of April) and the error shown by testing the email send is the following:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/manage.py", line 46, in <module>
execute_from_command_line(sys.argv)
File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/base.py", line 413, in run_from_argv
self.execute(*args, **cmd_options)
File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/base.py", line 459, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/authentik/tenants/management/__init__.py", line 38, in handle
self.handle_per_tenant(*args, **options)
File "/ak-root/venv/lib/python3.12/site-packages/django/core/management/base.py", line 107, in wrapper
res = handle_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/authentik/stages/email/management/commands/test_email.py", line 38, in handle_per_tenant
send_mail(message.__dict__, stage.pk)
File "/ak-root/venv/lib/python3.12/site-packages/celery/local.py", line 182, in __call__
return self._get_current_object()(*a, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/celery/app/task.py", line 411, in __call__
return self.run(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/celery/app/autoretry.py", line 60, in run
ret = task.retry(exc=exc, **retry_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/celery/app/task.py", line 720, in retry
raise_with_context(exc or Retry('Task can be retried', None))
File "/ak-root/venv/lib/python3.12/site-packages/celery/app/autoretry.py", line 38, in run
return task._orig_run(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/authentik/stages/email/tasks.py", line 106, in send_mail
raise exc
File "/authentik/stages/email/tasks.py", line 74, in send_mail
backend.open()
File "/ak-root/venv/lib/python3.12/site-packages/django/core/mail/backends/smtp.py", line 94, in open
self.connection.starttls(context=self.ssl_context)
File "/usr/local/lib/python3.12/smtplib.py", line 779, in starttls
self.sock = context.wrap_socket(self.sock,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/ssl.py", line 455, in wrap_socket
return self.sslsocket_class._create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/ssl.py", line 1042, in _create
self.do_handshake()
File "/usr/local/lib/python3.12/ssl.py", line 1320, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1000)
To Reproduce
Configured SMTP via .env file were working for long time before. No changes have been done since then to email setup.
SMTP server is a big cloud vendor so there are no custom home made certificates involved.
Not sure how to debug further
Expected behavior
Email delivered correctly
Version and Deployment (please complete the following information):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug SMTP stopped working (since end of April) and the error shown by testing the email send is the following:
To Reproduce Configured SMTP via .env file were working for long time before. No changes have been done since then to email setup. SMTP server is a big cloud vendor so there are no custom home made certificates involved. Not sure how to debug further
Expected behavior Email delivered correctly
Version and Deployment (please complete the following information):