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