MailMover: Handle messages that have multiple copies #67
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.
I've modified MailMover.move to deal with a couple of issues I had getting it to work with my Gmail-via-IMAP setup:
The first two issues are bugs I ran into as I tried to get MailMover to work with my mail setup, which contains multiple copies of most messages.
The third change is a side-effect of how I solved the first two issues. My version changes the way messages are moved. Multiple rules now can now be applied to a message in a given source maildir; each rule will copy the messge to a destination maildir, and then the original will be deleted when all copies have been made, i.e., after all rules have been applied. (I have also changed the documentation to reflect this.) For my setup, this is the behavior I want, but I don't know if it's how MailMover.move should work in general. Maybe the right thing to do instead would be to implement this behavior in a subclass? If so, this will require solving the first two issues in a different way.
P.S. This is my first GitHub pull request, so please let me know if I've done it wrong or you need more information!