FIX account mail filtering move to folder folders are hardcoded

This commit is contained in:
2026-10-07 22:51:25 +03:00
parent 592b83fc73
commit 17ca5f0fa7
7 changed files with 52 additions and 11 deletions
+2 -2
View File
@@ -294,8 +294,8 @@ function normalizeAccount(input) {
if ((action === 'move' || action === 'label') && !value) {
throw new Error(`Mail rule ${index + 1} needs a destination folder or label.`);
}
if (action === 'move' && !['Inbox', 'Archive', 'Trash'].includes(value)) {
throw new Error(`Mail rule ${index + 1} must move messages to Inbox, Archive, or Trash.`);
if (action === 'move' && !['Inbox', 'Archive', 'Trash'].includes(value) && !value.startsWith(CUSTOM_FOLDER_PREFIX)) {
throw new Error(`Mail rule ${index + 1} must move messages to Inbox, Archive, Trash, or one of your folders.`);
}
return { id: String(rule.id || randomUUID()), senderContains, subjectContains, action, value };
});