Skip to content

Commit e71e8c1

Browse files
authored
Merge branch 'main' into patch-1
2 parents 2a1132b + d0a35f0 commit e71e8c1

File tree

5 files changed

+238
-78
lines changed

5 files changed

+238
-78
lines changed

data/doveadm.js

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,147 @@ the source user name, e.g., \`user sourceuser\`.`
11281128
text: `Search mail with FTS plugin.`,
11291129
},
11301130

1131+
/* flatcurve FTS commands */
1132+
1133+
'fts flatcurve check': {
1134+
args: {
1135+
'mailbox-mask': {
1136+
example: [ 'INBOX' ],
1137+
positional: true,
1138+
type: doveadm_arg_types.ARRAY,
1139+
text: `A list of mailbox masks to check.`,
1140+
},
1141+
},
1142+
man: 'doveadm-fts',
1143+
plugin: 'fts-flatcurve',
1144+
flags: doveadm_flag_types.USER | doveadm_flag_types.USERFILE,
1145+
text: `
1146+
Run a simple check on Dovecot Xapian databases, and attempt to fix basic
1147+
errors (it is the same checking done by the xapian-check command with the
1148+
\`-F\` command-line option).`,
1149+
response: {
1150+
example: [
1151+
{
1152+
mailbox: "INBOX",
1153+
guid: "guid_string",
1154+
errors: 0,
1155+
shards: 1
1156+
}
1157+
],
1158+
text: `
1159+
For each mailbox that has FTS data, it outputs the following key/value fields:
1160+
1161+
| Key | Value |
1162+
| --- | ----- |
1163+
| mailbox | The human-readable mailbox name. (key is hidden) |
1164+
| guid | The GUID of the mailbox. |
1165+
| errors | The number of errors reported by the Xapian library. |
1166+
| shards | The number of index shards processed. |
1167+
`
1168+
},
1169+
},
1170+
1171+
'fts flatcurve remove': {
1172+
args: {
1173+
'mailbox-mask': {
1174+
example: [ 'INBOX' ],
1175+
positional: true,
1176+
type: doveadm_arg_types.ARRAY,
1177+
text: `A list of mailbox masks to remove.`,
1178+
},
1179+
},
1180+
man: 'doveadm-fts',
1181+
plugin: 'fts-flatcurve',
1182+
flags: doveadm_flag_types.USER | doveadm_flag_types.USERFILE,
1183+
text: `Removes all FTS data for a mailbox.`,
1184+
response: {
1185+
example: [
1186+
{
1187+
mailbox: "INBOX",
1188+
guid: "guid_string"
1189+
}
1190+
],
1191+
text: `
1192+
For each mailbox removed, it outputs the following key/value fields:
1193+
1194+
| Key | Value |
1195+
| --- | ----- |
1196+
| mailbox | The human-readable mailbox name. (key is hidden) |
1197+
| guid | The GUID of the mailbox. |
1198+
`
1199+
},
1200+
},
1201+
1202+
'fts flatcurve rotate': {
1203+
args: {
1204+
'mailbox-mask': {
1205+
example: [ 'INBOX' ],
1206+
positional: true,
1207+
type: doveadm_arg_types.ARRAY,
1208+
text: `A list of mailbox masks to rotate.`,
1209+
},
1210+
},
1211+
man: 'doveadm-fts',
1212+
plugin: 'fts-flatcurve',
1213+
flags: doveadm_flag_types.USER | doveadm_flag_types.USERFILE,
1214+
text: `Triggers an FTS index rotation for a mailbox.`,
1215+
response: {
1216+
example: [
1217+
{
1218+
mailbox: "INBOX",
1219+
guid: "guid_string"
1220+
}
1221+
],
1222+
text: `
1223+
For each mailbox rotated, it outputs the following key/value fields:
1224+
1225+
| Key | Value |
1226+
| --- | ----- |
1227+
| mailbox | The human-readable mailbox name. (key is hidden) |
1228+
| guid | The GUID of the mailbox. |
1229+
`
1230+
},
1231+
},
1232+
1233+
'fts flatcurve stats': {
1234+
args: {
1235+
'mailbox-mask': {
1236+
example: [ 'INBOX' ],
1237+
positional: true,
1238+
type: doveadm_arg_types.ARRAY,
1239+
text: `A list of mailbox masks to process.`,
1240+
},
1241+
},
1242+
man: 'doveadm-fts',
1243+
plugin: 'fts-flatcurve',
1244+
flags: doveadm_flag_types.USER | doveadm_flag_types.USERFILE,
1245+
text: `Returns FTS data for a mailbox.`,
1246+
response: {
1247+
example: [
1248+
{
1249+
mailbox: "INBOX",
1250+
guid: "guid_string",
1251+
last_uid: 123,
1252+
messages: 2,
1253+
shards: 1,
1254+
version: 1
1255+
}
1256+
],
1257+
text: `
1258+
For each mailbox that has FTS data, it outputs the following key/value fields:
1259+
1260+
| Key | Value |
1261+
| --- | ----- |
1262+
| mailbox | The human-readable mailbox name. (key is hidden) |
1263+
| guid | The GUID of the mailbox. |
1264+
| last_uid | The last UID indexed in the mailbox. |
1265+
| messages | The number of messages indexed in the mailbox. |
1266+
| shards | The number of index shards. |
1267+
| version | The (Dovecot internal) version of the FTS data. |
1268+
`
1269+
},
1270+
},
1271+
11311272
'import': {
11321273
args: {
11331274
'source-user': {

docs/core/man/doveadm-fts.1.md

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -64,70 +64,7 @@ index** will index all the missing mails (if any). Note that currently
6464
most FTS drivers do not implement this properly, but instead they
6565
delete all the FTS indexes. This may change in the future versions.
6666

67-
### fts check fast
68-
69-
**doveadm** [*GLOBAL OPTIONS*] fts check fast
70-
[**-u** *user* | **-A** | **-F** *file* | **\-\-no-userdb-lookup**]
71-
[**-S** *socket_path*]
72-
[**-\-refresh**]
73-
[**-\-print-mismatches-only**]
74-
[*namespace*]
75-
76-
This command exists only when the fts_dovecot plugin (Dovecot Pro FTS) is
77-
loaded.
78-
79-
This command can be used to check FTS indexes for consistency. It performs
80-
a fast check using only information in local caches (fts.S, metacache).
81-
82-
**-\-refresh**
83-
: Refresh any necessary local caches for the command to run successfully.
84-
This can be used if the command otherwise fails with exit code 68.
85-
86-
**-\-print-mismatches-only**
87-
: Print only mailboxes that have inconsistencies.
88-
89-
Exit codes:
90-
91-
**0**
92-
: The mailbox is fully consistent
93-
94-
**2**
95-
: The mailbox is not fully consistent
96-
97-
**68**
98-
: There is not enough information in local metacache to know whether the
99-
mailbox is fully consistent. Use either the **-\-refresh** parameter or
100-
the "full" check.
101-
102-
### fts check full
103-
104-
**doveadm** [*GLOBAL OPTIONS*] fts check full
105-
[**-u** *user* | **-A** | **-F** *file* | **\-\-no-userdb-lookup**]
106-
[**-S** *socket_path*]
107-
[**-\-print-details**]
108-
[**-\-print-mismatches-only**]
109-
[*namespace*]
110-
111-
This command exists only when the fts_dovecot plugin (Dovecot Pro FTS) is
112-
loaded.
113-
114-
This command can be used to check FTS indexes for consistency. It performs
115-
a full check to give detailed output of inconsistencies.
116-
117-
**-\-print-details**
118-
: Print also IMAP UID numbers and FTS triplet names for each email.
119-
120-
**-\-print-mismatches-only**
121-
: Print only mailboxes (or emails, with **-\-print-details**) that have
122-
inconsistencies.
123-
124-
Exit codes:
125-
126-
**0**
127-
: The mailbox is fully consistent
128-
129-
**2**
130-
: The mailbox is not fully consistent
67+
<!-- @include: @docs/core/man/include/doveadm-fts-includes.inc -->
13168

13269
<!-- @include: include/reporting-bugs.inc -->
13370

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
### fts flatcurve check
2+
3+
**doveadm** [*GLOBAL OPTIONS*] fts flatcurve check
4+
[**-u** *user* | **-A** | **-F** *file* | **\-\-no-userdb-lookup**]
5+
[**-S** *socket_path*]
6+
[*mailbox* ...]
7+
8+
Run a simple check on Dovecot Xapian databases, and attempt to fix basic
9+
errors (it is the same checking done by the xapian-check command with the
10+
`-F` command-line option).
11+
12+
*mailbox* is the list of mailboxes to process. It is possible to use
13+
wildcards (* and ?) in this value.
14+
15+
For each mailbox that has FTS data, it outputs the following key/value fields:
16+
17+
| Key | Value |
18+
| --- | ----- |
19+
| mailbox | The human-readable mailbox name. (key is hidden) |
20+
| guid | The GUID of the mailbox. |
21+
| errors | The number of errors reported by the Xapian library. |
22+
| shards | The number of index shards processed. |
23+
24+
### fts flatcurve remove
25+
26+
**doveadm** [*GLOBAL OPTIONS*] fts flatcurve remove
27+
[**-u** *user* | **-A** | **-F** *file* | **\-\-no-userdb-lookup**]
28+
[**-S** *socket_path*]
29+
[*mailbox* ...]
30+
31+
Removes all FTS data for a mailbox.
32+
33+
*mailbox* is the list of mailboxes to process. It is possible to use
34+
wildcards (* and ?) in this value.
35+
36+
For each mailbox removed, it outputs the following key/value fields:
37+
38+
| Key | Value |
39+
| --- | ----- |
40+
| mailbox | The human-readable mailbox name. (key is hidden) |
41+
| guid | The GUID of the mailbox. |
42+
43+
### fts flatcurve rotate
44+
45+
**doveadm** [*GLOBAL OPTIONS*] fts flatcurve rotate
46+
[**-u** *user* | **-A** | **-F** *file* | **\-\-no-userdb-lookup**]
47+
[**-S** *socket_path*]
48+
[*mailbox* ...]
49+
50+
Triggers an index rotation for a mailbox.
51+
52+
*mailbox* is the list of mailboxes to process. It is possible to use
53+
wildcards (* and ?) in this value.
54+
55+
For each mailbox rotated, it outputs the following key/value fields:
56+
57+
| Key | Value |
58+
| --- | ----- |
59+
| mailbox | The human-readable mailbox name. (key is hidden) |
60+
| guid | The GUID of the mailbox. |
61+
62+
### fts flatcurve stats
63+
64+
**doveadm** [*GLOBAL OPTIONS*] fts flatcurve stats
65+
[**-u** *user* | **-A** | **-F** *file* | **\-\-no-userdb-lookup**]
66+
[**-S** *socket_path*]
67+
[*mailbox* ...]
68+
69+
Returns FTS data for a mailbox.
70+
71+
*mailbox* is the list of mailboxes to process. It is possible to use
72+
wildcards (* and ?) in this value.
73+
74+
For each mailbox that has FTS data, it outputs the following key/value fields:
75+
76+
| Key | Value |
77+
| --- | ----- |
78+
| mailbox | The human-readable mailbox name. (key is hidden) |
79+
| guid | The GUID of the mailbox. |
80+
| last_uid | The last UID indexed in the mailbox. |
81+
| messages | The number of messages indexed in the mailbox. |
82+
| shards | The number of index shards. |
83+
| version | The (Dovecot internal) version of the FTS data. |

docs/core/plugins/lazy_expunge.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ dovecotlinks:
1212
The lazy expunge plugin provides a "second-chance" to recover messages that
1313
would otherwise be deleted from a mailbox by user action.
1414

15-
It does this by moving the message to a defined location (either a mailbox, or
16-
a namespace -- see below for further details) when a user deletes the message
17-
from a mailbox.
15+
It does this by moving the message to a defined location when a user deletes
16+
the message from a mailbox.
1817

1918
This behavior is useful for a variety of reasons:
2019

@@ -33,21 +32,19 @@ should be used to prune the mailbox to control storage usage.
3332

3433
## Configuration
3534

36-
### Storage Locations
37-
38-
#### Mailbox
35+
### Storage Location
3936

4037
Messages that are expunged are moved to a single mailbox.
4138

42-
This is the simplest configuration. The mailbox is created automatically.
39+
The mailbox is created automatically.
4340

4441
You probably also want to hide it with an [[link,acl]] from the user, if
4542
recovery is only expected to be an action performed by an admin/operator.
4643

4744
To move to a mailbox, do NOT add a trailing delimiter to the
4845
[[setting,lazy_expunge_mailbox]] setting.
4946

50-
##### Example Configuration
47+
#### Example Configuration
5148

5249
::: code-group
5350

@@ -130,15 +127,13 @@ See [[plugin,quota]].
130127

131128
Doveadm can be used to manually clean expunge storage.
132129

133-
Example to delete all messages in `.EXPUNGED` namespace older than one day:
130+
Example to delete all messages in `.EXPUNGED` mailbox older than one day:
134131

135132
```sh
136-
doveadm expunge mailbox '.EXPUNGED/*' savedsince 1d
133+
doveadm expunge mailbox '.EXPUNGED' savedsince 1d
137134
```
138135

139136
### Autoexpunge
140137

141-
Set autoexpunge configuration for expunge storage to automatically clean
138+
Set [[setting,mailbox_autoexpunge]] configuration to automatically clean
142139
old messages.
143-
144-
See [[link,namespaces]].

util/generate_man.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,14 @@ const debug = program.opts().debug
4444
const doInclude = (content, includes, f) => {
4545
const result = content.replace(includesRE, (m, m1) => {
4646
if (!m1.length) return m
47+
/* VitePress MD supports paths relative to base with leading
48+
* '@'. */
49+
if (m1.startsWith('@'))
50+
return doInclude(fs.readFileSync(process.cwd() + '/' + m1.slice(1), 'utf8'), includes, f)
4751
const inc_f = path.basename(m1)
4852
for (const fn of includes) {
4953
if (path.basename(fn) == inc_f)
50-
return doInclude(fs.readFileSync(fn, 'utf8'), includes, f)
54+
return doInclude(fs.readFileSync(fn, 'utf8'), includes, f)
5155
}
5256
throw new Error("Missing include " + inc_f)
5357
})

0 commit comments

Comments
 (0)