Skip to content

Commit 920b496

Browse files
committed
Changes mostly related to virtual and imapsieve parts
1 parent a72c477 commit 920b496

File tree

3 files changed

+70
-17
lines changed

3 files changed

+70
-17
lines changed

docs/core/plugins/imap_sieve.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ which requires no additional configuration.
6868

6969
Script storages for administrator scripts are defined in
7070
[[setting,sieve_script]] blocks with [[setting,sieve_script_type]]
71-
[[link,sieve_storage_type_before,before]] or
71+
[[link,sieve_storage_type_before,before]] or
7272
[[link,sieve_storage_type_after,after]]. These execute administrator scripts
7373
before or after the user's personal script, respectively. The
7474
[[setting,sieve_script_cause]] setting for the administrator storages used by
@@ -81,7 +81,7 @@ The applicability of administrator scripts can be limited to a destination
8181
mailbox by placing the corresponding [[setting,sieve_script]] blocks inside
8282
a [[setting,mailbox]] block for that mailbox. For a source mailbox, limiting the
8383
applicability of administrator scripts can similarly be achieved by placing the
84-
corresponding [[setting,sieve_script]] blocks inside a
84+
corresponding [[setting,sieve_script]] blocks inside an
8585
[[setting,imapsieve_from]] block with that mailbox name. The [[setting,mailbox]]
8686
and [[setting,imapsieve_from]] blocks can be nested when both are required.
8787

@@ -108,9 +108,12 @@ This plugin registers the `imapsieve` extension with the Sieve
108108
interpreter. This extension is enabled implicitly, which means that it
109109
does not need to be added to the [[setting,sieve_extensions]] setting.
110110

111+
Additional information about using the plugin with virtual mailboxes can be
112+
found at [[link,plugin_virtual_imapsieve,virtual mailbox plugin]].
113+
111114
## Example Configuration
112115

113-
```[dovecot.conf]]]
116+
```[dovecot.conf]
114117
imapsieve_from Spam {
115118
sieve_script ham {
116119
type = before

docs/core/plugins/virtual.md

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
---
22
layout: doc
33
title: 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
3236
mailboxes, 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

4353
After this you can create virtual mailboxes under `~/Maildir/virtual`. By
4454
default 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

4959
If 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.
7181
prefix. 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
8090
specialized match!
8191

92+
Currently, `*` doesn't match INBOX.
93+
8294
The 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
120132
list it again without an ! or you'll get two copies of your messages in the
121133
virtual 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
131143
Virtual/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
140156
saving 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

144164
Instead of a mailbox name, you can specify a metadata filter:

docs/core/settings/syntax.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,39 @@ after it. For example:
349349
```[dovecot.conf]
350350
@mysql = default
351351
mysql_host = mysql2.example.com # override the default mysql_host
352+
```
353+
354+
Within one group it's not possible to enumerate different kind of settings, like
355+
`prefix`, `separator`, and multiple `mailboxes`. For these cases, include the
356+
hierarchy one above, like `namespace`. For example:
357+
358+
```[dovecot.conf]
359+
group @namespaces-virtual english {
360+
namespace virtual {
361+
prefix = virtual/
362+
363+
mail_driver = virtual
364+
mail_path = /var/lib/dovecot/virtual/en
365+
mail_index_path = %{home}/index/virtual/en
366+
367+
mailbox All {
368+
auto = no
369+
special_use = \All
370+
}
371+
mailbox Flagged {
372+
auto = no
373+
special_use = \Flagged
374+
}
375+
}
376+
}
352377
378+
@namespaces-virtual = english
353379
```
354380

381+
::: warning
382+
Currently, indices are not created for namespaces that are defined within groups.
383+
:::
384+
355385
It's possible to override groups using the command line parameter `-o` or
356386
userdb. For example above you can return `namespace/inbox/@mailboxes=finnish`
357387
from userdb to change mailbox names to Finnish language. Note that groups can't

0 commit comments

Comments
 (0)