Doveadm protocol
================

doveadm-server can be accessed via UNIX sockets or TCP protocol (by adding
inet_listener to doveadm service). The protocol looks like:

Initial handshake from client to server:

---%<-------------------------------------------------------------------------
C: VERSION      doveadm-server  1       0
---%<-------------------------------------------------------------------------

Note that the spaces you see are TABs. All the fields are TAB-separated. The
server will send you back either:

 * "+" means you are preauthenticated and can start sending commands. This
   happens when connecting to the UNIX socket.
 * "-" means you need to authenticate first.

The authentication is done with a regular SASL PLAIN authentication, i.e.
"PLAIN<tab>base64(\0user\0password)". For example for user=tss, password=secret
use:

---%<-------------------------------------------------------------------------
C: PLAIN        AHRzcwBzZWNyZXQ=
S: +
---%<-------------------------------------------------------------------------

The actual commands are in format: flags<tab>username<tab>command
name[<tab>parameter[<tab>parameter2...]], where the flags can be either empty,
"v" (verbose) or "D" (debug). Note that if the command name has spaces, they
are sent as spaces instead of as tabs (e.g. "quota get", not "quota<tab>get").
So for example to get a quota for user tss:

---%<-------------------------------------------------------------------------
C:      tss     quota get
S: user STORAGE 1814    -       0       user    MESSAGE 6       -       0      

S: +
---%<-------------------------------------------------------------------------

The server replies using the same fields as what a regular doveadm command
sends.

(This file was created from the wiki on 2013-06-24 04:42)
