This commit is contained in:
2026-04-27 16:01:02 -05:00
parent c4acdb2a66
commit b03c257de1
3 changed files with 65 additions and 16 deletions

View File

@@ -71,6 +71,8 @@ async function refreshQuotaForDomain(req: any, domain: string): Promise<number>
mailboxesRouter.get('/', async (req, res) => {
const domain = String(req.query.domain ?? '').toLowerCase();
const refreshQuota = String(req.query.refreshQuota ?? '').toLowerCase() === 'true';
// Hide soft-deleted mailboxes by default. Set ?includeDeleted=true if you ever want them.
const includeDeleted = String(req.query.includeDeleted ?? '').toLowerCase() === 'true';
if (domain) {
ensureDomain(req, domain);
@@ -82,6 +84,7 @@ mailboxesRouter.get('/', async (req, res) => {
const params: unknown[] = [config.nodeName];
let where = 'WHERE node_name=$1';
if (!includeDeleted) where += ` AND status <> 'deleted'`;
if (domain) { params.push(domain); where += ` AND domain=$${params.length}`; }
const result = await pool.query(