-
Notifications
You must be signed in to change notification settings - Fork 65
Changes mostly related to virtual and imapsieve parts #1289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
--- | ||
layout: doc | ||
title: virtual | ||
dovecotlinks: | ||
plugin_virtual_imapsieve: | ||
hash: imapsieve | ||
text: IMAPSieve script for virtual plugins | ||
--- | ||
|
||
# Virtual Mailbox Plugin (`virtual`) | ||
|
@@ -32,27 +36,33 @@ Then, you'll have to create a [[link,namespaces,namespace]] for the virtual | |
mailboxes, for example: | ||
|
||
```[dovecot.conf] | ||
namespace { | ||
namespace virtual { | ||
prefix = virtual/ | ||
separator = / | ||
mail_driver = virtual | ||
mail_path = ~/Maildir/virtual | ||
|
||
mailbox All { | ||
auto = no | ||
special_use = \All | ||
} | ||
[...] | ||
} | ||
``` | ||
|
||
After this you can create virtual mailboxes under `~/Maildir/virtual`. By | ||
default it uses the `fs` layout, so you can create directories such as: | ||
|
||
* INBOX: `~/Maildir/virtual/INBOX/` | ||
* All: `~/Maildir/virtual/All/` | ||
* Sub/mailbox: `~/Maildir/virtual/Sub/mailbox/` | ||
|
||
If you prefer to use the Maildir++ layout instead, set | ||
[[setting,mailbox_list_layout,maildir++]]. | ||
|
||
### Virtual Mailboxes | ||
|
||
For each virtual directory you need to create a `dovecot-virtual` file. Its | ||
syntax is like: | ||
For each directory (virtual mailbox) you need to create a `dovecot-virtual` file. | ||
Its syntax is like: | ||
|
||
``` | ||
<1+ mailbox patterns> | ||
|
@@ -71,14 +81,16 @@ aren't noticed. | |
prefix. For example if you have namespaces with an empty prefix and a prefix | ||
`mail/`: | ||
|
||
* `*` matches only mailboxes from the namespace with empty prefix | ||
* `mail*` matches mailboxes beginning with name `mail` from the namespace | ||
with empty prefix | ||
* `mail/*` matches only mailboxes from the `mail/` namespace | ||
* `*` only matches mailboxes from the namespace with an empty prefix. | ||
* `mail*` matches mailboxes that begin with `mail` from the namespace with | ||
an empty prefix. | ||
* `mail/*` only matches mailboxes from the `mail/` namespace. | ||
|
||
Beware that `*` will not match any mailbox which already has a more | ||
Beware that `*` will not match any mailbox that already has a more | ||
specialized match! | ||
|
||
Currently, `*` doesn't match INBOX. | ||
|
||
The mailbox names have special prefixes: | ||
|
||
* `-`: Don't include this mailbox. | ||
|
@@ -120,7 +132,7 @@ The `!-prefixed` virtual mailbox is also selected from; you don't need to | |
list it again without an ! or you'll get two copies of your messages in the | ||
virtual mailbox. | ||
|
||
## IMAPSieve Filters | ||
## IMAPSieve Filters {#imapsieve} | ||
|
||
[[added,imapsieve_filters]] | ||
|
||
|
@@ -131,14 +143,22 @@ Virtual/All folder was configured with INBOX as the save destination, this | |
Virtual/All folder: | ||
|
||
```[sieve.before] | ||
imapsieve_mailbox_name = INBOX # Virtual/All would NOT work | ||
imapsieve_mailbox_causes = COPY | ||
imapsieve_mailbox_before = /etc/dovecot/sieve.before | ||
mailbox INBOX { # Virtual/All would NOT work | ||
sieve_script before-copy { | ||
type = before | ||
cause = copy | ||
path = /etc/dovecot/sieve.before | ||
} | ||
} | ||
``` | ||
|
||
Also, the `imap.mailbox` environment always contains INBOX, even when | ||
Also, the `imap.mailbox` Sieve `environment` variable always contains INBOX, even when | ||
saving via Virtual/All folder. | ||
|
||
::: warning | ||
Currently, imapsieve scripts that are defined within a virtual mailbox are not being called. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
::: | ||
|
||
## Mailbox Selection Based on METADATA | ||
|
||
Instead of a mailbox name, you can specify a metadata filter: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -349,9 +349,39 @@ after it. For example: | |
```[dovecot.conf] | ||
@mysql = default | ||
mysql_host = mysql2.example.com # override the default mysql_host | ||
``` | ||
|
||
Within one group it's not possible to enumerate different kind of settings, like | ||
`prefix`, `separator`, and multiple `mailboxes`. For these cases, include the | ||
hierarchy one above, like `namespace`. For example: | ||
Comment on lines
+354
to
+356
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I definitely saw that Is my generalisation correct that mixing elements is not supported, or is it supported but some elements are excluded from this support? |
||
|
||
```[dovecot.conf] | ||
group @namespaces-virtual english { | ||
namespace virtual { | ||
prefix = virtual/ | ||
|
||
mail_driver = virtual | ||
mail_path = /var/lib/dovecot/virtual/en | ||
mail_index_path = %{home}/index/virtual/en | ||
|
||
mailbox All { | ||
auto = no | ||
special_use = \All | ||
} | ||
mailbox Flagged { | ||
auto = no | ||
special_use = \Flagged | ||
} | ||
} | ||
} | ||
Comment on lines
+359
to
+376
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
@namespaces-virtual = english | ||
``` | ||
|
||
::: warning | ||
Currently, indices are not created for namespaces that are defined within groups. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
::: | ||
|
||
It's possible to override groups using the command line parameter `-o` or | ||
userdb. For example above you can return `namespace/inbox/@mailboxes=finnish` | ||
from userdb to change mailbox names to Finnish language. Note that groups can't | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference