Discussion:
[Dovecot] Virtual mailboxes
Timo Sirainen
2008-03-14 10:21:47 UTC
Permalink
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>]
[<another mailbox's search rule>]

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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20080314/4c95d8fe/attachment.bin
Ed W
2008-03-14 17:43:42 UTC
Permalink
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
Charles Marcus
2008-03-14 18:13:45 UTC
Permalink
Post by Ed W
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
Timo Sirainen
2008-03-15 02:01:11 UTC
Permalink
Post by Ed W
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?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20080315/ae988454/attachment.bin
Ed Wildgoose
2008-03-15 12:06:52 UTC
Permalink
Post by Timo Sirainen
Post by Ed W
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

Robert Tomanek
2008-03-15 07:30:29 UTC
Permalink
Hello Timo,
Post by Timo Sirainen
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 at mail.robert.tomanek.org
Timo Sirainen
2008-03-15 07:38:26 UTC
Permalink
Post by Robert Tomanek
Hello Timo,
Post by Timo Sirainen
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. :)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20080315/559eb20f/attachment.bin
Loading...