New feature: HTTP API
aki.tuomi at dovecot.fi
aki.tuomi at dovecot.fi
Sat Feb 20 16:09:20 UTC 2016
Hi all!
We are bringing out HTTP API for doveadm-server in master HEAD. This feature is
experimental, and can be expected to have bugs in it and might not always work.
If you feel like trying it out though, you can enable it in your configuration
file:
doveadm_api_key = some-string
service doveadm {
inet_listener http {
port = 8080
}
}
To use the API, you can go to http://host:8080/doveadm. GET request will print
out possible commands, along with their parameters. If you have set API KEY, you
need to include it in the request as X-API-Key header.
This API has been designed to resemble JMAP API since we are planning to
implement it in future version.
The rule of thumb is that all the commands work as they would on cli, so the
parameters are more or less the same. There are few exceptions, like 'field'
parameter in some mail/mailbox commands.
Commands are executed by POSTin JSON to /doveadm. The JSON format is
[
["command",{"parameter":"value"},"opaque identifier"],
["command",{"parameter":"value"},"opaque identifier"],
["command",{"parameter":"value"},"opaque identifier"],
...
]
Be warned though that even if it supports multiple commands, some commands still
use i_fatal to terminate the server if they are unhappy. This will mean you will
lose the whole result set, and get no output, so at this point it is safest
option to run only one command at a time.
If you run into problems or discover issues, please report them in the usual
manner to us.
Kind regards,
Aki Tuomi
Dovecot Oy
More information about the dovecot
mailing list