Comments (8)
BTW, there is a simpler way to handle the folder tags, but less flexible.
define a set of folder tags: { sent inbox spam trash}
then for each folder select which tag should be set
Sent Items = sent
Inbox = inbox
Junk Email = spam
Deleted Items = trash
But this lacks flexibility,
from afew.
No comments? The above FTS is implemented and currently under test (with my own mail), but if there is no interest then I will not pester the group with a PR.
from afew.
this approach is exactly what i am missing in afew right now. i am not using afew because it assumes it runs on a single workstation, while I have multiple. therefore i use state in the maildir as the reference to create tags in notmuch. for example, files moved to the "ham" folder get their "spam" tag removed and vice-versa. it's super tricky to implement, because you can get into a bouncing contest between the two workstations, for example.
i also use the F
flag on messages to represent the inbox
tag, which is also particularly tricky to implement.
this idea would possibly help me adopt afew.
from afew.
@anarcat , my deployment config is multi-client, multi-account. I'm using a cloud-based server to pull imap and gmail accounts with mbsync and lieer respectively. 3 different workstations then sync to server with muchsync. My intent is to run afew only on server as well, then muchsync will replicate its tagging on the workstations.
In what I have seen so far, I have 2 cases in which the bouncing does not converge to a single state.
- a message is stored in multiple maildirs. I resolve this by simply refusing to FolderTag such messages. Just find and remove such duplicates. IMHO, seems contrary to the entire intent of notmuch, but would welcome enlightenment on usecase.
- a FolderTag tag is ambiguous due to overloaded use. For example, the default inbox filter removes new (as it must), but also applies the
inbox
tag. That could be a problem if the new msg does not happen to reside in ainbox
folder. Similarly with the spam and sent mail filters (I renamed the filter'ssent
tofrom-me
tag to reservesent
as a FolderTag.
My current implementation requires the FolderTags to be added and removed atomically. E.g. moving a message from o365's inbox to deleted items requires +trash and -inbox. I thought that would be easy to handle from alot. But turns out that currently alot handles adds and removes as separate commands and the selected message can change between commands. Still trying to decide if the right answer is to add atomic add/remove to alot, or add configurable radio Tag Groups (like UI radio buttons) to notmuch (adding a tag from a configured group automagically removes all other group tags).
from afew.
- a message is stored in multiple maildirs. I resolve this by simply refusing to FolderTag such messages. Just find and remove such duplicates. IMHO, seems contrary to the entire intent of notmuch, but would welcome enlightenment on usecase.
how do you actually deduplicate those? checksum? message-id? typically this happens on mailing lists where you receive a copy of your message...
from afew.
I just leveraged afew itself. Since notmuch tagging is applied at the message level, the de duplication needs to be to the notmuch message. I believe this is message-id and is definitely not a checksum. Fortunately, notmuch itself can find the duplicates for us.
I just temporarily used the message file iteration in my FolderTagSync implementation (similar to the one already in MailMover). When multiple files are found for a single message, the modified handler selected one to keep and moved the overs to a temp directory outside of the maildir. After de-duping the messages, I removed the temporary code.
Not really sure how I got my dupes. They were not from mailing lists (at least not the sample I looked at).
from afew.
Fwiw, I use a similar setup with folder/tag replication. In my case, I don't mind about duplicates (they are transparent with notmuch and disk space is not expensive) but I do mind about listing my >100 folders. I operate with a requirement to have identical names for folders and corresponding tags, i.e., messages in folder Folder/Subfolder will be tagged "+Folder/Subfolder -inbox". Then I use a pre-new script which moves files around before syncronizing. I'm still testing this setup: while it is true that it has worked very well for almost a year now, it is also true that I have some corner cases that need polishing.
I'll look into your solution (thanks for contributing!), but folder listing is a no-go.
from afew.
I did not remove the duplicates to save some disk space. Its that messages are tagged, not files. So its easier to prevent message bouncing between folders if the tags uniquely identify a folder and vice-versa. i.e. a 1-1 map.
However, I am reconsidering the above scheme. Its implemented and seems to be working well, but adding a folder is too fault prone. (In other words, I f'ed up adding a new folder myself. that's generally a bad sign :)
)
The major requirements I have is to support multiple accounts, each with a set of primary folders (inbox, trash, spam, sent). within inbox, I have topical folders. When I remove the inbox tag (without adding trash, spam) I want the topical tag to remain. That way I can (in a limited way) tag archived email from my phone by moving the email to a topical folder and then archiving it.
from afew.
Related Issues (20)
- Filter mails from addresses in a list contained in a file? HOT 3
- Handling multiple matches in HeaderMatchingFilter HOT 3
- Maintaining a folder/tag parity HOT 3
- MailMover configuration accepts a regex folder, but fails silently HOT 4
- kill filter could be optimized HOT 5
- Error run afew -tn HOT 1
- M$ Office365 spam filter HOT 1
- Multi-account MailMover HOT 3
- `python setup.py build_sphinx` is removed in the Sphinx 7 HOT 1
- Feature request: Remove all tags matching regex "list/.*" only when the tag "spam" is present
- Tagging by plus addressing
- error: unrecognized arguments: --learn HOT 1
- How about tagging a new release HOT 11
- Fix for installing on MacOS HOT 1
- CI pipeline only tests Python version 3.8 HOT 5
- Issue on python-3.12 with configparser removed from python HOT 4
- ListMailsFilter uses only the list-label HOT 1
- Handling of split database/maildir configuration introduced in notmuch 0.32 (in 2021) HOT 3
- Instructions on how to install `afew` with Python3.12(.3) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from afew.