From c3cfd28844c34aa7f7b390215f73d0b56534bdd0 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 26 Aug 2026 15:42:12 +0200 Subject: feat: propose business-sender candidates, always commented out --- src/businesssenders.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/businesssenders.h') diff --git a/src/businesssenders.h b/src/businesssenders.h index 0689453..3065ae5 100644 --- a/src/businesssenders.h +++ b/src/businesssenders.h @@ -18,6 +18,7 @@ #pragma once +#include #include #include #include @@ -55,4 +56,33 @@ bool contains(const List &list, const QString &address); /// QStandardPaths::GenericConfigLocation. QString defaultPath(); +/// True when a local part looks like bulk mail rather than a person. +/// +/// A GUESS, and openly one. It misses senders and proposes wrong ones, which +/// is exactly why nothing it produces takes effect until the user uncomments +/// it. +bool looksLikeBulk(const QString &address); + +/// Appends anything in `counts` that looks like bulk and is not already in the +/// file, COMMENTED OUT, with its message count. +/// +/// Two rules, both load-bearing. It never writes an uncommented entry, so +/// nothing on screen changes until the user acts. And it skips an address +/// already present in ANY form, commented or not, so an entry the user +/// rejected is never re-proposed, and one they deleted only returns if that +/// sender writes again. +void appendCandidates(const QString &path, const QHash &counts); + +/// The query the candidate scan should run. +/// +/// A week of mail once the file exists, so the step stays incremental and +/// cheap. EVERYTHING when the file is missing or holds no entries, because +/// that is the first run: a week's mail proposes almost nothing, and the file +/// would then take months to become useful. The whole-database scan is +/// affordable precisely because it happens once, measured at 76 ms over 5105 +/// messages. +/// +/// Returns notmuch query syntax, which is wire format and is never translated. +QString scanQuery(const QString &path); + } // namespace BusinessSenders -- cgit v1.2.3