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!

  • 2
    For a nice clean implementation of such a system, I think you are in "write your own plugin" territory. Unfortunately, after having written several custom Dovecot plugins, I can affirm that it's not that straightforward. However, your whole scheme seems like the germ of a good idea that can be expanded into a piece of software that many people would be interested in, so +1.
    – Celada
    Jul 29, 2014 at 6:41
  • There is antispam plugin that is very close to what you want. wiki2.dovecot.org/Plugins/Antispam But anyway sieve is the deliver's plugin so you can't re-run sieve when message is moved via IMAP.
    – Kondybas
    Aug 6, 2014 at 0:06

1 Answer 1


Using Saved Search folders in Thunderbird you can create "virtual" mailboxes that automatically search for messages matching their criteria/tags in all your Mozilla Thunderbird folders. While the messages remain in the folders they have been filed to, they also show up in all Saved Search folders that find them.

Select File >> New >> Saved Search... from the menu.

So you can modify a tag an automatically the email will pop-up in all the Saved Search Folders that are looking for this Tag. On the server or in your IMAP Folder all emails stay in the folders they have been filed to.

Right click on the email in the email list >> Tag >> Manage Tags makes more fun then deleting it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .