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
@@ -497,8 +497,8 @@ class EpMailPlugin : Plugin() {
require(action != "move" || !value.any { it == '\r' || it == '\n' || it == '\u0000' }) {
"Mail rule ${index + 1} has an invalid destination folder."
}
require(action != "move" || value in setOf("Inbox", "Archive", "Trash")) {
"Mail rule ${index + 1} must move messages to Inbox, Archive, or Trash."
require(action != "move" || value in setOf("Inbox", "Archive", "Trash") || AndroidMailService.isCustomFolder(value)) {
"Mail rule ${index + 1} must move messages to Inbox, Archive, Trash, or one of your folders."
}
result.put(JSONObject()
.put("id", rule.optString("id").ifBlank { UUID.randomUUID().toString() })