Skip to content

Commit 50a35b6

Browse files
committed
Changes mostly related to virtual and imapsieve parts
1 parent e8fed1e commit 50a35b6

File tree

3 files changed

+64
-15
lines changed

3 files changed

+64
-15
lines changed

docs/core/plugins/imap_sieve.md

Lines changed: 5 additions & 2 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,6 +108,9 @@ 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,imapsieve-filters,virtual mailbox plugin]].
113+
111114
## Example Configuration
112115

113116
```[dovecot.conf]]]

docs/core/plugins/virtual.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,33 @@ Then, you'll have to create a [[link,namespaces,namespace]] for the virtual
3232
mailboxes, for example:
3333

3434
```[dovecot.conf]
35-
namespace {
35+
namespace virtual {
3636
prefix = virtual/
3737
separator = /
3838
mail_driver = virtual
3939
mail_path = ~/Maildir/virtual
40+
41+
mailbox All {
42+
auto = no
43+
special_use = \All
44+
}
45+
[...]
4046
}
4147
```
4248

4349
After this you can create virtual mailboxes under `~/Maildir/virtual`. By
4450
default it uses the `fs` layout, so you can create directories such as:
4551

46-
* INBOX: `~/Maildir/virtual/INBOX/`
52+
* All: `~/Maildir/virtual/All/`
4753
* Sub/mailbox: `~/Maildir/virtual/Sub/mailbox/`
4854

4955
If you prefer to use the Maildir++ layout instead, set
5056
[[setting,mailbox_list_layout,maildir++]].
5157

5258
### Virtual Mailboxes
5359

54-
For each virtual directory you need to create a `dovecot-virtual` file. Its
55-
syntax is like:
60+
For each directory (virtual mailbox) you need to create a `dovecot-virtual` file.
61+
Its syntax is like:
5662

5763
```
5864
<1+ mailbox patterns>
@@ -71,14 +77,16 @@ aren't noticed.
7177
prefix. For example if you have namespaces with an empty prefix and a prefix
7278
`mail/`:
7379

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
80+
* `*` only matches mailboxes from the namespace with an empty prefix.
81+
* `mail*` matches mailboxes that begin with `mail` from the namespace with
82+
an empty prefix.
83+
* `mail/*` only matches mailboxes from the `mail/` namespace.
7884

79-
Beware that `*` will not match any mailbox which already has a more
85+
Beware that `*` will not match any mailbox that already has a more
8086
specialized match!
8187

88+
Currently, `*` doesn't match INBOX.
89+
8290
The mailbox names have special prefixes:
8391

8492
* `-`: Don't include this mailbox.
@@ -131,14 +139,22 @@ Virtual/All folder was configured with INBOX as the save destination, this
131139
Virtual/All folder:
132140

133141
```[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
142+
mailbox INBOX { # Virtual/All would NOT work
143+
sieve_script before-copy {
144+
type = before
145+
cause = copy
146+
path = /etc/dovecot/sieve.before
147+
}
148+
}
137149
```
138150

139-
Also, the `imap.mailbox` environment always contains INBOX, even when
151+
Also, the `imap.mailbox` Sieve `environment` variable always contains INBOX, even when
140152
saving via Virtual/All folder.
141153

154+
::: warning
155+
Currently, imapsieve scripts that are defined within a virtual mailbox are not being called.
156+
:::
157+
142158
## Mailbox Selection Based on METADATA
143159

144160
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)