[Dovecot] Virtual mailboxes
Virtual mailbox support can be tested with:
hg clone http://hg.dovecot.org/dovecot-virtualboxes/
The code is still pretty non-optimized and I've only done some small tests, but at least it appears to work. Messages can't yet saved to virtual mailboxes, but I was thinking that the first configured mailbox could be used as the save destination.
Configuration goes like:
mail_plugins = virtual namespace private { .. prefix = virtual/ location = virtual:~/virtual-boxes }
~/virtual-boxes then contains a filesystem-layout view of all virtual mailboxes. Virtual mailboxes are configured in "dovecot-virtual" files. For example for virtual/unseen you'd create ~/virtual-boxes/unseen/dovecot-virtual file:
INBOX Other mailbox unseen
So the format goes like: <mailbox name> [<more mailbox names>] <search rule> [<search rule continues>]
[<another mailbox name>]
[
Currently mailbox name wildcards aren't supported. The search rules are defined in exactly the same way as IMAP SEARCH command. So a few examples:
- all
- unseen
- or keyword $Label1 or keyword $Label2 $Label3
- from domain.org subject hello
Each time the mailbox is synchronized the mailbox search is ran for all the configured mailboxes. For simple rules this should be pretty fast, but for e.g. body searches it's a bad idea. I'll fix this in future so that it'll do searches only for newly seen messages.
Virtual mailboxes don't have dovecot.index.cache files. All mail accesses (except uid/flag/keyword) go through the real mailbox and its cache file is used/updated.
Messages that no longer match the search rule aren't removed until mailbox is either reopened or EXPUNGE command is sent. This allows creating a virtual mailbox with unseen messages, but without the message getting lost immediately after it's opened. Although perhaps it would be useful for a virtual mailbox with only non-deleted messages .. Maybe I should make it configurable separately for each vmailbox.
I guess that's all.
Timo Sirainen wrote:
Virtual mailbox support can be tested with:
Could an extension of this idea sort out the mismash of default names used by clients for standard folders, eg alias "Sent" <=> "Sent Items" so that at the server level we can set an option and two stupid clients with different defaults will "do the right thing"?
Ed W
On 3/14/2008, Ed W (lists@wildgooses.com) wrote:
Could an extension of this idea sort out the mismash of default names used by clients for standard folders, eg alias "Sent" <=> "Sent Items" so that at the server level we can set an option and two stupid clients with different defaults will "do the right thing"?
This would be very cool...
--
Best regards,
Charles
On Mar 14, 2008, at 7:43 PM, Ed W wrote:
Timo Sirainen wrote:
Virtual mailbox support can be tested with:
Could an extension of this idea sort out the mismash of default
names used by clients for standard folders, eg alias "Sent" <=>
"Sent Items" so that at the server level we can set an option and
two stupid clients with different defaults will "do the right thing"?
How about just creating a symlink?
Timo Sirainen wrote:
On Mar 14, 2008, at 7:43 PM, Ed W wrote:
Timo Sirainen wrote:
Virtual mailbox support can be tested with:
Could an extension of this idea sort out the mismash of default names used by clients for standard folders, eg alias "Sent" <=> "Sent Items" so that at the server level we can set an option and two stupid clients with different defaults will "do the right thing"?
How about just creating a symlink?
Yes perhaps that's the easiest way... Just integrate that creation process into whatever process creates the initial mailbox
Ed W
Hello Timo,
Friday, March 14, 2008, 11:21:47 AM, you wrote:
Virtual mailbox support can be tested with: hg clone http://hg.dovecot.org/dovecot-virtualboxes/
Thanks Timo, this is excellent news! I'd love to test it straight away but I can't really touch my mail server setup now -- will definitely do it some time in the future.
Speaking of which, this branch will not make it into 1.1, will it?
-- Best regards, Robert Tomanek mailto:dovecot@mail.robert.tomanek.org
On Sat, 2008-03-15 at 08:30 +0100, Robert Tomanek wrote:
Hello Timo,
Friday, March 14, 2008, 11:21:47 AM, you wrote:
Virtual mailbox support can be tested with: hg clone http://hg.dovecot.org/dovecot-virtualboxes/
Thanks Timo, this is excellent news! I'd love to test it straight away but I can't really touch my mail server setup now -- will definitely do it some time in the future.
Speaking of which, this branch will not make it into 1.1, will it?
I might make it an external plugin, but it can't go to v1.1 since it requires either modifying a lot of unrelated code or copy&pasting a lot of code.
But v1.2 with a lot of new features might not be far behind v1.1 release. :)
participants (5)
-
Charles Marcus
-
Ed W
-
Ed Wildgoose
-
Robert Tomanek
-
Timo Sirainen