From 9899b9af523ad2aef55300c9132d21a687a0a19d Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 17 Aug 2026 19:51:27 +0200 Subject: feat(config): warn when an account configures no trash folder The trash key is mandatory: Delete moves a file into it, so an account without one cannot delete at all. Report it as a config problem naming the account and the key, rather than degrading Delete silently, per the existing "a warning the user cannot act on teaches them to ignore warnings" rule (item 83). Several existing test fixtures loaded accounts with no trash key and asserted zero problems/warnings; added trash=Trash to those where it was incidental to what the test actually covers. --- src/config.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/config.cpp') diff --git a/src/config.cpp b/src/config.cpp index d56099a..8294e4b 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -473,6 +473,21 @@ void Config::load(const QString &path) .arg(account.key)); continue; } + + // Mandatory, unlike sent: Delete moves a file into this folder, so an + // account without one cannot delete at all. Reported rather than + // silently disabled, so the user finds out from a warning rather than + // from a Delete that quietly does nothing. The account still loads; + // only Delete is unusable, which does not warrant losing the rest of + // the account's mail. + if (account.trash.isEmpty()) { + addProblem( + tr("Account '%1' has no trash folder configured; add a " + "'trash' key to its section. Delete will not work for " + "this account until it does.") + .arg(account.key)); + } + m_accounts.append(account); } -- cgit v1.2.3