Example for doveadm-save using Doveadm HTTP API
Sami Ketola
sami.ketola at dovecot.fi
Wed May 10 18:06:05 EEST 2017
> On 10 May 2017, at 14.57, KT Walrus <kevin at my.walr.us> wrote:
>
> I could use an example of how to use curl to save a new message to a user’s INBOX using the Doveadm HTTP API.
>
Here you go:
doveadm mailbox save
parameters:
{
"command": "save",
"parameters": [
{
"name": "allUsers",
"type": "boolean"
},
{
"name": "socketPath",
"type": "string"
},
{
"name": "user",
"type": "string"
},
{
"name": "userFile",
"type": "string"
},
{
"name": "mailbox",
"type": "string"
},
{
"name": "file",
"type": "string"
}
]
}
example:
[
[
"save",
{
"file": "From: Joulu Pukki <joulu.pukki at korvatunturi.fi>\nSubject: plaa\n\nmail body\n",
"mailbox": "INBOX/myfoldertoo",
"user": "samik"
},
"bb"
]
]
# curl -v -X POST -u doveadm:hellodoveadm -H "Content-Type: application/json" -d '[["save",{"user":"samik","mailbox":"INBOX/myfoldertoo","file":"From: Joulu Pukki <joulu.pukki at korvatunturi.fi>\nSubject: plaa\n\nmail body\n"},"bb"]]' http://localhost:8080/doveadm/v1
> Does anyone here use the Doveadm HTTP API in production?
I know many.
Sami
More information about the dovecot
mailing list