Skip to content

Commit 10fa137

Browse files
committed
WIP: fill out doveadm fields
1 parent 8bb1bcd commit 10fa137

File tree

3 files changed

+87
-11
lines changed

3 files changed

+87
-11
lines changed

data/doveadm.js

Lines changed: 74 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* List of Dovecot doveadm types. */
22
import { doveadm_arg_types,
3+
doveadm_args_human_timestamp,
34
doveadm_args_query,
45
doveadm_args_usermask,
56
doveadm_flag_types,
@@ -93,16 +94,19 @@ Applicable to [[link,mdbox]] and [[link,sdbox]] mailbox formats only.
9394
'acl add': {
9495
args: {
9596
mailbox: {
97+
example: 'INBOX',
9698
positional: true,
9799
type: doveadm_arg_types.STRING,
98100
text: `Mailbox to add to.`,
99101
},
100102
id: {
103+
example: 'acl_id',
101104
positional: true,
102105
type: doveadm_arg_types.STRING,
103106
text: `ID to add to.`,
104107
},
105108
right: {
109+
example: ['r', 'w'],
106110
positional: true,
107111
type: doveadm_arg_types.ARRAY,
108112
text: `ACL rights to add.`,
@@ -117,6 +121,7 @@ Applicable to [[link,mdbox]] and [[link,sdbox]] mailbox formats only.
117121
'acl debug': {
118122
args: {
119123
mailbox: {
124+
example: 'INBOX',
120125
positional: true,
121126
type: doveadm_arg_types.STRING,
122127
text: `Mailbox to query.`,
@@ -131,11 +136,13 @@ Applicable to [[link,mdbox]] and [[link,sdbox]] mailbox formats only.
131136
'acl delete': {
132137
args: {
133138
mailbox: {
139+
example: 'INBOX',
134140
positional: true,
135141
type: doveadm_arg_types.STRING,
136142
text: `Mailbox to delete.`,
137143
},
138144
id: {
145+
example: 'acl_id',
139146
positional: true,
140147
type: doveadm_arg_types.STRING,
141148
text: `ID to delete.`,
@@ -154,6 +161,7 @@ Applicable to [[link,mdbox]] and [[link,sdbox]] mailbox formats only.
154161
type: doveadm_arg_types.BOOL,
155162
},
156163
mailbox: {
164+
example: 'INBOX',
157165
positional: true,
158166
type: doveadm_arg_types.STRING,
159167
text: `Mailbox to query.`,
@@ -176,6 +184,7 @@ Applicable to [[link,mdbox]] and [[link,sdbox]] mailbox formats only.
176184
'acl remove': {
177185
args: {
178186
mailbox: {
187+
example: 'INBOX',
179188
positional: true,
180189
type: doveadm_arg_types.STRING,
181190
text: `Mailbox to remove rights from.`,
@@ -200,6 +209,7 @@ Applicable to [[link,mdbox]] and [[link,sdbox]] mailbox formats only.
200209
'acl rights': {
201210
args: {
202211
mailbox: {
212+
example: 'INBOX',
203213
positional: true,
204214
type: doveadm_arg_types.STRING,
205215
text: `Mailbox to show.`,
@@ -214,16 +224,19 @@ Applicable to [[link,mdbox]] and [[link,sdbox]] mailbox formats only.
214224
'acl set': {
215225
args: {
216226
mailbox: {
227+
example: 'INBOX',
217228
positional: true,
218229
type: doveadm_arg_types.STRING,
219230
text: `Mailbox to replace rights.`,
220231
},
221232
id: {
233+
example: 'acl_id',
222234
positional: true,
223235
type: doveadm_arg_types.STRING,
224236
text: `ID to replace.`,
225237
},
226238
right: {
239+
example: ['r', 'w'],
227240
positional: true,
228241
type: doveadm_arg_types.ARRAY,
229242
text: `ACL rights to replace.`,
@@ -238,14 +251,14 @@ Applicable to [[link,mdbox]] and [[link,sdbox]] mailbox formats only.
238251
'auth cache flush': {
239252
args: {
240253
'socket-path': {
241-
//example: `/var/run/dovecot/doveadm-server`,
242254
cli: 'a',
243255
cli_only: true,
256+
example: `/var/run/dovecot/doveadm-server`,
244257
type: doveadm_arg_types.STRING,
245258
text: `Path to doveadm socket.`,
246259
},
247260
user: {
248-
//example: `foo`,
261+
example: `username`,
249262
positional: true,
250263
type: doveadm_arg_types.ARRAY,
251264
text: `UID of user to apply operation to.`,
@@ -266,15 +279,18 @@ Applicable to [[link,mdbox]] and [[link,sdbox]] mailbox formats only.
266279
'auth-login-socket-path': {
267280
cli: 'a',
268281
cli_only: true,
282+
example: `/var/run/dovecot/auth-login`,
269283
type: doveadm_arg_types.STRING,
270284
},
271285
'auth-master-socket-path': {
272286
cli: 'm',
273287
cli_only: true,
288+
example: `/var/run/dovecot/auth-master`,
274289
type: doveadm_arg_types.STRING,
275290
},
276291
'sasl-mech': {
277-
cli: 'm',
292+
cli: 'A',
293+
example: 'PLAIN',
278294
type: doveadm_arg_types.STRING,
279295
},
280296
'auth-info': {
@@ -284,17 +300,18 @@ Applicable to [[link,mdbox]] and [[link,sdbox]] mailbox formats only.
284300
},
285301
'master-user': {
286302
cli: 'M',
303+
example: 'masteruser',
287304
type: doveadm_arg_types.STRING,
288305
text: `Master user.`,
289306
},
290307
user: {
291-
//example: `foo`,
308+
example: `username`,
292309
positional: true,
293310
type: doveadm_arg_types.STRING,
294311
text: `Login UID.`,
295312
},
296313
password: {
297-
//example: `bar`,
314+
example: `password`,
298315
positional: true,
299316
optional: true,
300317
type: doveadm_arg_types.STRING,
@@ -308,9 +325,9 @@ Applicable to [[link,mdbox]] and [[link,sdbox]] mailbox formats only.
308325
'auth lookup': {
309326
args: {
310327
'socket-path': {
311-
//example: `/var/run/dovecot/doveadm-server`,
312328
cli: 'a',
313329
cli_only: true,
330+
example: `/var/run/dovecot/doveadm-server`,
314331
type: doveadm_arg_types.STRING,
315332
text: `Path to doveadm socket.`,
316333
},
@@ -321,11 +338,12 @@ Applicable to [[link,mdbox]] and [[link,sdbox]] mailbox formats only.
321338
},
322339
field: {
323340
cli: 'f',
341+
example: 'fieldname',
324342
type: doveadm_arg_types.STRING,
325343
text: `Only return value of this field.`,
326344
},
327345
user: {
328-
//example: `foo`,
346+
example: `username`,
329347
positional: true,
330348
type: doveadm_arg_types.ARRAY,
331349
text: `UID of user to query.`,
@@ -338,14 +356,15 @@ Applicable to [[link,mdbox]] and [[link,sdbox]] mailbox formats only.
338356
'auth test': {
339357
args: {
340358
'socket-path': {
341-
//example: `/var/run/dovecot/doveadm-server`,
342359
cli: 'a',
343360
cli_only: true,
361+
example: `/var/run/dovecot/doveadm-server`,
344362
type: doveadm_arg_types.STRING,
345363
text: `Path to doveadm socket.`,
346364
},
347365
'sasl-mech': {
348366
cli: 'A',
367+
example: 'PLAIN',
349368
type: doveadm_arg_types.STRING,
350369
},
351370
'auth-info': {
@@ -355,17 +374,18 @@ Applicable to [[link,mdbox]] and [[link,sdbox]] mailbox formats only.
355374
},
356375
'master-user': {
357376
cli: 'M',
377+
example: 'masteruser',
358378
type: doveadm_arg_types.STRING,
359379
text: `Master user.`
360380
},
361381
user: {
362-
//example: `foo`,
382+
example: `username`,
363383
positional: true,
364384
type: doveadm_arg_types.STRING,
365385
text: `Login UID.`
366386
},
367387
password: {
368-
//example: `bar`,
388+
example: `password`,
369389
positional: true,
370390
optional: true,
371391
type: doveadm_arg_types.STRING,
@@ -381,82 +401,124 @@ Applicable to [[link,mdbox]] and [[link,sdbox]] mailbox formats only.
381401
'full-sync': {
382402
cli: 'f',
383403
type: doveadm_arg_types.BOOL,
404+
text: `Full sync?`,
384405
},
385406
'purge-remote': {
386407
cli: 'P',
387408
type: doveadm_arg_types.BOOL,
409+
text: `Purge destination after sync?`,
388410
},
389411
'reverse-sync': {
390412
cli: 'R',
391413
type: doveadm_arg_types.BOOL,
414+
text: `Do a reverse sync?`,
392415
},
393416
'lock-timeout': {
394417
cli: 'l',
418+
example: 60,
395419
type: doveadm_arg_types.INTEGER,
420+
text: `Lock timeout for the user (in seconds).`,
396421
},
397422
rawlog: {
398423
cli: 'r',
424+
example: 'rawlog_name',
399425
type: doveadm_arg_types.STRING,
426+
text: `Write rawlog to this file.`,
400427
},
401428
mailbox: {
402429
cli: 'm',
430+
example: 'INBOX',
403431
type: doveadm_arg_types.STRING,
432+
text: `Sync only this mailbox.`,
404433
},
405434
'mailbox-guid': {
406435
cli: 'g',
436+
example: 'mailbox_guid',
407437
type: doveadm_arg_types.STRING,
438+
text: `Sync only this mailbox GUID.`,
408439
},
409440
namespace: {
410441
cli: 'n',
442+
example: ['namespace'],
411443
type: doveadm_arg_types.ARRAY,
444+
text: `Sync only these namespaces.`,
412445
},
413446
'all-namespaces': {
414447
cli: 'N',
415448
type: doveadm_arg_types.BOOL,
449+
text: `Sync all namespaces?`,
416450
},
417451
'exclude-mailbox': {
418452
cli: 'x',
453+
example: ['excluded_mailbox'],
419454
type: doveadm_arg_types.ARRAY,
455+
text: `Exclude these mailbox names/masks.`,
420456
},
421457
'all-mailbox': {
422458
cli: 'a',
459+
example: 'VirtualAll',
423460
type: doveadm_arg_types.STRING,
461+
text: `The name of the virtual All mailbox.`,
424462
},
425463
state: {
426464
cli: 's',
465+
example: 'state_string',
427466
type: doveadm_arg_types.STRING,
467+
text: `State string of last dsync run.`,
428468
},
429469
'sync-since-time': {
430470
cli: 't',
471+
example: '7 days',
431472
type: doveadm_arg_types.STRING,
473+
text: `Sync since timestamp.
474+
475+
` + doveadm_args_human_timestamp,
432476
},
433477
'sync-until-time': {
434478
cli: 'e',
479+
example: '1 day',
435480
type: doveadm_arg_types.STRING,
481+
text: `Sync until timestamp.
482+
483+
` + doveadm_args_human_timestamp,
436484
},
437485
'sync-flags': {
438486
cli: 'O',
487+
example: '\\deleted',
439488
type: doveadm_arg_types.STRING,
489+
text: `
490+
Sync only mails that have the specified flag. If the flag name begins with
491+
\`-\`, sync all mails except the ones with the specified flag.`
440492
},
441493
'sync-max-size': {
442494
cli: 'I',
495+
example: '20M',
443496
type: doveadm_arg_types.STRING,
497+
text: `Skip any mails larger than the specified size.
498+
499+
Format: [[link,settings_types_size]]`
444500
},
445501
timeout: {
446502
cli: 'T',
503+
example: 60,
447504
type: doveadm_arg_types.INTEGER,
505+
text: `Timeout (in seconds).`,
448506
},
449507
'default-destination': {
450508
cli: 'd',
451509
type: doveadm_arg_types.BOOL,
510+
text: `Use the default destination?`,
452511
},
453512
'legacy-dsync': {
454513
cli: 'E',
455514
type: doveadm_arg_types.BOOL,
515+
text: `Use legacy dsync?`,
456516
},
457517
destination: {
458518
positional: true,
459519
type: doveadm_arg_types.ARRAY,
520+
text: `
521+
The synchronized destination. See [[man,doveadm-sync]] for options.`
460522
},
461523
},
462524
flags: doveadm_flag_types.USER | doveadm_flag_types.USERFILE,
@@ -466,11 +528,13 @@ Applicable to [[link,mdbox]] and [[link,sdbox]] mailbox formats only.
466528
'compress connect': {
467529
args: {
468530
host: {
531+
example: 'hostname',
469532
positional: true,
470533
type: doveadm_arg_types.STRING,
471534
text: `Hostname to connect to.`
472535
},
473536
port: {
537+
example: '123',
474538
positional: true,
475539
optional: true,
476540
type: doveadm_arg_types.INTEGER,

lib/data/doveadm.data.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@ import slugify from '@sindresorhus/slugify'
77
const doveadm_userargs = {
88
'all-users': {
99
cli: 'A',
10+
example: false,
1011
type: doveadm_arg_types.BOOL,
1112
text: `Apply operation to all users.`
1213
},
1314
'socket-path': {
1415
cli: 'S',
16+
example: '/var/run/dovecot/doveadm-server',
1517
type: doveadm_arg_types.STRING,
1618
text: `Path to doveadm socket.`
1719
},
1820
user: {
1921
cli: 'u',
22+
example: 'username',
2023
type: doveadm_arg_types.STRING,
2124
text: `UID of user to apply operation to.`,
2225
},

lib/doveadm.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const doveadm_response_types = {
2323
}
2424

2525
export const doveadm_args_query = {
26-
//example: ['mailbox', 'INBOX/myfoldertoo', 'savedbefore', 'since', '30d'],
26+
example: ['mailbox', 'INBOX/myfoldertoo', 'savedbefore', 'since', '30d'],
2727
positional: true,
2828
type: doveadm_arg_types.SEARCH_QUERY,
2929
text: `Search query to apply.`,
@@ -35,6 +35,15 @@ export const doveadm_args_usermask = {
3535
text: `User Mask.`
3636
}
3737

38+
export const doveadm_args_human_timestamp = `
39+
Allowable formats:
40+
41+
* yyyy-mm-dd (non-UTC),
42+
* IMAP date ("dd-mm-yyyy"; see [[rfc,3501]]) (non-UTC)
43+
* IMAP date-time ("dd-mm-yyy HH:MM:SS +0000; see [[rfc,3501]]) (UTC supported)
44+
* Unix timestamp (UTC supported)
45+
* Interval ("n days", UTC supported)`
46+
3847
/* Generate command line string for doveadm. */
3948
export function getDoveadmCmdLine(args) {
4049
let ret = ''

0 commit comments

Comments
 (0)