You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It appears as though when a user's name contains a comma, such as when mapping an Azure AD name to their name in "FamilyName, GivenName" format, emails cannot be sent to the user. See the below stack trace for an example. Editing the user's name to remove the last name and comma fixed the emails. This occurs for both emails sent during the enrollment flow as well as when attempting to send via the user detail page. To be clear, this is the Name, not Username. Presumably other special characters can break this parsing too but I have not tested.
To Reproduce
Steps to reproduce the behavior:
Have a user set up with a name such as "Smith, John"
Click "Email recovery link" and select a flow
See in the event log that an exception occurred and no email was sent
Expected behavior
I expect a user's name format to not impact the ability to send emails. If there are certain restrictions for names, then they should be restricted at user write, not after when trying to send an email. Is the user's name necessary for sending emails? Can we address to just their email address and omit the name?
Actually, after trying out copying an email address from Gmail, I got the following kind of text in my clipboard: "email@redacted.com" <email@redacted.com>
So perhaps the name just needs to be put in quotes and those are missing?
Screenshots
If applicable, add screenshots to help explain your problem.
Logs
Stacktrace from authentik
Traceback (most recent call last):
File "/ak-root/venv/lib/python3.12/site-packages/celery/app/trace.py", line 453, in trace_task
R = retval = fun(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/celery/app/trace.py", line 736, in __protected_call__
return self.run(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
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 89, in send_mail
backend.send_messages([message_object])
File "/ak-root/venv/lib/python3.12/site-packages/django/core/mail/backends/smtp.py", line 136, in send_messages
sent = self._send(message)
^^^^^^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/django/core/mail/backends/smtp.py", line 151, in _send
sanitize_address(addr, encoding) for addr in email_message.recipients()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ak-root/venv/lib/python3.12/site-packages/django/core/mail/message.py", line 92, in sanitize_address
raise ValueError(
builtins.ValueError: Invalid address; only Smith could be parsed from "Smith, John <email@redacted.com>"
Version and Deployment (please complete the following information):
authentik version: 2024.4.2
Deployment: helm
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
It appears as though when a user's name contains a comma, such as when mapping an Azure AD name to their name in "FamilyName, GivenName" format, emails cannot be sent to the user. See the below stack trace for an example. Editing the user's name to remove the last name and comma fixed the emails. This occurs for both emails sent during the enrollment flow as well as when attempting to send via the user detail page. To be clear, this is the Name, not Username. Presumably other special characters can break this parsing too but I have not tested.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect a user's name format to not impact the ability to send emails. If there are certain restrictions for names, then they should be restricted at user write, not after when trying to send an email. Is the user's name necessary for sending emails? Can we address to just their email address and omit the name?
Actually, after trying out copying an email address from Gmail, I got the following kind of text in my clipboard:
"email@redacted.com" <email@redacted.com>
So perhaps the name just needs to be put in quotes and those are missing?
Screenshots
If applicable, add screenshots to help explain your problem.
Logs
Stacktrace from authentik
Version and Deployment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: