feat: warn about the server's forward limit and an auto-reply too long for it (bulwarkmail/webmail#1155, bulwarkmail/webmail#1208)

This commit is contained in:
Linus Rath
2026-10-31 04:05:57 +01:00
parent 6e697baa46
commit dcbfc907fa
14 changed files with 614 additions and 7 deletions
+10
View File
@@ -33,6 +33,16 @@ export class FiltersLoginChangedError extends Error {
}
}
/** The account's filters as the server has them now (its active script, parsed). */
export async function readAccountFilters(accountId: string = getSieveAccountId()): Promise<ParseResult> {
const all = await getSieveScripts(accountId);
const scripts = all.filter((s) => s.name !== VACATION_SCRIPT_NAME);
const script = scripts.find((s) => s.isActive) || scripts[0] || null;
return script
? parseScript(await getSieveScriptContent(script.blobId, accountId))
: { rules: [], isOpaque: false, externalRequires: [] };
}
/**
* Read the account's script from the server, let `modify` change its rules,
* and write the result back as the active script, keeping the vacation