aboutsummaryrefslogtreecommitdiffstats
path: root/assets/hooks
AgeCommit message (Collapse)AuthorFilesLines
4 hourschore(hooks): log how many messages the sent carve-out matchedDanilo M.1-1/+26
Item 164 diagnostics. A `notmuch tag` that matches nothing succeeds, so the carve-out logged "applied over N folder(s)" whether it stripped `inbox` from four messages or from none. A draft kept `inbox` on a pass whose log claimed the carve-out had run, and that line could not tell the two cases apart. Count before tagging, since the tag is what makes the count zero, and report it alongside the folder count. Nothing branches on the value: a failed count yields `?` rather than failing the sync, because the tag reports its own status separately. This does not fix item 164, whose trigger is still unreproduced. It makes the next occurrence self-explaining: `0 message(s)` means the message was never in tag:new scope, and a non-zero count means the tag ran over it and something re-added the tag afterwards. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UUQS6n3cmsFrsjCNmwNtf8
43 hoursfeat(hooks): own the notmuch hooks, and keep sent mail out of the inboxDanilo M.6-0/+1380
The post-new hook and its rule store move here from the companion mailctl project, which is being retired. Nothing else was shared between the two, so this is a plain move: mailrules.py is stdlib-only and post-new imports only it. With that in hand, the hook learns the one thing it could not know before. notmuch's new.tags applies `inbox` to every file it indexes, and it cannot tell an arrival from the copy this application files into a sent folder after a send, so sent mail turned up in the inbox view and in any hand-typed tag:inbox search. Drafts arrived the same way, through the composer's autosave. 786 messages were affected on the developer's own index. qtmaildirconf.py reads the sent and drafts folders out of qtmaildir.conf, so adding an account fixes itself. Reading the application's own config is not the cross-repo coupling it would have been last week: this repo owns the hook now. Three properties are load-bearing: - it is NOT a relaxation of PROTECTED_REMOVALS, which is about a rule removing `inbox` from mail whose provenance the hook cannot judge. Here the provenance is the file's own path, and `inbox` was never true of it. - only `inbox`. maildir.synchronize_flags is true, so removing `unread` would rewrite Maildir filenames and reach the server on the next mbsync. - an empty folder list means NOTHING, never an empty query, which notmuch reads as "match everything". A system with no qtmaildir config must be left alone rather than have every new message stripped. Trash is deliberately not in the list: Delete leaves `inbox` on a trashed message so Restore can put it back where it came from. The three Python suites run under ctest rather than beside it as scripts someone remembers to run, since this code tags real mail unattended on every sync. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q2koFevoSxTLhfexJTZWQd