fix(email): accept SMTPUTF8 addresses (#11115)

# Which Problems Are Solved

Zitadel only accepted ASCII email addresses, while some users need to
enter internationalized addresses. For example `mö[email protected]`

# How the Problems Are Solved

- Use `net/mail` to validate email addresses, instead of a custom regex.
`net/mail` correctly accepts UTF-8 characters.
- In the management/v1 API email address validation is removed (only
string limits are applied)

# Additional Changes

- none

# Additional Context

Closes https://github.com/zitadel/zitadel/issues/9821
This commit is contained in:
Tim Möhlmann
2025-12-11 22:59:13 +00:00
committed by GitHub
parent 41cdc7805f
commit d2d85bd30e
3 changed files with 28 additions and 11 deletions
+4 -4
View File
@@ -8579,7 +8579,7 @@ message AddHumanUserRequest {
zitadel.user.v1.Gender gender = 6;
}
message Email {
string email = 1 [(validate.rules).string.email = true];
string email = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
bool is_email_verified = 2;
}
message Phone {
@@ -8660,7 +8660,7 @@ message ImportHumanUserRequest {
}
};
string email = 1 [
(validate.rules).string.email = true,
(validate.rules).string = {min_len: 1, max_len: 200},
(google.api.field_behavior) = REQUIRED,
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
example: "\"minnie@mouse.com\"";
@@ -9139,7 +9139,7 @@ message UpdateHumanEmailRequest {
string user_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
string email = 2 [
(validate.rules).string.email = true,
(validate.rules).string = {min_len: 1, max_len: 200},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
example: "\"gigi@zitadel.com\"";
}
@@ -9154,7 +9154,7 @@ message UpdateHumanEmailResponse {
message ResendHumanInitializationRequest {
string user_id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
string email = 2 [
(validate.rules).string = {ignore_empty: true, email: true},
(validate.rules).string = {ignore_empty: true, min_len: 1, max_len: 200},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
example: "\"updated-email@test.com\"";
description: "Send a new email address if the one set on the user is wrong or has a typo."