11---
22layout : doc
33title : virtual
4+ dovecotlinks :
5+ plugin_virtual_imapsieve :
6+ hash : imapsieve
7+ text : IMAPSieve script for virtual plugins
48---
59
610# Virtual Mailbox Plugin (` virtual ` )
@@ -32,27 +36,33 @@ Then, you'll have to create a [[link,namespaces,namespace]] for the virtual
3236mailboxes, for example:
3337
3438``` [dovecot.conf]
35- namespace {
39+ namespace virtual {
3640 prefix = virtual/
3741 separator = /
3842 mail_driver = virtual
3943 mail_path = ~/Maildir/virtual
44+
45+ mailbox All {
46+ auto = no
47+ special_use = \All
48+ }
49+ [...]
4050}
4151```
4252
4353After this you can create virtual mailboxes under ` ~/Maildir/virtual ` . By
4454default it uses the ` fs ` layout, so you can create directories such as:
4555
46- * INBOX : ` ~/Maildir/virtual/INBOX / `
56+ * All : ` ~/Maildir/virtual/All / `
4757* Sub/mailbox: ` ~/Maildir/virtual/Sub/mailbox/ `
4858
4959If you prefer to use the Maildir++ layout instead, set
5060[[ setting,mailbox_list_layout,maildir++]] .
5161
5262### Virtual Mailboxes
5363
54- For each virtual directory you need to create a ` dovecot-virtual ` file. Its
55- syntax is like:
64+ For each directory ( virtual mailbox) you need to create a ` dovecot-virtual ` file.
65+ Its syntax is like:
5666
5767```
5868<1+ mailbox patterns>
@@ -71,14 +81,16 @@ aren't noticed.
7181prefix. For example if you have namespaces with an empty prefix and a prefix
7282` mail/ ` :
7383
74- * ` * ` matches only mailboxes from the namespace with empty prefix
75- * ` mail* ` matches mailboxes beginning with name ` mail ` from the namespace
76- with empty prefix
77- * ` mail/* ` matches only mailboxes from the ` mail/ ` namespace
84+ * ` * ` only matches mailboxes from the namespace with an empty prefix.
85+ * ` mail* ` matches mailboxes that begin with ` mail ` from the namespace with
86+ an empty prefix.
87+ * ` mail/* ` only matches mailboxes from the ` mail/ ` namespace.
7888
79- Beware that ` * ` will not match any mailbox which already has a more
89+ Beware that ` * ` will not match any mailbox that already has a more
8090specialized match!
8191
92+ Currently, ` * ` doesn't match INBOX.
93+
8294The mailbox names have special prefixes:
8395
8496* ` - ` : Don't include this mailbox.
@@ -120,7 +132,7 @@ The `!-prefixed` virtual mailbox is also selected from; you don't need to
120132list it again without an ! or you'll get two copies of your messages in the
121133virtual mailbox.
122134
123- ## IMAPSieve Filters
135+ ## IMAPSieve Filters {#imapsieve}
124136
125137[[ added,imapsieve_filters]]
126138
@@ -131,14 +143,22 @@ Virtual/All folder was configured with INBOX as the save destination, this
131143Virtual/All folder:
132144
133145``` [sieve.before]
134- imapsieve_mailbox_name = INBOX # Virtual/All would NOT work
135- imapsieve_mailbox_causes = COPY
136- imapsieve_mailbox_before = /etc/dovecot/sieve.before
146+ mailbox INBOX { # Virtual/All would NOT work
147+ sieve_script before-copy {
148+ type = before
149+ cause = copy
150+ path = /etc/dovecot/sieve.before
151+ }
152+ }
137153```
138154
139- Also, the ` imap.mailbox ` environment always contains INBOX, even when
155+ Also, the ` imap.mailbox ` Sieve ` environment ` variable always contains INBOX, even when
140156saving via Virtual/All folder.
141157
158+ ::: warning
159+ Currently, imapsieve scripts that are defined within a virtual mailbox are not being called.
160+ :::
161+
142162## Mailbox Selection Based on METADATA
143163
144164Instead of a mailbox name, you can specify a metadata filter:
0 commit comments