取消前端SMTP中继旧配置自动启用
This commit is contained in:
1 parent
4b802b5d11
commit
3ee61603ca
3 files changed
+9
-10
No files matched your search
@@ -309,7 +309,7 @@ export function updateFormConfig(text, section, path, value) {
|
||||
config.relay.security = relaySecurityForMail(config)
|
||||
config.relay.relayPort = smtpPorts.get(config.relay.security)
|
||||
}
|
||||
if (key.startsWith('relay.') && key !== 'relay.security' && key !== 'relay.enabled' && relayConfigured(config) && ['both', 'starttls', 'implicit_tls'].includes(mailSecurity(config))) {
|
||||
if (key.startsWith('relay.') && key !== 'relay.security' && key !== 'relay.enabled' && config.relay?.enabled === true && relayConfigured(config) && ['both', 'starttls', 'implicit_tls'].includes(mailSecurity(config))) {
|
||||
config.relay.security = relaySecurityForMail(config)
|
||||
if (!validPort(config.relay.relayPort)) config.relay.relayPort = smtpPorts.get(config.relay.security)
|
||||
}
|
||||
@@ -368,8 +368,7 @@ export function validateFormConfig(section, config) {
|
||||
}
|
||||
if (section === 'mail') {
|
||||
const relay = config.relay || {}
|
||||
const configured = relayConfigured(config)
|
||||
const enabled = relay.enabled === true || (relay.enabled === undefined && configured)
|
||||
const enabled = relay.enabled === true
|
||||
if (!['both', 'starttls', 'implicit_tls'].includes(mailSecurity(config))) {
|
||||
errors['listener.security'] = '请选择全部启用、STARTTLS / STLS 或隐式 TLS'
|
||||
}
|
||||
|
||||
@@ -530,7 +530,7 @@ export function usePage(pageKey = 'base') {
|
||||
delete payload.relay
|
||||
}
|
||||
}
|
||||
if (payload.relay && relayConfigured(payload) && !payload.relay.security) {
|
||||
if (payload.relay && payload.relay.enabled === true && relayConfigured(payload) && !payload.relay.security) {
|
||||
payload.relay.security = relaySecurityForMail(payload)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user