feat(email): replace 'Enable SSL' setting with more descriptive/clear 'Encryption Method' setting (#1549)

* feat(email): replace 'Enable SSL' setting with more descriptive/clear 'Encryption Method' setting

* fix: clarify settings & add true 'none' option
pull/1568/head
TheCatLady 3 years ago committed by GitHub
parent 11dc8ff92a
commit 69ab7cc660
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1255,6 +1255,12 @@ components:
secure:
type: boolean
example: false
ignoreTls:
type: boolean
example: false
requireTls:
type: boolean
example: false
authUser:
type: string
nullable: true

@ -13,6 +13,8 @@ class PreparedEmail extends Email {
host: settings.options.smtpHost,
port: settings.options.smtpPort,
secure: settings.options.secure,
ignoreTLS: settings.options.ignoreTls,
requireTLS: settings.options.requireTls,
tls: settings.options.allowSelfSigned
? {
rejectUnauthorized: false,
@ -26,6 +28,7 @@ class PreparedEmail extends Email {
}
: undefined,
});
if (pgpKey) {
transport.use(
'stream',
@ -36,6 +39,7 @@ class PreparedEmail extends Email {
})
);
}
super({
message: {
from: {

@ -135,6 +135,8 @@ export interface NotificationAgentEmail extends NotificationAgentConfig {
smtpHost: string;
smtpPort: number;
secure: boolean;
ignoreTls: boolean;
requireTls: boolean;
authUser?: string;
authPass?: string;
allowSelfSigned: boolean;
@ -275,6 +277,8 @@ class Settings {
smtpHost: '',
smtpPort: 587,
secure: false,
ignoreTls: false,
requireTls: false,
allowSelfSigned: false,
senderName: 'Overseerr',
},

@ -20,7 +20,13 @@ const messages = defineMessages({
emailsender: 'Sender Address',
smtpHost: 'SMTP Host',
smtpPort: 'SMTP Port',
enableSsl: 'Enable SSL',
encryption: 'Encryption Method',
encryptionTip:
'In most cases, Implicit TLS uses port 465 and STARTTLS uses port 587',
encryptionNone: 'None',
encryptionDefault: 'Use STARTTLS if available',
encryptionOpportunisticTls: 'Always use STARTTLS',
encryptionImplicitTls: 'Use Implicit TLS',
authUser: 'SMTP Username',
authPass: 'SMTP Password',
emailsettingssaved: 'Email notification settings saved successfully!',
@ -29,8 +35,6 @@ const messages = defineMessages({
toastEmailTestSuccess: 'Email test notification sent!',
toastEmailTestFailed: 'Email test notification failed to send.',
allowselfsigned: 'Allow Self-Signed Certificates',
ssldisabletip:
'SSL should be disabled on standard TLS connections (port 587)',
senderName: 'Sender Name',
validationEmail: 'You must provide a valid email address',
emailNotificationTypesAlertDescription:
@ -132,7 +136,13 @@ const NotificationsEmail: React.FC = () => {
emailFrom: data.options.emailFrom,
smtpHost: data.options.smtpHost,
smtpPort: data.options.smtpPort ?? 587,
secure: data.options.secure,
encryption: data.options.secure
? 'implicit'
: data.options.requireTls
? 'opportunistic'
: data.options.ignoreTls
? 'none'
: 'default',
authUser: data.options.authUser,
authPass: data.options.authPass,
allowSelfSigned: data.options.allowSelfSigned,
@ -150,7 +160,9 @@ const NotificationsEmail: React.FC = () => {
emailFrom: values.emailFrom,
smtpHost: values.smtpHost,
smtpPort: Number(values.smtpPort),
secure: values.secure,
secure: values.encryption === 'implicit',
ignoreTls: values.encryption === 'none',
requireTls: values.encryption === 'opportunistic',
authUser: values.authUser,
authPass: values.authPass,
allowSelfSigned: values.allowSelfSigned,
@ -196,7 +208,9 @@ const NotificationsEmail: React.FC = () => {
emailFrom: values.emailFrom,
smtpHost: values.smtpHost,
smtpPort: Number(values.smtpPort),
secure: values.secure,
secure: values.encryption === 'implicit',
ignoreTls: values.encryption === 'none',
requireTls: values.encryption === 'opportunistic',
authUser: values.authUser,
authPass: values.authPass,
senderName: values.senderName,
@ -339,14 +353,29 @@ const NotificationsEmail: React.FC = () => {
</div>
</div>
<div className="form-row">
<label htmlFor="secure" className="checkbox-label">
<span>{intl.formatMessage(messages.enableSsl)}</span>
<span className="label-tip">
{intl.formatMessage(messages.ssldisabletip)}
</span>
<label htmlFor="encryption" className="text-label">
{intl.formatMessage(messages.encryption)}
<span className="label-required">*</span>
</label>
<div className="form-input">
<Field type="checkbox" id="secure" name="secure" />
<div className="form-input-field">
<Field as="select" id="encryption" name="encryption">
<option value="none">
{intl.formatMessage(messages.encryptionNone)}
</option>
<option value="default">
{intl.formatMessage(messages.encryptionDefault)}
</option>
<option value="opportunistic">
{intl.formatMessage(
messages.encryptionOpportunisticTls
)}
</option>
<option value="implicit">
{intl.formatMessage(messages.encryptionImplicitTls)}
</option>
</Field>
</div>
</div>
</div>
<div className="form-row">

@ -327,7 +327,12 @@
"components.Settings.Notifications.emailsender": "Sender Address",
"components.Settings.Notifications.emailsettingsfailed": "Email notification settings failed to save.",
"components.Settings.Notifications.emailsettingssaved": "Email notification settings saved successfully!",
"components.Settings.Notifications.enableSsl": "Enable SSL",
"components.Settings.Notifications.encryption": "Encryption Method",
"components.Settings.Notifications.encryptionDefault": "Use STARTTLS if available",
"components.Settings.Notifications.encryptionImplicitTls": "Use Implicit TLS",
"components.Settings.Notifications.encryptionNone": "None",
"components.Settings.Notifications.encryptionOpportunisticTls": "Always use STARTTLS",
"components.Settings.Notifications.encryptionTip": "In most cases, Implicit TLS uses port 465 and STARTTLS uses port 587",
"components.Settings.Notifications.pgpPassword": "PGP Password",
"components.Settings.Notifications.pgpPasswordTip": "Sign encrypted email messages using <OpenPgpLink>OpenPGP</OpenPgpLink>",
"components.Settings.Notifications.pgpPrivateKey": "PGP Private Key",
@ -337,7 +342,6 @@
"components.Settings.Notifications.senderName": "Sender Name",
"components.Settings.Notifications.smtpHost": "SMTP Host",
"components.Settings.Notifications.smtpPort": "SMTP Port",
"components.Settings.Notifications.ssldisabletip": "SSL should be disabled on standard TLS connections (port 587)",
"components.Settings.Notifications.telegramsettingsfailed": "Telegram notification settings failed to save.",
"components.Settings.Notifications.telegramsettingssaved": "Telegram notification settings saved successfully!",
"components.Settings.Notifications.toastDiscordTestFailed": "Discord test notification failed to send.",

Loading…
Cancel
Save