1CYR_DBTOOL(8) Cyrus IMAP CYR_DBTOOL(8)
2
3
4
6 cyr_dbtool - Cyrus IMAP documentation
7
8 Manage Cyrus databases
9
11 cyr_dbtool [ -C config-file ] [ -M ] [ -n ] [ -o ] [ -T ]
12 db-file db-backend action [ key ] [ value ]
13
15 cyr_dbtool is used to manage a cyrusdb file. The usable actions are:
16 show [<prefix>]
17
18 get <key>
19
20 set <key> <value>
21
22 delete <key>
23
24 consistency
25
26 repack
27
28 You may omit key or key/value and specify one per line on stdin. Keys
29 are terminated by tab or newline, values are terminated by newline.
30
31 Running without any options will list the available database backends
32 and usable actions.
33
34 The consistency action runs a consistency check on the DB by calling
35 'myconsistent' on it.
36
37 The repack action will compress the database by removing stale data on
38 backends which support it. It's a NOOP otherwise.
39
40 cyr_dbtool reads its configuration options out of the imapd.conf(5)
41 file unless specified otherwise by -C.
42
43 NOTE:
44 Note that the file locations are NOT read out of the configuration
45 file, and must be supplied on the command line.
46
47 TIP:
48 The format of all Cyrus databases is detailed in the distribution in
49 file doc/internal/database-formats.html. Please consult that for
50 details.
51
53 -C config-file
54 Use the specified configuration file config-file rather than the
55 default imapd.conf(5).
56
57 -M Uses improved MBOX list sort
58
59 -n Create the database file if it doesn't already exist.
60
61 -o Store all the output in memory and only print it once the trans‐
62 action is completed.
63
64 -T Use a transaction to do the action (most especially for 'show')
65 - the default used to be transactions.
66
68 This series of examples address manipulating the user_deny.db database,
69 which is used to deny users access to specific services. This is typi‐
70 cally a Cyrus "flat" format database.
71
72 user_deny.db is indexed by userid and each record contains the database
73 version number (currently 2), a list of "wildmat" patterns specifying
74 Cyrus services to be denied, and a text message to be displayed to the
75 user upon denial. The service names to be matched are those as used in
76 cyrus.conf(5).
77
78 NOTE:
79 Given that keys are tab-delimited, these examples use the notation
80 <tab> to indicate the tab character. When entering this via the
81 command line, remember to escape tabs. In a normal shell, one can
82 do so with <ctrl-v> (^v). The sequence "<ctrl-v><ctrl-i>" (^v^i)
83 works well to enter tab characters.
84
85 cyr_dbtool /var/lib/imap/user_deny.db flat baduser "2<tab>pop3,imap<tab>Denied"
86 Deny the user 'baduser' access to imap and pop3.
87
88 cyr_dbtool /var/lib/imap/user_deny.db flat show
89 Show all current database records.
90
91 cyr_dbtool /var/lib/imap/user_deny.db flat get baduser
92 Get the current database record(s) for user 'baduser'.
93
95 /etc/imapd.conf
96
98 imapd.conf(5)
99
101 The Cyrus Team, Nic Bernstein (Onlight), Jeroen van Meeuwen (Kolab Sys‐
102 tems)
103
105 1993-2017, The Cyrus Team
106
107
108
109
1103.0.13 December 16, 2019 CYR_DBTOOL(8)