1.. _imap-developer-guidance-replication-protocol:
2
3..  Note: This document was converted from the original by Nic Bernstein
4    (Onlight).  Any formatting mistakes are my fault and not the
5    original author's.
6
7Cyrus IMAP Server: Replication Protocol v2.4+
8=============================================
9
10DList 1.0
11---------
12
13The DList protocol is based closely on the IMAP wire protocol, using
14atoms and literals as the basis, but with two extended types of data:
15
16-  kvlist
17-  rfc822-object
18
19A wart of the protocol is the rfc822-object, which contains an explicit
20cyrus backend partition. This will be removed in future versions of
21Cyrus.
22
23types
24~~~~~
25
26atom
27^^^^
28
29An atom is actually a sequence of any character other than '\\0', the
30NULL byte. Character encoding is not specified, but it can contain 8 bit
31characters, and is probably utf8
32
33flag
34^^^^
35
36Flag is a horrible special case of atom to allow \\word to be
37represented as an IMAP atom on the wire. This is one of many special
38cases in the IMAP protocol, and is duplicated into dlist just to make it
39easier to read
40
41num32/num
42^^^^^^^^^
43
44Both stored as 64 bit integers internally, and sent as decimal numbers
45over the wire, this type exists only in the API, it just looks like a
46string on the wire.
47
48hex32/hex
49^^^^^^^^^
50
51Stored like num internally, but sent as an 8 or 16 character hexadecimal
52string on the wire
53
54map
55^^^
56
57Like atom, but can contain NULL. All values are parsed off the wire as
58'map' type and then converted on demand into the requested type
59
60list
61^^^^
62
63Encoded in parentheses like so (item item item) a list type can be
64nested inside other lists: (item (sub sub) item)
65
66kvlist
67^^^^^^
68
69A kvlist allows named parameters, and is indicated with a leading %
70character. % is invalid in atoms, so parsing is unambiguous, e.g:
71
72%(key1 value1 key2 (list of values) key3 value3)
73
74rfc822-object/file
75^^^^^^^^^^^^^^^^^^
76
77Finally the ugly one. These look like a literal, but with a leading %
78and two more fields:
79
80::
81
82    %{partition sha1 size}\r\n
83    data
84