Repository navigation
Description
Before reporting an issue
- I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.
Area
core
Bug Description
When Allow UTF-8 is enabled in a realm's email settings, Keycloak sends an email with an internationalized address without checking whether the connected SMTP server advertised the SMTPUTF8 extension. RFC 6531 section 3.2 requires an SMTPUTF8-aware client to avoid transmitting such an address when the server does not offer the extension.
Version
26.8.2
Regression
- The issue is a regression
Expected behavior
An email containing an internationalized sender, recipient, reply-to, or envelope sender address fails before the SMTP envelope is transmitted if the server does not advertise SMTPUTF8. A message whose addresses are all ASCII can still be sent without the extension.
When Test connection is used with Allow UTF-8 enabled, it reports the missing capability even if the particular test email uses only ASCII addresses, so the action validates the configured mode.
Actual behavior
Keycloak proceeds to send an internationalized email without checking the server's advertised SMTP capabilities. A permissive server may accept the message even though it did not advertise SMTPUTF8. Test connection can also report success for such a server.
How to Reproduce?
- Start a permissive test SMTP server that responds to
EHLOwithout advertisingSMTPUTF8, accepts subsequent SMTP commands, and records them. - Configure a realm to use that server, enable Allow UTF-8, and set the sender address to
autoñ@example.org. - Run Test connection in the realm email settings.
- Observe that Keycloak issues
MAIL FROMdespite the missingSMTPUTF8capability. - Repeat with the ASCII sender address
auto@example.org. The test action reports success even though the server cannot support internationalized addresses under the configured mode.
Anything else?
RFC 6531 section 3.2: https://www.rfc-editor.org/rfc/rfc6531.html#section-3.2
AI assistance was used to draft this report. I checked the affected code in 26.8.2 and prepared local regression tests with a server that omits SMTPUTF8 from its EHLO response.
Metadata
Metadata
Assignees
Labels
Type
Fields
Projects
- StatusShow more project fieldsDone
Activity
Require SMTPUTF8 capability for UTF-8 email
Require SMTPUTF8 capability for UTF-8 email
Require SMTPUTF8 capability for UTF-8 email