afewmail / afew

an initial tagging script for notmuch mail
ISC License
325 stars 98 forks source link

MailMover configuration accepts a regex folder, but fails silently #314

Open naegling opened 3 years ago

naegling commented 3 years ago

While considering changes to MailMover to address, I realized the mailmover configuration seemed overly complex for its task. Why not just a list of pairs (query, target_folder)? All mail that satisfy the query that are not already in target_folder are moved. Also yields a natural way to handle cloning vs moving. (i.e. multiple copies vs 1st move only).

Anyone have any thoughts? Of course, if implemented, I'll send a PR.

GuillaumeSeren commented 3 years ago

Hello @naegling , sorry to reply late and welcome to the project.

The code for the MailMover is far form ideal and patches are welcome (with tests as much as possible).

Regarding you issue, please link the documentation that would be wrong, what version, configurations etc.

naegling commented 2 years ago

Thanks @GuillaumeSeren . Where is the best place to discuss what I have in mind? here or irc? I know what I want, but would prefer an implementation others could use as well. I can post an RFC analogue.

GuillaumeSeren commented 2 years ago

Hey @naegling , the best place is here as everyone can read and participate.

Please explain a more precise case on the issue, we'll try to work a fix if needed.

naegling commented 2 years ago

Original post covered 2 topics. I will continue here with the bug report and open a new topic for the proposed enhancement.

MailMover accepts a folder list containing a regex. The regex even almost works. matching messages are queried in MailMover.py:64, but then all matching messages are silently discarded by MailMover.py:69. Three fix suggestions:

  1. update docs to say 'don't do that'
  2. update settings.py to prohibit 'did that'
  3. update MailMover.py to enable 'doing that'

Although I initiated this report, I am no longer impacted by it. Instead, I am implementing a FolderTagSync feature to maintain a simple 1-1 correspondence between tags and MailDir folders (for those of us saddled with o365). I will open a enhancement post for discussion leading to a PR if desired by the community,