From 941f3248d84eb15b66eb3cb005897a315f4e99dc Mon Sep 17 00:00:00 2001 From: advplyr Date: Wed, 29 May 2024 16:59:43 -0500 Subject: [PATCH] Add:SMTP email setting to disable certificate verification #3030 --- client/pages/config/email.vue | 31 +++++++++-- client/strings/bg.json | 2 + client/strings/bn.json | 2 + client/strings/cs.json | 2 + client/strings/da.json | 2 + client/strings/de.json | 4 +- client/strings/en-us.json | 2 + client/strings/es.json | 2 + client/strings/et.json | 2 + client/strings/fr.json | 4 +- client/strings/gu.json | 2 + client/strings/he.json | 2 + client/strings/hi.json | 2 + client/strings/hr.json | 2 + client/strings/hu.json | 2 + client/strings/it.json | 2 + client/strings/lt.json | 2 + client/strings/nl.json | 2 + client/strings/no.json | 2 + client/strings/pl.json | 2 + client/strings/pt-br.json | 2 + client/strings/ru.json | 2 + client/strings/sv.json | 2 + client/strings/uk.json | 2 + client/strings/vi-vn.json | 2 + client/strings/zh-cn.json | 2 + client/strings/zh-tw.json | 2 + server/objects/settings/EmailSettings.js | 71 +++++++++++++++--------- 28 files changed, 123 insertions(+), 35 deletions(-) diff --git a/client/pages/config/email.vue b/client/pages/config/email.vue index 47aec621..ef864fbc 100644 --- a/client/pages/config/email.vue +++ b/client/pages/config/email.vue @@ -20,13 +20,30 @@
- - -
- {{ $strings.LabelEmailSettingsSecure }} - info_outlined +
+ +
+ + +
+ {{ $strings.LabelEmailSettingsSecure }} + info_outlined +
+
- +
+
+ +
+ + +
+ {{ $strings.LabelEmailSettingsRejectUnauthorized }} + info_outlined +
+
+
+
@@ -119,6 +136,7 @@ export default { host: null, port: 465, secure: true, + rejectUnauthorized: true, user: null, pass: null, testAddress: null, @@ -257,6 +275,7 @@ export default { host: this.newSettings.host, port: this.newSettings.port, secure: this.newSettings.secure, + rejectUnauthorized: this.newSettings.rejectUnauthorized, user: this.newSettings.user, pass: this.newSettings.pass, testAddress: this.newSettings.testAddress, diff --git a/client/strings/bg.json b/client/strings/bg.json index 0858856e..a54e3cd5 100644 --- a/client/strings/bg.json +++ b/client/strings/bg.json @@ -279,6 +279,8 @@ "LabelEdit": "Редакция", "LabelEmail": "Email", "LabelEmailSettingsFromAddress": "От Адрес", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Сигурна", "LabelEmailSettingsSecureHelp": "Ако е вярно възката ще изполва TLS когате се свързва със сървъра. Ако не е то TLS ще се използва ако сървъра поддържа разширението STARTTLS. В повечето случаи задайте тази стойност на истина ако се свързвате към порт 465. За порт 587 или 25 оставете я на лъжа. (от nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Тестов Адрес", diff --git a/client/strings/bn.json b/client/strings/bn.json index 89fe78fe..a07db3d4 100644 --- a/client/strings/bn.json +++ b/client/strings/bn.json @@ -279,6 +279,8 @@ "LabelEdit": "সম্পাদনা করুন", "LabelEmail": "ইমেইল", "LabelEmailSettingsFromAddress": "ঠিকানা থেকে", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "নিরাপদ", "LabelEmailSettingsSecureHelp": "যদি সত্য হয় সার্ভারের সাথে সংযোগ করার সময় সংযোগটি TLS ব্যবহার করবে। মিথ্যা হলে TLS ব্যবহার করা হবে যদি সার্ভার STARTTLS এক্সটেনশন সমর্থন করে। বেশিরভাগ ক্ষেত্রে এই মানটিকে সত্য হিসাবে সেট করুন যদি আপনি পোর্ট 465-এর সাথে সংযোগ করছেন। পোর্ট 587 বা পোর্টের জন্য 25 এটি মিথ্যা রাখুন। (nodemailer.com/smtp/#authentication থেকে)", "LabelEmailSettingsTestAddress": "পরীক্ষার ঠিকানা", diff --git a/client/strings/cs.json b/client/strings/cs.json index b326996d..3460675b 100644 --- a/client/strings/cs.json +++ b/client/strings/cs.json @@ -279,6 +279,8 @@ "LabelEdit": "Upravit", "LabelEmail": "E-mail", "LabelEmailSettingsFromAddress": "Z adresy", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Zabezpečené", "LabelEmailSettingsSecureHelp": "Pokud je true, připojení bude při připojování k serveru používat TLS. Pokud je false, použije se protokol TLS, pokud server podporuje rozšíření STARTTLS. Ve většině případů nastavte tuto hodnotu na true, pokud se připojujete k portu 465. Pro port 587 nebo 25 ponechte hodnotu false. (z nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Testovací adresa", diff --git a/client/strings/da.json b/client/strings/da.json index 96a0d04b..aafd0647 100644 --- a/client/strings/da.json +++ b/client/strings/da.json @@ -279,6 +279,8 @@ "LabelEdit": "Rediger", "LabelEmail": "Email", "LabelEmailSettingsFromAddress": "Fra Adresse", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Sikker", "LabelEmailSettingsSecureHelp": "Hvis sandt, vil forbindelsen bruge TLS ved tilslutning til serveren. Hvis falsk, bruges TLS, hvis serveren understøtter STARTTLS-udvidelsen. I de fleste tilfælde skal denne værdi sættes til sandt, hvis du tilslutter til port 465. Til port 587 eller 25 skal du holde det falsk. (fra nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Test Adresse", diff --git a/client/strings/de.json b/client/strings/de.json index 50bb4c3b..435b11ac 100644 --- a/client/strings/de.json +++ b/client/strings/de.json @@ -279,6 +279,8 @@ "LabelEdit": "Bearbeiten", "LabelEmail": "Email", "LabelEmailSettingsFromAddress": "Von Adresse", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Sicher", "LabelEmailSettingsSecureHelp": "Wenn \"an\", verwendet die Verbindung TLS, wenn du eine Verbindung zum Server herstellst. Bei \"aus\" wird TLS verwendet, wenn der Server die STARTTLS-Erweiterung unterstützt. In den meisten Fällen solltest du diesen Wert auf \"an\" schalten, wenn du eine Verbindung zu Port 465 herstellst. Für Port 587 oder 25 behalte den Wert \"aus\" bei. (von nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Test Adresse", @@ -807,4 +809,4 @@ "ToastSortingPrefixesUpdateSuccess": "Die Sortier-Prefixe wirden geupdated ({0} Einträge)", "ToastUserDeleteFailed": "Benutzer konnte nicht gelöscht werden", "ToastUserDeleteSuccess": "Benutzer gelöscht" -} +} \ No newline at end of file diff --git a/client/strings/en-us.json b/client/strings/en-us.json index 2a390b5f..f2bd04e3 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -279,6 +279,8 @@ "LabelEdit": "Edit", "LabelEmail": "Email", "LabelEmailSettingsFromAddress": "From Address", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Secure", "LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Test Address", diff --git a/client/strings/es.json b/client/strings/es.json index cead84e2..78ff1eba 100644 --- a/client/strings/es.json +++ b/client/strings/es.json @@ -279,6 +279,8 @@ "LabelEdit": "Editar", "LabelEmail": "Email", "LabelEmailSettingsFromAddress": "Remitente", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Seguridad", "LabelEmailSettingsSecureHelp": "Si está activado, se usará TLS para conectarse al servidor. Si está apagado, se usará TLS si su servidor tiene soporte para la extensión STARTTLS. En la mayoría de los casos, puede dejar esta opción activada si se está conectando al puerto 465. Apáguela en el caso de usar los puertos 587 o 25. (de nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Probar Dirección", diff --git a/client/strings/et.json b/client/strings/et.json index fcf7c4ce..a3ee1659 100644 --- a/client/strings/et.json +++ b/client/strings/et.json @@ -279,6 +279,8 @@ "LabelEdit": "Muuda", "LabelEmail": "E-post", "LabelEmailSettingsFromAddress": "Saatja aadress", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Turvaline", "LabelEmailSettingsSecureHelp": "Kui see on tõene, kasutab ühendus serveriga ühenduse loomisel TLS-i. Kui see on väär, kasutatakse TLS-i, kui server toetab STARTTLS-i laiendust. Enamikul juhtudest seadke see väärtus tõeks, kui ühendate pordile 465. Pordi 587 või 25 korral hoidke seda väär. (nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Testi aadress", diff --git a/client/strings/fr.json b/client/strings/fr.json index 0635e823..015b110e 100644 --- a/client/strings/fr.json +++ b/client/strings/fr.json @@ -279,6 +279,8 @@ "LabelEdit": "Modifier", "LabelEmail": "Courriel", "LabelEmailSettingsFromAddress": "Expéditeur", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Sécurisé", "LabelEmailSettingsSecureHelp": "Utiliser TLS lors de la connexion au serveur, autrement TLS sera utilisé si le serveur prend en charge l’extension STARTTLS. Dans la plupart des cas, actviez l’option si vous vous connectez au port 465. Désactivez l’option pour utiliser port 587 ou 25. (source: nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Adresse de test", @@ -807,4 +809,4 @@ "ToastSortingPrefixesUpdateSuccess": "Mise à jour des préfixes de tri ({0} élément)", "ToastUserDeleteFailed": "Échec de la suppression de l’utilisateur", "ToastUserDeleteSuccess": "Utilisateur supprimé" -} +} \ No newline at end of file diff --git a/client/strings/gu.json b/client/strings/gu.json index 11c47504..88ff6799 100644 --- a/client/strings/gu.json +++ b/client/strings/gu.json @@ -279,6 +279,8 @@ "LabelEdit": "Edit", "LabelEmail": "Email", "LabelEmailSettingsFromAddress": "From Address", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Secure", "LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Test Address", diff --git a/client/strings/he.json b/client/strings/he.json index 7d17a2a8..ee6bf07b 100644 --- a/client/strings/he.json +++ b/client/strings/he.json @@ -279,6 +279,8 @@ "LabelEdit": "עריכה", "LabelEmail": "דואר אלקטרוני", "LabelEmailSettingsFromAddress": "מאת", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "מאובטח", "LabelEmailSettingsSecureHelp": "אם מופעל, החיבור ישתמש ב-TLS בעת ההתחברות לשרת. אם לא, אז TLS יהיה בשימוש אם השרת תומך בהרחבת STARTTLS. ברוב המקרים מומלץ להפעיל את הגדרה זו אם אתה מתחבר לפורט 465. לפורט 587 או 25, השאר כבוי. (from nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "כתובת לבדיקה", diff --git a/client/strings/hi.json b/client/strings/hi.json index 83b7f011..1f0657bc 100644 --- a/client/strings/hi.json +++ b/client/strings/hi.json @@ -279,6 +279,8 @@ "LabelEdit": "Edit", "LabelEmail": "Email", "LabelEmailSettingsFromAddress": "From Address", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Secure", "LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Test Address", diff --git a/client/strings/hr.json b/client/strings/hr.json index a3a88e9c..42c6a78c 100644 --- a/client/strings/hr.json +++ b/client/strings/hr.json @@ -279,6 +279,8 @@ "LabelEdit": "Uredi", "LabelEmail": "Email", "LabelEmailSettingsFromAddress": "From Address", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Secure", "LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Test Address", diff --git a/client/strings/hu.json b/client/strings/hu.json index 971c45fc..6a117a0a 100644 --- a/client/strings/hu.json +++ b/client/strings/hu.json @@ -279,6 +279,8 @@ "LabelEdit": "Szerkesztés", "LabelEmail": "E-mail", "LabelEmailSettingsFromAddress": "Feladó címe", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Biztonságos", "LabelEmailSettingsSecureHelp": "Ha igaz, a kapcsolat TLS-t használ a szerverhez való csatlakozáskor. Ha hamis, akkor TLS-t használ, ha a szerver támogatja a STARTTLS kiterjesztést. A legtöbb esetben állítsa ezt az értéket igazra, ha a 465-ös portra csatlakozik. A 587-es vagy 25-ös port esetében tartsa hamis értéken. (a nodemailer.com/smtp/#authentication oldalról)", "LabelEmailSettingsTestAddress": "Teszt cím", diff --git a/client/strings/it.json b/client/strings/it.json index 549ea94d..11af343d 100644 --- a/client/strings/it.json +++ b/client/strings/it.json @@ -279,6 +279,8 @@ "LabelEdit": "Modifica", "LabelEmail": "Email", "LabelEmailSettingsFromAddress": "Da Indirizzo", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Secure", "LabelEmailSettingsSecureHelp": "Se vero, la connessione utilizzerà TLS durante la connessione al server. Se false, viene utilizzato TLS se il server supporta l'estensione STARTTLS. Nella maggior parte dei casi impostare questo valore su true se ci si connette alla porta 465. Per la porta 587 o 25 mantenerlo false. (da nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Test Indirizzo", diff --git a/client/strings/lt.json b/client/strings/lt.json index 5bd42bdf..e9f36ebe 100644 --- a/client/strings/lt.json +++ b/client/strings/lt.json @@ -279,6 +279,8 @@ "LabelEdit": "Redaguoti", "LabelEmail": "El. paštas", "LabelEmailSettingsFromAddress": "Siuntėjo adresas", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Apsaugota", "LabelEmailSettingsSecureHelp": "Jei ši reikšmė yra \"true\", ryšys naudos TLS protokolą. Jei \"false\", TLS bus naudojamas tik tada, jei serveris palaiko STARTTLS plėtinį. Daugumos atveju, jei jungiamasi prie 465 prievado, šią reikšmę turėtumėte nustatyti kaip \"true\". Jei jungiamasi prie 587 arba 25 prievado, turi būti nustatyta \"false\". (iš nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Testinis adresas", diff --git a/client/strings/nl.json b/client/strings/nl.json index 28c3ada1..a6662248 100644 --- a/client/strings/nl.json +++ b/client/strings/nl.json @@ -279,6 +279,8 @@ "LabelEdit": "Wijzig", "LabelEmail": "Email", "LabelEmailSettingsFromAddress": "Van-adres", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Veilig", "LabelEmailSettingsSecureHelp": "Als 'waar', dan gebruikt de verbinding TLS om met de server te verbinden. Als 'onwaar', dan wordt TLS gebruikt als de server de STARTTLS-extensie ondersteunt. In de meeste gevallen kies je voor 'waar' verbindt met poort 465. Voo poort 587 of 25, laat op 'onwaar'. (van nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Test-adres", diff --git a/client/strings/no.json b/client/strings/no.json index 4c4be82f..d600446f 100644 --- a/client/strings/no.json +++ b/client/strings/no.json @@ -279,6 +279,8 @@ "LabelEdit": "Rediger", "LabelEmail": "Epost", "LabelEmailSettingsFromAddress": "Fra Adresse", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Sikker", "LabelEmailSettingsSecureHelp": "Hvis aktivert, vil tilkoblingen bruke TLS under tilkobling til tjeneren. Ellers vil TLS bli brukt hvis tjeneren støtter STARTTLS utvidelsen. I de fleste tilfeller aktiver valget hvis du kobler til med port 465. Med port 587 eller 25 deaktiver valget. (fra nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Test Adresse", diff --git a/client/strings/pl.json b/client/strings/pl.json index ce0109d9..5234a1e2 100644 --- a/client/strings/pl.json +++ b/client/strings/pl.json @@ -279,6 +279,8 @@ "LabelEdit": "Edytuj", "LabelEmail": "Email", "LabelEmailSettingsFromAddress": "From Address", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Secure", "LabelEmailSettingsSecureHelp": "If true the connection will use TLS when connecting to server. If false then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false. (from nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Test Address", diff --git a/client/strings/pt-br.json b/client/strings/pt-br.json index f88f6a5e..4942385f 100644 --- a/client/strings/pt-br.json +++ b/client/strings/pt-br.json @@ -279,6 +279,8 @@ "LabelEdit": "Editar", "LabelEmail": "Email", "LabelEmailSettingsFromAddress": "Remetente", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Seguro", "LabelEmailSettingsSecureHelp": "Se ativado, a conexão utilizará TLS para a conexão ao servidor. Se desativado TLS será usado se o servidor suportar a extensão STARTTLS. Na maioria dos casos ative esse valor se estiver conectando pela porta 465. Para portas 587 ou 25, mantenha inativo. (de nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Endereço de teste", diff --git a/client/strings/ru.json b/client/strings/ru.json index 7b6e9c7c..83f63407 100644 --- a/client/strings/ru.json +++ b/client/strings/ru.json @@ -279,6 +279,8 @@ "LabelEdit": "Редактировать", "LabelEmail": "Email", "LabelEmailSettingsFromAddress": "Адрес От", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Безопасность", "LabelEmailSettingsSecureHelp": "Если значение истинно, то соединение будет использовать TLS при подключении к серверу. Если значение ложно, то TLS будет использован, если сервер поддерживает расширение STARTTLS. В большинстве случаев установите это значение в истину, если вы подключаетесь к порту 465. Для порта 587 или 25 оставьте значение ложным. (из nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Тестовый адрес", diff --git a/client/strings/sv.json b/client/strings/sv.json index fd8c6e69..7347939e 100644 --- a/client/strings/sv.json +++ b/client/strings/sv.json @@ -279,6 +279,8 @@ "LabelEdit": "Redigera", "LabelEmail": "E-post", "LabelEmailSettingsFromAddress": "Från adress", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Säker", "LabelEmailSettingsSecureHelp": "Om sant kommer anslutningen att använda TLS vid anslutning till servern. Om falskt används TLS om servern stöder STARTTLS-tillägget. I de flesta fall, om du ansluter till port 465, bör du ställa in detta värde till sant. För port 587 eller 25, låt det vara falskt. (från nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Testadress", diff --git a/client/strings/uk.json b/client/strings/uk.json index 6d8c311c..2e96e85a 100644 --- a/client/strings/uk.json +++ b/client/strings/uk.json @@ -279,6 +279,8 @@ "LabelEdit": "Редагувати", "LabelEmail": "Електронна пошта", "LabelEmailSettingsFromAddress": "Адреса відправника", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Безпечне", "LabelEmailSettingsSecureHelp": "Увімкніть, аби використовувати TLS при підключенні до сервера. Якщо вимкнути, то TLS буде використано, якщо сервер підтримує STARTTLS. Увімкніть, якщо ви підключаєтеся до порту 465. Вимкніть для портів 587 або 25. (з nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Тестова адреса", diff --git a/client/strings/vi-vn.json b/client/strings/vi-vn.json index 7c6d09b0..eaa9f2ce 100644 --- a/client/strings/vi-vn.json +++ b/client/strings/vi-vn.json @@ -279,6 +279,8 @@ "LabelEdit": "Chỉnh Sửa", "LabelEmail": "Email", "LabelEmailSettingsFromAddress": "Địa chỉ Gửi từ", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "Bảo Mật", "LabelEmailSettingsSecureHelp": "Nếu đúng thì kết nối sẽ sử dụng TLS khi kết nối đến máy chủ. Nếu sai thì TLS sẽ được sử dụng nếu máy chủ hỗ trợ phần mở rộng STARTTLS. Trong hầu hết các trường hợp, hãy đặt giá trị này là đúng nếu bạn kết nối đến cổng 465. Đối với cổng 587 hoặc 25, giữ nó sai. (từ nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "Địa Chỉ Kiểm Tra", diff --git a/client/strings/zh-cn.json b/client/strings/zh-cn.json index fb375aec..2e0bf62b 100644 --- a/client/strings/zh-cn.json +++ b/client/strings/zh-cn.json @@ -279,6 +279,8 @@ "LabelEdit": "编辑", "LabelEmail": "邮箱", "LabelEmailSettingsFromAddress": "发件人地址", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "安全", "LabelEmailSettingsSecureHelp": "如果选是, 则连接将在连接到服务器时使用TLS. 如果选否, 则若服务器支持STARTTLS扩展, 则使用TLS. 在大多数情况下, 如果连接到端口465, 请将该值设置为是. 对于端口587或25, 请保持为否. (来自nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "测试地址", diff --git a/client/strings/zh-tw.json b/client/strings/zh-tw.json index 54e7849b..d3c02071 100644 --- a/client/strings/zh-tw.json +++ b/client/strings/zh-tw.json @@ -279,6 +279,8 @@ "LabelEdit": "編輯", "LabelEmail": "郵箱", "LabelEmailSettingsFromAddress": "發件人位址", + "LabelEmailSettingsRejectUnauthorized": "Reject unauthorized certificates", + "LabelEmailSettingsRejectUnauthorizedHelp": "Disabling SSL certificate validation may expose your connection to security risks, such as man-in-the-middle attacks. Only disable this option if you understand the implications and trust the mail server you are connecting to.", "LabelEmailSettingsSecure": "安全", "LabelEmailSettingsSecureHelp": "如果選是, 則連接將在連接到伺服器時使用TLS. 如果選否, 則若伺服器支援STARTTLS擴展, 則使用TLS. 在大多數情況下, 如果連接到465埠, 請將該值設定為是. 對於587或25埠, 請保持為否. (來自nodemailer.com/smtp/#authentication)", "LabelEmailSettingsTestAddress": "測試位址", diff --git a/server/objects/settings/EmailSettings.js b/server/objects/settings/EmailSettings.js index 13e37ddc..330e1b9c 100644 --- a/server/objects/settings/EmailSettings.js +++ b/server/objects/settings/EmailSettings.js @@ -16,6 +16,7 @@ class EmailSettings { this.host = null this.port = 465 this.secure = true + this.rejectUnauthorized = true this.user = null this.pass = null this.testAddress = null @@ -33,11 +34,17 @@ class EmailSettings { this.host = settings.host this.port = settings.port this.secure = !!settings.secure + this.rejectUnauthorized = !!settings.rejectUnauthorized this.user = settings.user this.pass = settings.pass this.testAddress = settings.testAddress this.fromAddress = settings.fromAddress - this.ereaderDevices = settings.ereaderDevices?.map(d => ({ ...d })) || [] + this.ereaderDevices = settings.ereaderDevices?.map((d) => ({ ...d })) || [] + + // rejectUnauthorized added after v2.10.1 - defaults to true + if (settings.rejectUnauthorized === undefined) { + this.rejectUnauthorized = true + } } toJSON() { @@ -46,11 +53,12 @@ class EmailSettings { host: this.host, port: this.port, secure: this.secure, + rejectUnauthorized: this.rejectUnauthorized, user: this.user, pass: this.pass, testAddress: this.testAddress, fromAddress: this.fromAddress, - ereaderDevices: this.ereaderDevices.map(d => ({ ...d })) + ereaderDevices: this.ereaderDevices.map((d) => ({ ...d })) } } @@ -62,27 +70,30 @@ class EmailSettings { else payload.port = Number(payload.port) } if (payload.secure !== undefined) payload.secure = !!payload.secure + if (payload.rejectUnauthorized !== undefined) payload.rejectUnauthorized = !!payload.rejectUnauthorized if (payload.ereaderDevices !== undefined && !Array.isArray(payload.ereaderDevices)) payload.ereaderDevices = undefined if (payload.ereaderDevices?.length) { // Validate ereader devices - payload.ereaderDevices = payload.ereaderDevices.map((device) => { - if (!device.name || !device.email) { - Logger.error(`[EmailSettings] Update ereader device is invalid`, device) - return null - } - if (!device.availabilityOption || !['adminOrUp', 'userOrUp', 'guestOrUp', 'specificUsers'].includes(device.availabilityOption)) { - device.availabilityOption = 'adminOrUp' - } - if (device.availabilityOption === 'specificUsers' && !device.users?.length) { - device.availabilityOption = 'adminOrUp' - } - if (device.availabilityOption !== 'specificUsers' && device.users?.length) { - device.users = [] - } - return device - }).filter(d => d) + payload.ereaderDevices = payload.ereaderDevices + .map((device) => { + if (!device.name || !device.email) { + Logger.error(`[EmailSettings] Update ereader device is invalid`, device) + return null + } + if (!device.availabilityOption || !['adminOrUp', 'userOrUp', 'guestOrUp', 'specificUsers'].includes(device.availabilityOption)) { + device.availabilityOption = 'adminOrUp' + } + if (device.availabilityOption === 'specificUsers' && !device.users?.length) { + device.availabilityOption = 'adminOrUp' + } + if (device.availabilityOption !== 'specificUsers' && device.users?.length) { + device.users = [] + } + return device + }) + .filter((d) => d) } let hasUpdates = false @@ -116,14 +127,20 @@ class EmailSettings { pass: this.pass } } + // Allow self-signed certs (https://nodemailer.com/smtp/#3-allow-self-signed-certificates) + if (!this.rejectUnauthorized) { + payload.tls = { + rejectUnauthorized: false + } + } return payload } /** - * - * @param {EreaderDeviceObject} device - * @param {import('../user/User')} user + * + * @param {EreaderDeviceObject} device + * @param {import('../user/User')} user * @returns {boolean} */ checkUserCanAccessDevice(device, user) { @@ -140,8 +157,8 @@ class EmailSettings { /** * Get ereader devices accessible to user - * - * @param {import('../user/User')} user + * + * @param {import('../user/User')} user * @returns {EreaderDeviceObject[]} */ getEReaderDevices(user) { @@ -150,12 +167,12 @@ class EmailSettings { /** * Get ereader device by name - * - * @param {string} deviceName + * + * @param {string} deviceName * @returns {EreaderDeviceObject} */ getEReaderDevice(deviceName) { - return this.ereaderDevices.find(d => d.name === deviceName) + return this.ereaderDevices.find((d) => d.name === deviceName) } } -module.exports = EmailSettings \ No newline at end of file +module.exports = EmailSettings