Default to SSL / TLS on port 465 for SMTP, per RFC 8314

This commit is contained in:
slokhorst 2022-02-19 23:57:28 +01:00 committed by Ben Gotow
parent 3be72eee5c
commit 37928f313d
2 changed files with 5 additions and 2 deletions

View file

@ -192,10 +192,10 @@ export async function expandAccountWithCommonSettings(account: Account) {
imap_security: mstemplate.imap_security || 'SSL / TLS',
imap_allow_insecure_ssl: mstemplate.imap_allow_insecure_ssl || false,
smtp_host: mstemplate.smtp_host,
smtp_port: mstemplate.smtp_port || 587,
smtp_port: mstemplate.smtp_port || 465,
smtp_username: usernameWithFormat(mstemplate.smtp_user_format),
smtp_password: populated.settings.smtp_password || populated.settings.imap_password,
smtp_security: mstemplate.smtp_security || 'STARTTLS',
smtp_security: mstemplate.smtp_security || 'SSL / TLS',
smtp_allow_insecure_ssl: mstemplate.smtp_allow_insecure_ssl || false,
container_folder: mstemplate.container_folder,
};

View file

@ -97,6 +97,9 @@ class AccountIMAPSettingsForm extends React.Component<AccountIMAPSettingsFormPro
if (port === 25 && settings.smtp_security !== 'none') {
onFieldChange({ target: { value: 'none', id: 'settings.smtp_security' } });
}
if (port === 465 && settings.smtp_security !== 'SSL / TLS') {
onFieldChange({ target: { value: 'SSL / TLS', id: 'settings.smtp_security' } });
}
if (port === 587 && settings.smtp_security !== 'STARTTLS') {
onFieldChange({ target: { value: 'STARTTLS', id: 'settings.smtp_security' } });
}