diff --git a/components/DoveadmComponent.vue b/components/DoveadmComponent.vue index 50e55403a..050cec2b9 100644 --- a/components/DoveadmComponent.vue +++ b/components/DoveadmComponent.vue @@ -49,7 +49,7 @@ function httpClick(k) { -
Man Page | @@ -79,28 +79,6 @@ function httpClick(k) {|||||||
---|---|---|---|---|---|---|---|
Response Values | -
-
|
-
wget --header="Content-Type: application/json" --user=doveadm --password=password --auth-no-challenge --post-data='{{ JSON.stringify(jsonReq) }}' --output-document - http://example.com:8080/doveadm/v1
-
+
Example Server Response
-{{ JSON.stringify(jsonResp, null, 4) }}
diff --git a/data/doveadm.js b/data/doveadm.js
index cb2b76912..4c5f41305 100644
--- a/data/doveadm.js
+++ b/data/doveadm.js
@@ -2,8 +2,7 @@
import { doveadm_arg_types,
doveadm_args_query,
doveadm_args_usermask,
- doveadm_flag_types,
- doveadm_response_types } from '../lib/doveadm.js'
+ doveadm_flag_types } from '../lib/doveadm.js'
export const doveadm = {
@@ -52,20 +51,21 @@ export const doveadm = {
// deprecated: {},
// removed: {},
- // Response data.
- // KEY = identifier
- // response: {
- // key: {
- // // An example value to be used in documentation.
- // example: 0,
+ // Response data. (HTTP API)
+ //
+ // Since doveadm responses are so variable, it is difficult to create
+ // an abstracted system to document the format.
//
- // // The description of the response data type.
- // // Rendered w/Markdown.
- // text: `Description`,
+ // Thus, (for now) simply provide a place to describe HTTP API
+ // responses.
+ // response: {
+ // // This is the JSON data returned from the server. Do NOT
+ // // include the enclosing array, as this will be added
+ // // automatically when displaying.
+ // example: {},
//
- // // The response data type
- // type: doveadm_response_types.INTEGER,
- // }
+ // // A description of the response. Rendered w/Markdown.
+ // text: ``,
// },
// What doveadm flags does this command support (bit field)
@@ -252,10 +252,14 @@ Applicable to [[link,mdbox]] and [[link,sdbox]] mailbox formats only.
},
},
response: {
- entries: {
- type: doveadm_response_types.INTEGER,
- text: `The number of cache entries flushed.`
+ example: {
+ entries: 1
},
+ text: `
+| Key | Description |
+| --- | ----------- |
+| \`entries\` | The number of cache entries flushed. |
+`
},
man: 'doveadm-auth',
text: `Flush authentication cache.`,
@@ -1372,7 +1376,7 @@ to secure it.
text: `Mailbox mask.`
},
},
- response: {},
+ response: null,
flags: doveadm_flag_types.USER,
plugin: 'mail-crypt',
man: 'doveadm-mailbox-cryptokey',
@@ -1392,7 +1396,7 @@ to secure it.
text: `Mailbox mask.`
},
},
- response: {},
+ response: null,
flags: doveadm_flag_types.USER,
plugin: 'mail-crypt',
man: 'doveadm-mailbox-cryptokey',
@@ -1427,7 +1431,7 @@ to secure it.
text: `Old password.`
},
},
- response: {},
+ response: null,
flags: doveadm_flag_types.USER,
plugin: 'mail-crypt',
man: 'doveadm-mailbox-cryptokey',
@@ -2269,6 +2273,37 @@ returned.`,
text: `UID -or- IP Address mask.`,
},
},
+ response: {
+ example: [
+ {
+ username: "foo",
+ connections: "1",
+ service: "imap",
+ pid: "(47)",
+ ip: "(10.0.2.100)"
+ }
+ ],
+ text: `
+Returns an array of objects.
+
+If \`separate-connections\` is \`false\`, each object represents a single
+username/service combination, and the \`pid\` and \`ip\` fields will include
+all entries for that combination.
+
+If \`separate-connections\` is \`true\`, each object will contain a single
+connection.
+
+Object fields:
+
+| Key | Description |
+| --- | ----------- |
+| \`connections\` | The total number of connections for the user. This is only returned if \`separate-connections\` is \`false\`. |
+| \`ip\` | IP addresses where the user's connections are originating. |
+| \`pid\` | Process IDs of the session. |
+| \`service\` | The Dovecot service. |
+| \`username\` | Username |
+`
+ },
man: 'doveadm-who',
text: `Show who is logged into the Dovecot server.`,
},
diff --git a/docs/core/admin/doveadm.md b/docs/core/admin/doveadm.md
index 12ae61dac..c1d67849d 100644
--- a/docs/core/admin/doveadm.md
+++ b/docs/core/admin/doveadm.md
@@ -101,27 +101,54 @@ service doveadm {
Connecting to the endpoint can be done by using standard HTTP protocol and
authentication headers.
-To get list the commands supported by the endpoint, the following example
-commands can be used:
+::: info
+There is also https://github.com/dovecot/doveadm-http-cli that can be
+used for accessing the API.
+:::
+
+All doveadm commands are accessed under the `/doveadm/v1` path.
+
+#### Command List
-#### `X-Dovecot-API` Auth
+To get the list of commands supported by the endpoint, send an authenticated
+GET request to the root of the endpoint (for all endpoint commands), or to
+`/doveadm/v1` path (for doveadm API commands).
+
+For example, using [[setting,doveadm_password]] authentication:
```console
-$ curl -H "Authorization: X-Dovecot-API