From fd00ac533a460fdab7cd7c38aafc5de56ee2f65d Mon Sep 17 00:00:00 2001 From: Miguel Cabrerizo <30386061+doncicuto@users.noreply.github.com> Date: Tue, 29 Aug 2023 09:08:24 +0200 Subject: [PATCH] feat: add reply-to header in email notification (#6393) * feat: add reply-to header to smtp messages * fix: grpc reply_to_address min 0 and js var name * fix: add missing translations * fix merge and linting --------- Co-authored-by: Livio Spring --- cmd/defaults.yaml | 9 +- .../notification-settings.component.html | 13 ++- .../notification-settings.component.ts | 7 ++ console/src/assets/i18n/bg.json | 1 + console/src/assets/i18n/de.json | 1 + console/src/assets/i18n/en.json | 1 + console/src/assets/i18n/es.json | 1 + console/src/assets/i18n/fr.json | 1 + console/src/assets/i18n/it.json | 1 + console/src/assets/i18n/ja.json | 1 + console/src/assets/i18n/mk.json | 1 + console/src/assets/i18n/pl.json | 1 + console/src/assets/i18n/pt.json | 1 + console/src/assets/i18n/zh.json | 1 + docs/docs/self-hosting/manage/production.md | 1 + .../api/grpc/admin/iam_settings_converter.go | 27 ++--- internal/command/instance.go | 1 + .../command/instance_smtp_config_model.go | 25 +++-- internal/command/smtp.go | 15 ++- internal/command/smtp_test.go | 101 ++++++++++++++++-- .../notification/channels/smtp/channel.go | 15 +-- internal/notification/channels/smtp/config.go | 9 +- internal/notification/handlers/config_smtp.go | 7 +- internal/notification/messages/email.go | 4 + internal/query/projection/smtp.go | 34 +++--- internal/query/projection/smtp_test.go | 14 ++- internal/query/smtp.go | 19 ++-- internal/query/smtp_test.go | 50 +++++---- internal/repository/instance/smtp_config.go | 44 +++++--- proto/zitadel/admin.proto | 16 +++ proto/zitadel/settings.proto | 5 + 31 files changed, 307 insertions(+), 120 deletions(-) diff --git a/cmd/defaults.yaml b/cmd/defaults.yaml index 0fa789baf1..10424663fe 100644 --- a/cmd/defaults.yaml +++ b/cmd/defaults.yaml @@ -371,10 +371,10 @@ SystemDefaults: MachineKeySize: 2048 # ZITADEL_SYSTEMDEFAULTS_SECRETGENERATORS_MACHINEKEYSIZE ApplicationKeySize: 2048 # ZITADEL_SYSTEMDEFAULTS_SECRETGENERATORS_APPLICATIONKEYSIZE PasswordHasher: - # Set hasher configuration for user passwords. - # Passwords previously hashed with a different algorithm - # or cost are automatically re-hashed using this config, - # upon password validation or update. + # Set hasher configuration for user passwords. + # Passwords previously hashed with a different algorithm + # or cost are automatically re-hashed using this config, + # upon password validation or update. Hasher: Algorithm: "bcrypt" # ZITADEL_SYSTEMDEFAULTS_PASSWORDHASHER_HASHER_ALGORITHM Cost: 14 # ZITADEL_SYSTEMDEFAULTS_PASSWORDHASHER_HASHER_COST @@ -688,6 +688,7 @@ DefaultInstance: # If the host of the sender is different from ExternalDomain set DefaultInstance.DomainPolicy.SMTPSenderAddressMatchesInstanceDomain to false From: # ZITADEL_DEFAULTINSTANCE_SMTPCONFIGURATION_SMTP_FROM FromName: # ZITADEL_DEFAULTINSTANCE_SMTPCONFIGURATION_SMTP_FROMNAME + ReplyToAddress: # ZITADEL_DEFAULTINSTANCE_SMTPCONFIGURATION_SMTP_REPLYTOADDRESS MessageTexts: - MessageTextType: InitCode Language: de diff --git a/console/src/app/modules/policies/notification-settings/notification-settings.component.html b/console/src/app/modules/policies/notification-settings/notification-settings.component.html index f01e1ddac6..5895eb58f5 100644 --- a/console/src/app/modules/policies/notification-settings/notification-settings.component.html +++ b/console/src/app/modules/policies/notification-settings/notification-settings.component.html @@ -15,12 +15,17 @@
{{ 'SETTING.SMTP.SENDERADDRESS' | translate }} - + {{ 'SETTING.SMTP.SENDERNAME' | translate }} - + + + + + {{ 'SETTING.SMTP.REPLYTOADDRESS' | translate }} + @@ -29,12 +34,12 @@ {{ 'SETTING.SMTP.HOSTANDPORT' | translate }} - + {{ 'SETTING.SMTP.USER' | translate }} - +