I'm trying to set up my dovecot server to access curl request over LAN by following https://doc.dovecot.org/2.3/admin_manual/doveadm_http_api/#admin-doveadm-http-api
My OS is: Rocky 9 linux and dovecot version is:2.3.16
in /etc/dovecot/conf.d/ my mail-location set as:
mail_location = maildir:/home/vmail/%d/%n/Maildir
and
inbox = yes
/etc/dovecot/dovecot.conf, I added
doveadm_password = admpass
service doveadm {
unix_listener doveadm-server {
user = vmail
}
inet_listener {
port = 2425
}
inet_listener http {
port = 8080
#ssl = yes # uncomment to enable https
}
}
when I run
doveadm fetch -u [email protected] "text" MAILBOX INBOX UNSEEN
I can grab the new emails properly.
But when I try to fetch emails by using curl.
curl -u doveadm:admpass -X POST -H "Content-Type: application/json" -d '[[ "fetch", { "mailbox": "INBOX", "user": "[email protected]"}, "tag1" ]]' http://localhost:8080/doveadm/v1
I get this error:
[["error",{"type":"invalidRequest", "exitCode":0},"tag1"]]
How I can query my user's new emails by using curl from LAN host? And get the response in json format?