1
1
---
2
2
layout : doc
3
3
title : virtual
4
+ dovecotlinks :
5
+ plugin_virtual_imapsieve :
6
+ hash : imapsieve
7
+ text : IMAPSieve script for virtual plugins
4
8
---
5
9
6
10
# Virtual Mailbox Plugin (` virtual ` )
@@ -32,27 +36,33 @@ Then, you'll have to create a [[link,namespaces,namespace]] for the virtual
32
36
mailboxes, for example:
33
37
34
38
``` [dovecot.conf]
35
- namespace {
39
+ namespace virtual {
36
40
prefix = virtual/
37
41
separator = /
38
42
mail_driver = virtual
39
43
mail_path = ~/Maildir/virtual
44
+
45
+ mailbox All {
46
+ auto = no
47
+ special_use = \All
48
+ }
49
+ [...]
40
50
}
41
51
```
42
52
43
53
After this you can create virtual mailboxes under ` ~/Maildir/virtual ` . By
44
54
default it uses the ` fs ` layout, so you can create directories such as:
45
55
46
- * INBOX : ` ~/Maildir/virtual/INBOX / `
56
+ * All : ` ~/Maildir/virtual/All / `
47
57
* Sub/mailbox: ` ~/Maildir/virtual/Sub/mailbox/ `
48
58
49
59
If you prefer to use the Maildir++ layout instead, set
50
60
[[ setting,mailbox_list_layout,maildir++]] .
51
61
52
62
### Virtual Mailboxes
53
63
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:
56
66
57
67
```
58
68
<1+ mailbox patterns>
@@ -71,14 +81,16 @@ aren't noticed.
71
81
prefix. For example if you have namespaces with an empty prefix and a prefix
72
82
` mail/ ` :
73
83
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.
78
88
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
80
90
specialized match!
81
91
92
+ Currently, ` * ` doesn't match INBOX.
93
+
82
94
The mailbox names have special prefixes:
83
95
84
96
* ` - ` : Don't include this mailbox.
@@ -120,7 +132,7 @@ The `!-prefixed` virtual mailbox is also selected from; you don't need to
120
132
list it again without an ! or you'll get two copies of your messages in the
121
133
virtual mailbox.
122
134
123
- ## IMAPSieve Filters
135
+ ## IMAPSieve Filters {#imapsieve}
124
136
125
137
[[ added,imapsieve_filters]]
126
138
@@ -131,14 +143,22 @@ Virtual/All folder was configured with INBOX as the save destination, this
131
143
Virtual/All folder:
132
144
133
145
``` [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
+ }
137
153
```
138
154
139
- Also, the ` imap.mailbox ` environment always contains INBOX, even when
155
+ Also, the ` imap.mailbox ` Sieve ` environment ` variable always contains INBOX, even when
140
156
saving via Virtual/All folder.
141
157
158
+ ::: warning
159
+ Currently, imapsieve scripts that are defined within a virtual mailbox are not being called.
160
+ :::
161
+
142
162
## Mailbox Selection Based on METADATA
143
163
144
164
Instead of a mailbox name, you can specify a metadata filter:
0 commit comments