diff --git a/overseerr-api.yml b/overseerr-api.yml index 81faf737..637af162 100644 --- a/overseerr-api.yml +++ b/overseerr-api.yml @@ -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 diff --git a/server/lib/email/index.ts b/server/lib/email/index.ts index 9f0a9fcf..1274d6a8 100644 --- a/server/lib/email/index.ts +++ b/server/lib/email/index.ts @@ -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: { diff --git a/server/lib/settings.ts b/server/lib/settings.ts index c5390f99..a9e459b4 100644 --- a/server/lib/settings.ts +++ b/server/lib/settings.ts @@ -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', }, diff --git a/src/components/Settings/Notifications/NotificationsEmail.tsx b/src/components/Settings/Notifications/NotificationsEmail.tsx index a22c446f..a7684bf0 100644 --- a/src/components/Settings/Notifications/NotificationsEmail.tsx +++ b/src/components/Settings/Notifications/NotificationsEmail.tsx @@ -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 = () => {
-
diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index 78d6388d..e31d4d78 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -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 OpenPGP", "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.",