From ed139b62cdb592492546494d63a2893549020dcd Mon Sep 17 00:00:00 2001 From: Stan Silvert Date: Wed, 17 Aug 2022 12:59:34 -0400 Subject: [PATCH] Realm email doesn't default to port 25 (#3129) --- src/realm-settings/EmailTab.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/realm-settings/EmailTab.tsx b/src/realm-settings/EmailTab.tsx index ca49c963c6..5d11c1c434 100644 --- a/src/realm-settings/EmailTab.tsx +++ b/src/realm-settings/EmailTab.tsx @@ -69,6 +69,10 @@ export const RealmSettingsEmailTab = ({ } const savedRealm = { ...realm, ...form }; + + // For default value, back end is expecting null instead of empty string + if (savedRealm.smtpServer?.port === "") savedRealm.smtpServer.port = null; + await adminClient.realms.update({ realm: realmName }, savedRealm); setRealm(savedRealm); addAlert(t("saveSuccess"), AlertVariant.success); @@ -93,6 +97,9 @@ export const RealmSettingsEmailTab = ({ serverSettings[key] = mapperFn(serverSettings[key]); } + // For default value, back end is expecting null instead of 0 + if (serverSettings.port === 0) serverSettings.port = null; + try { const registered = await registerEmailIfNeeded();