In my dovecot setup I use virtual folders (not to be confused with virtual users). My goal is to get something like seen in googlemail. I want a folder containing all my messages and also I want to have specific folders for specific mails to sort them properly. Basicly this is what virtual folders do. And that works. But I do not want to rely 100% on my filters. I want to be able to replicate or delete mails in the special folders on my own while not touching the ones in other folders.
My idea is to use imap flags for this purpose. I can use sieve to classify my mails and set the proper flags. My virtual folder configuration would be testing on these flags and everything would be fine.
Exept: I think it is rather inconvinient to add or remove imap flags by hand to move an email from one virtual folder to another. (Actually from within thunderbird I was not able to do it at all.) I would like to be able to:
- move a mail from anywhere to e.g. /Work resulting in the mail getting the /Work flag,
- delete a mail in /All resulting in the mail actually being deleted (or marked as),
- delete a mail anywhere else resulting in the mail loosing the approriate flag.
My hope is I can somehow trigger a re-run of sieve with some custom variables, containing the action, set beforehand.
I looked into dovecot plugins but the best match I could find was the notify plugin, which is some kind of framework and not usable on its own. I even consider writing my own plugin, listening to these events wich the notify framework plugin thing. And when I get an event, I maybe could set some variables and then call sieve to rescan this specific email, and put all the logic in the sieve script utilizing the variables.
What do you think about the idea? Has anyone done somethin like that before? Can it be done much simpler? Is there maybe already a plugin out there, that can do what I need? Or would anybody be interested in a plugin with the described functionalities?
Thank you in advance for any kind of advice!