Skip to content

Commit

Permalink
fix: fixed vacation responder issue for free users
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Jan 14, 2025
1 parent 2431193 commit b398824
Show file tree
Hide file tree
Showing 26 changed files with 195 additions and 33 deletions.
28 changes: 20 additions & 8 deletions app/controllers/web/my-account/validate-alias.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ const config = require('#config');
//
const REGEX_BYTES = new RE2(/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i);

const VACATION_FIELDS = [
'vacation_responder_is_enabled',
'vacation_responder_start_date',
'vacation_responder_end_date',
'vacation_responder_subject',
'vacation_responder_message'
];

// eslint-disable-next-line complexity
function validateAlias(ctx, next) {
const body = _.pick(ctx.request.body, [
Expand Down Expand Up @@ -196,16 +204,20 @@ function validateAlias(ctx, next) {

// vacation responder
if (
[
'vacation_responder_is_enabled',
'vacation_responder_start_date',
'vacation_responder_end_date',
'vacation_responder_subject',
'vacation_responder_message'
].some((field) => typeof ctx.request.body[field] !== 'undefined')
VACATION_FIELDS.some(
(field) => typeof ctx.request.body[field] !== 'undefined'
)
) {
// if domain was global then throw error
if (ctx?.state?.domain?.is_global)
if (
ctx?.state?.domain?.is_global &&
(boolean(ctx?.request?.body?.vacation_responder_is_enabled) ||
VACATION_FIELDS.some(
(field) =>
typeof ctx.request.body[field] === 'string' &&
ctx.request.body[field] !== ''
))
)
return ctx.throw(
Boom.badRequest(
ctx.translateError('VACATION_RESPONDER_NOT_SUPPORTED_ON_GLOBAL')
Expand Down
8 changes: 7 additions & 1 deletion locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -10684,5 +10684,11 @@
"We only send when >= 500 status code errors occur (when emails attempted to be forwarded have failed, e.g. Gmail responds with a 500 level error).": "نحن نرسل فقط عندما تحدث أخطاء رمز الحالة >= 500 (عندما تفشل محاولة إعادة توجيه رسائل البريد الإلكتروني، على سبيل المثال، يستجيب Gmail بخطأ المستوى 500).",
"We only send once and once only (we use a calculated bounce fingerprint key and store it in cache to prevent sending duplicates). The bounce fingerprint is a key that is the message's fingerprint combined with a hash of the bounce address and its error code). See the section on": "نحن نرسل مرة واحدة فقط (نستخدم مفتاح بصمة الارتداد المحسوب ونخزنه في ذاكرة التخزين المؤقت لمنع إرسال التكرارات). بصمة الارتداد هي مفتاح يمثل بصمة الرسالة مقترنة بتجزئة عنوان الارتداد ورمز الخطأ الخاص به). راجع القسم الخاص بـ",
"This is added on a per recipient basis at the time of IMAP and/or masked forwarding (in order to protect privacy).": "يتم إضافة ذلك لكل مستلم في وقت IMAP و/أو إعادة التوجيه المقنع (لحماية الخصوصية).",
"is a header we add to messages for debugging with the original recipient (before masked forwarding) for the message.": "هو عنوان نضيفه إلى الرسائل لاستكشاف أخطائها مع المستلم الأصلي (قبل إعادة التوجيه المقنع) للرسالة."
"is a header we add to messages for debugging with the original recipient (before masked forwarding) for the message.": "هو عنوان نضيفه إلى الرسائل لاستكشاف أخطائها مع المستلم الأصلي (قبل إعادة التوجيه المقنع) للرسالة.",
"We accept Visa, Mastercard, American Express, Discover, Diners Club, JCB, China UnionPay, Alipay, Apple Pay, Google Pay, Amazon Pay, Cash App, Link, Bancontact, EPS, giropay, iDEAL, Przelewy24, Sofort, Affirm, Afterpay / Clearpay, Klarna, SEPA Direct Debit, Canadian pre-authorized debits, ACH Direct Debit, and Bank Transfer.": "نحن نقبل Visa وMastercard وAmerican Express وDiscover وDiners Club وJCB وChina UnionPay وAlipay وApple Pay وGoogle Pay وAmazon Pay وCash App وLink وBancontact وEPS وgiropay وiDEAL وPrzelewy24 وSofort وAffirm وAfterpay / Clearpay وKlarna وSEPA Direct Debit والخصومات الكندية المصرح بها مسبقًا وACH Direct Debit والتحويل المصرفي.",
"Vacation Responder Enabled": "تم تمكين خدمة الرد التلقائي",
"Vacation Responder Start Date": "تاريخ بدء الاستجابة للإجازة",
"Vacation Responder End Date": "تاريخ انتهاء صلاحية الرد التلقائي",
"Vacation Responder Subject": "موضوع الرد على الإجازة",
"Vacation Responder Message": "رسالة الرد على الإجازة"
}
8 changes: 7 additions & 1 deletion locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -10684,5 +10684,11 @@
"We only send when >= 500 status code errors occur (when emails attempted to be forwarded have failed, e.g. Gmail responds with a 500 level error).": "Odesíláme pouze tehdy, když dojde k >= 500 chybám stavového kódu (když se e-maily, které se pokusily přeposlat, selhaly, např. Gmail odpoví chybou 500 úrovně).",
"We only send once and once only (we use a calculated bounce fingerprint key and store it in cache to prevent sending duplicates). The bounce fingerprint is a key that is the message's fingerprint combined with a hash of the bounce address and its error code). See the section on": "Odesíláme pouze jednou a pouze jednou (používáme vypočítaný klíč otisku prstu a ukládáme jej do mezipaměti, abychom zabránili odesílání duplikátů). Otisk vráceného otisku je klíč, který je otiskem zprávy kombinovaným s hash adresy vracení a jejího chybového kódu). Viz část o",
"This is added on a per recipient basis at the time of IMAP and/or masked forwarding (in order to protect privacy).": "Toto je přidáno na základě jednotlivých příjemců v době IMAP a/nebo maskovaného přeposílání (za účelem ochrany soukromí).",
"is a header we add to messages for debugging with the original recipient (before masked forwarding) for the message.": "je hlavička, kterou přidáváme do zpráv pro ladění s původním příjemcem (před maskovaným přeposláním) zprávy."
"is a header we add to messages for debugging with the original recipient (before masked forwarding) for the message.": "je hlavička, kterou přidáváme do zpráv pro ladění s původním příjemcem (před maskovaným přeposláním) zprávy.",
"We accept Visa, Mastercard, American Express, Discover, Diners Club, JCB, China UnionPay, Alipay, Apple Pay, Google Pay, Amazon Pay, Cash App, Link, Bancontact, EPS, giropay, iDEAL, Przelewy24, Sofort, Affirm, Afterpay / Clearpay, Klarna, SEPA Direct Debit, Canadian pre-authorized debits, ACH Direct Debit, and Bank Transfer.": "Přijímáme karty Visa, Mastercard, American Express, Discover, Diners Club, JCB, China UnionPay, Alipay, Apple Pay, Google Pay, Amazon Pay, Cash App, Link, Bancontact, EPS, giropay, iDEAL, Przelewy24, Sofort, Affirm, Afterpay / Clearpay, Klarna, SEPA inkaso, kanadská předautorizovaná debetní platba, ACH inkaso a bankovní převod.",
"Vacation Responder Enabled": "Prázdný odpovídač povolen",
"Vacation Responder Start Date": "Datum zahájení prázdninového odpovídače",
"Vacation Responder End Date": "Datum ukončení prázdninové odpovědi",
"Vacation Responder Subject": "Předmět prázdninového odpovídače",
"Vacation Responder Message": "Zpráva odpovídače na dovolenou"
}
8 changes: 7 additions & 1 deletion locales/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -7687,5 +7687,11 @@
"We only send when >= 500 status code errors occur (when emails attempted to be forwarded have failed, e.g. Gmail responds with a 500 level error).": "Vi sender kun, når der opstår >= 500 statuskodefejl (når e-mails, der er forsøgt videresendt, er mislykkedes, f.eks. svarer Gmail med en fejl på 500 niveauer).",
"We only send once and once only (we use a calculated bounce fingerprint key and store it in cache to prevent sending duplicates). The bounce fingerprint is a key that is the message's fingerprint combined with a hash of the bounce address and its error code). See the section on": "Vi sender kun én gang og kun én gang (vi bruger en beregnet afvisningsfingeraftryksnøgle og gemmer den i cachen for at forhindre afsendelse af dubletter). Afvisningsfingeraftrykket er en nøgle, der er beskedens fingeraftryk kombineret med en hash af afvisningsadressen og dens fejlkode). Se afsnittet vedr",
"This is added on a per recipient basis at the time of IMAP and/or masked forwarding (in order to protect privacy).": "Dette tilføjes pr. modtager på tidspunktet for IMAP og/eller maskeret videresendelse (for at beskytte privatlivets fred).",
"is a header we add to messages for debugging with the original recipient (before masked forwarding) for the message.": "er en header, vi tilføjer til beskeder til fejlretning med den oprindelige modtager (før maskeret videresendelse) for beskeden."
"is a header we add to messages for debugging with the original recipient (before masked forwarding) for the message.": "er en header, vi tilføjer til beskeder til fejlretning med den oprindelige modtager (før maskeret videresendelse) for beskeden.",
"We accept Visa, Mastercard, American Express, Discover, Diners Club, JCB, China UnionPay, Alipay, Apple Pay, Google Pay, Amazon Pay, Cash App, Link, Bancontact, EPS, giropay, iDEAL, Przelewy24, Sofort, Affirm, Afterpay / Clearpay, Klarna, SEPA Direct Debit, Canadian pre-authorized debits, ACH Direct Debit, and Bank Transfer.": "Vi accepterer Visa, Mastercard, American Express, Discover, Diners Club, JCB, China UnionPay, Alipay, Apple Pay, Google Pay, Amazon Pay, Cash App, Link, Bancontact, EPS, giropay, iDEAL, Przelewy24, Sofort, Affirm, Afterpay / Clearpay, Klarna, SEPA Direct Debit, canadisk forhåndsautoriseret debitering, ACH Direct Debit og Bankoverførsel.",
"Vacation Responder Enabled": "Feriesvar er aktiveret",
"Vacation Responder Start Date": "Startdato for feriesvar",
"Vacation Responder End Date": "Slutdato for feriesvar",
"Vacation Responder Subject": "Emne for feriesvar",
"Vacation Responder Message": "Feriesvarsmeddelelse"
}
8 changes: 7 additions & 1 deletion locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -9723,5 +9723,11 @@
"We only send when >= 500 status code errors occur (when emails attempted to be forwarded have failed, e.g. Gmail responds with a 500 level error).": "Wir senden nur, wenn Statuscodefehler >= 500 auftreten (wenn der Versuch, E-Mails weiterzuleiten, fehlgeschlagen ist, z. B. antwortet Gmail mit einem Fehler der Stufe 500).",
"We only send once and once only (we use a calculated bounce fingerprint key and store it in cache to prevent sending duplicates). The bounce fingerprint is a key that is the message's fingerprint combined with a hash of the bounce address and its error code). See the section on": "Wir senden nur einmal und nur einmal (wir verwenden einen berechneten Bounce-Fingerabdruckschlüssel und speichern ihn im Cache, um das Senden von Duplikaten zu verhindern). Der Bounce-Fingerabdruck ist ein Schlüssel, der den Fingerabdruck der Nachricht kombiniert mit einem Hash der Bounce-Adresse und ihrem Fehlercode darstellt). Siehe den Abschnitt über",
"This is added on a per recipient basis at the time of IMAP and/or masked forwarding (in order to protect privacy).": "Dies wird zum Zeitpunkt der IMAP- und/oder maskierten Weiterleitung (zum Schutz der Privatsphäre) pro Empfänger hinzugefügt.",
"is a header we add to messages for debugging with the original recipient (before masked forwarding) for the message.": "ist ein Header, den wir Nachrichten zum Debuggen mit dem ursprünglichen Empfänger (vor der maskierten Weiterleitung) der Nachricht hinzufügen."
"is a header we add to messages for debugging with the original recipient (before masked forwarding) for the message.": "ist ein Header, den wir Nachrichten zum Debuggen mit dem ursprünglichen Empfänger (vor der maskierten Weiterleitung) der Nachricht hinzufügen.",
"We accept Visa, Mastercard, American Express, Discover, Diners Club, JCB, China UnionPay, Alipay, Apple Pay, Google Pay, Amazon Pay, Cash App, Link, Bancontact, EPS, giropay, iDEAL, Przelewy24, Sofort, Affirm, Afterpay / Clearpay, Klarna, SEPA Direct Debit, Canadian pre-authorized debits, ACH Direct Debit, and Bank Transfer.": "Wir akzeptieren Visa, Mastercard, American Express, Discover, Diners Club, JCB, China UnionPay, Alipay, Apple Pay, Google Pay, Amazon Pay, Cash App, Link, Bancontact, EPS, giropay, iDEAL, Przelewy24, Sofort, Affirm, Afterpay / Clearpay, Klarna, SEPA-Lastschrift, kanadische Lastschriftmandate, ACH-Lastschrift und Banküberweisung.",
"Vacation Responder Enabled": "Abwesenheitsnotiz aktiviert",
"Vacation Responder Start Date": "Startdatum der Urlaubsantwort",
"Vacation Responder End Date": "Enddatum der Abwesenheitsnotiz",
"Vacation Responder Subject": "Betreff der Abwesenheitsnotiz",
"Vacation Responder Message": "Abwesenheitsnotiz"
}
8 changes: 7 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6871,5 +6871,11 @@
"We only send when >= 500 status code errors occur (when emails attempted to be forwarded have failed, e.g. Gmail responds with a 500 level error).": "We only send when >= 500 status code errors occur (when emails attempted to be forwarded have failed, e.g. Gmail responds with a 500 level error).",
"We only send once and once only (we use a calculated bounce fingerprint key and store it in cache to prevent sending duplicates). The bounce fingerprint is a key that is the message's fingerprint combined with a hash of the bounce address and its error code). See the section on": "We only send once and once only (we use a calculated bounce fingerprint key and store it in cache to prevent sending duplicates). The bounce fingerprint is a key that is the message's fingerprint combined with a hash of the bounce address and its error code). See the section on",
"This is added on a per recipient basis at the time of IMAP and/or masked forwarding (in order to protect privacy).": "This is added on a per recipient basis at the time of IMAP and/or masked forwarding (in order to protect privacy).",
"is a header we add to messages for debugging with the original recipient (before masked forwarding) for the message.": "is a header we add to messages for debugging with the original recipient (before masked forwarding) for the message."
"is a header we add to messages for debugging with the original recipient (before masked forwarding) for the message.": "is a header we add to messages for debugging with the original recipient (before masked forwarding) for the message.",
"Vacation responder is not supported on global domains at this time.": "Vacation responder is not supported on global domains at this time.",
"Vacation Responder Enabled": "Vacation Responder Enabled",
"Vacation Responder Start Date": "Vacation Responder Start Date",
"Vacation Responder End Date": "Vacation Responder End Date",
"Vacation Responder Subject": "Vacation Responder Subject",
"Vacation Responder Message": "Vacation Responder Message"
}
8 changes: 7 additions & 1 deletion locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -10682,5 +10682,11 @@
"We only send when >= 500 status code errors occur (when emails attempted to be forwarded have failed, e.g. Gmail responds with a 500 level error).": "Solo enviamos cuando ocurren errores de código de estado >= 500 (cuando los correos electrónicos que se intentaron reenviar fallaron, por ejemplo, Gmail responde con un error de nivel 500).",
"We only send once and once only (we use a calculated bounce fingerprint key and store it in cache to prevent sending duplicates). The bounce fingerprint is a key that is the message's fingerprint combined with a hash of the bounce address and its error code). See the section on": "Solo enviamos una vez y solo una vez (usamos una clave de huella digital de rebote calculada y la almacenamos en caché para evitar enviar duplicados). La huella digital de rebote es una clave que es la huella digital del mensaje combinada con un hash de la dirección de rebote y su código de error). Consulte la sección sobre",
"This is added on a per recipient basis at the time of IMAP and/or masked forwarding (in order to protect privacy).": "Esto se agrega por destinatario en el momento del reenvío IMAP y/o enmascarado (para proteger la privacidad).",
"is a header we add to messages for debugging with the original recipient (before masked forwarding) for the message.": "es un encabezado que agregamos a los mensajes para depurar con el destinatario original (antes del reenvío enmascarado) del mensaje."
"is a header we add to messages for debugging with the original recipient (before masked forwarding) for the message.": "es un encabezado que agregamos a los mensajes para depurar con el destinatario original (antes del reenvío enmascarado) del mensaje.",
"We accept Visa, Mastercard, American Express, Discover, Diners Club, JCB, China UnionPay, Alipay, Apple Pay, Google Pay, Amazon Pay, Cash App, Link, Bancontact, EPS, giropay, iDEAL, Przelewy24, Sofort, Affirm, Afterpay / Clearpay, Klarna, SEPA Direct Debit, Canadian pre-authorized debits, ACH Direct Debit, and Bank Transfer.": "Aceptamos Visa, Mastercard, American Express, Discover, Diners Club, JCB, China UnionPay, Alipay, Apple Pay, Google Pay, Amazon Pay, Cash App, Link, Bancontact, EPS, giropay, iDEAL, Przelewy24, Sofort, Affirm, Afterpay / Clearpay, Klarna, débito directo SEPA, débitos preautorizados canadienses, débito directo ACH y transferencia bancaria.",
"Vacation Responder Enabled": "Contestador automático de vacaciones habilitado",
"Vacation Responder Start Date": "Fecha de inicio del servicio de respuesta a vacaciones",
"Vacation Responder End Date": "Fecha de finalización del servicio de respuesta de vacaciones",
"Vacation Responder Subject": "Asunto del respondedor de vacaciones",
"Vacation Responder Message": "Mensaje de respuesta de vacaciones"
}
Loading

0 comments on commit b398824

Please sign in to comment.