~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to doc/wiki/Design.DoveadmProtocol.txt

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Doveadm protocol
 
2
================
 
3
 
 
4
doveadm-server can be accessed via UNIX sockets or TCP protocol (by adding
 
5
inet_listener to doveadm service). The protocol looks like:
 
6
 
 
7
Initial handshake from client to server:
 
8
 
 
9
---%<-------------------------------------------------------------------------
 
10
C: VERSION      doveadm-server  1       0
 
11
---%<-------------------------------------------------------------------------
 
12
 
 
13
Note that the spaces you see are TABs. All the fields are TAB-separated. The
 
14
server will send you back either:
 
15
 
 
16
 * "+" means you are preauthenticated and can start sending commands. This
 
17
   happens when connecting to the UNIX socket.
 
18
 * "-" means you need to authenticate first.
 
19
 
 
20
The authentication is done with a regular SASL PLAIN authentication, i.e.
 
21
"PLAIN<tab>base64(\0user\0password)". For example for user=tss, password=secret
 
22
use:
 
23
 
 
24
---%<-------------------------------------------------------------------------
 
25
C: PLAIN        AHRzcwBzZWNyZXQ=
 
26
S: +
 
27
---%<-------------------------------------------------------------------------
 
28
 
 
29
The actual commands are in format: flags<tab>username<tab>command
 
30
name[<tab>parameter[<tab>parameter2...]], where the flags can be either empty,
 
31
"v" (verbose) or "D" (debug). Note that if the command name has spaces, they
 
32
are sent as spaces instead of as tabs (e.g. "quota get", not "quota<tab>get").
 
33
So for example to get a quota for user tss:
 
34
 
 
35
---%<-------------------------------------------------------------------------
 
36
C:      tss     quota get
 
37
S: user STORAGE 1814    -       0       user    MESSAGE 6       -       0      
 
38
 
 
39
S: +
 
40
---%<-------------------------------------------------------------------------
 
41
 
 
42
The storage values are all given in kilobytes.
 
43
 
 
44
The server replies using the same fields TAB-separated as what a regular
 
45
doveadm command sends. The reply itself ends with LF. So if the reply is large,
 
46
it may return a very long line as a reply. After the reply follows a status
 
47
line:
 
48
 
 
49
 * "+" = success.
 
50
    * In future the "+" may be followed by more text, for now you should just
 
51
      ignore those.
 
52
 * "-" = failed (the error was probably logged to Dovecot's error log)
 
53
    * "-NOUSER" = the user doesn't exist
 
54
    * Other "-SOMETHING" errors may be added in future.
 
55
 
 
56
(This file was created from the wiki on 2013-08-05 04:42)