feat(mailmover): add per-account folder priorities and auto-rename - #386
Open
fishman wants to merge 1 commit into
Open
feat(mailmover): add per-account folder priorities and auto-rename#386fishman wants to merge 1 commit into
fishman wants to merge 1 commit into
Conversation
Rule destinations can now resolve to priority folders per account; wildcard folder rules expand to managed folders only. `rename=auto` renames only mbsync files; same-folder moves are skipped.
Author
|
Ideally rename=auto should become default once proven, it took me a lot of mistakes and a few lost mails, before I noticed the setting. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes move mode work across accounts with different folder layouts: a new
folder_prioritiesoption resolves rule destinations per account (first existing candidate wins, globs supported). It also addsrename=auto, which renames only mbsync files(instead of manually specifying it), keeps wildcard folder rules limited to managed folders, skips no-op same-folder moves and stale index entries, and reopens the notmuch database between folders to avoid stale-revision errors.rename = true | false | autotruerenames every moved file (fresh UUID, flags kept).falsekeeps original names.autorenames only files that already carry an mbsync UID (,U=NNNin the name), so mixed mbsync/offlineimap setups keep UIDs only where needed.folder_priorities = tag:folder1,folder2,...;...Maps a tag to an ordered list of candidate folders. When a rule destination equals a priority key, it is resolved per account: the first existing candidate wins (
*candidates are globs), else the first candidate is used as fallback. This lets one rules block target[Gmail]/Spamfor gmail butSpamfor other accounts.Wildcard folder keys (
folders = gmail/* fishman/*)A key ending in
/*expands to the account's INBOX plus all resolved priority folders that exist on disk. Organizational subfolders are never expanded or moved from.