Skip to content

Commit eda7bca

Browse files
sirainenfleischie
authored andcommitted
Convert trash plugin settings
1 parent dc96006 commit eda7bca

File tree

2 files changed

+37
-30
lines changed

2 files changed

+37
-30
lines changed

data/settings.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3406,25 +3406,27 @@ when it drops under the limit.`
34063406

34073407
/* trash plugin */
34083408

3409-
trash: {
3409+
trash_priority: {
34103410
plugin: 'trash',
3411-
values: setting_types.STRING,
3411+
values: setting_types.UINT,
34123412
text: `
3413-
A text file that configures the plugin's behavior. This setting is required
3414-
for the plugin to be active.
3415-
3416-
\`\`\`
3417-
trash = /etc/dovecot/dovecot-trash.conf.External
3418-
\`\`\`
3419-
3420-
The file uses the following format:
3413+
If non-zero, enables the trash plugin for the mailbox with the specified
3414+
priority. Mailboxes with smaller priority number are emptied before mailboxes
3415+
with a larger priority number. If there are multiple mailboxes with the same
3416+
priority, expunge the oldest mail from them first.
34213417
3422-
\`\`\`
3423-
<priority> <mailbox name>
3424-
\`\`\`
3418+
Example where Trash is emptied before Spam:
34253419
3426-
Deletion begins with the mailbox that has the lowest priority number and
3427-
proceeds from there.`
3420+
\`\`\`[dovecot.conf]
3421+
namespace inbox {
3422+
mailbox Trash {
3423+
trash_priority = 1
3424+
}
3425+
mailbox Spam {
3426+
trash_priority = 2
3427+
}
3428+
}
3429+
\`\`\``
34283430
},
34293431

34303432
/* virtual plugin */

docs/core/plugins/trash.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: trash
66
# Trash Plugin (`trash`)
77

88
Normally, a quota exceeded error is returned if saving/copying a message would
9-
bring the user over quota. With the trash plug-in, the oldest messages are
9+
bring the user over quota. With the trash plugin, the oldest messages are
1010
instead expunged from the specified mailboxes until the message can be
1111
saved.
1212

@@ -31,20 +31,25 @@ mail_plugins {
3131
trash = yes
3232
}
3333
34-
plugin {
35-
trash = /etc/dovecot/dovecot-trash.conf.ext
36-
}
37-
```
38-
39-
```[dovecot-trash.conf.ext]
40-
# Spam mailbox is emptied before Trash
41-
1 Spam
42-
# Trash mailbox is emptied before Sent
43-
2 Trash
44-
# If both Sent and "Sent Messages" mailboxes exist, the next oldest message
45-
# to be deleted is looked up from both of the mailboxes.
46-
3 Sent
47-
3 Sent Messages
34+
namespace inbox {
35+
# Spam mailbox is emptied before Trash
36+
mailbox Spam {
37+
priority = 1
38+
}
39+
40+
# Trash mailbox is emptied before Sent
41+
mailbox Trash {
42+
priority = 2
43+
}
44+
45+
# If both Sent and "Sent Messages" mailboxes exist, the next oldest message
46+
# to be deleted is looked up from both of the mailboxes.
47+
mailbox Sent {
48+
priority = 3
49+
}
50+
mailbox "Sent Messages" {
51+
priority = 3
52+
}
4853
```
4954
:::
5055

0 commit comments

Comments
 (0)