mailcow / mailcow-apiblueprint

The official mailcow API documentation
5 stars 7 forks source link

API - ratelimit #4

Open pantunes87 opened 2 years ago

pantunes87 commented 2 years ago

Hi all. I’m trying to create/change the rate limit through API, and the log seems ok but the rate limit change to disable.. example before and after:

BEFORE:

curl -s -X ‘GET’ ‘https://mail.domain.com/api/v1/get/rl-mbox/user1%40domain.com’ -H ‘accept: application/json’ -H ‘X-API-Key: XXXXXXXXXXX | jq ’.' { “value”: “10”, “frame”: “s”

CHANGING:

curl -s -X ‘POST’ ‘https://mail.domain.com/api/v1/edit/rl-mbox/’ -H ‘accept: application/json’ -H ‘Content-Type: application/json’ -H ‘X-API-Key: XXXXXXXXXXXXXX’ -d '{ “attr”: { “rl_vlaue”: “30”, “rl_frame”: “m” }, “items”: [ “user1@domain.com” ] }‘ | jq ’.' [ { “type”: “success”, “log”: [ “ratelimit”, “edit”, “mailbox”, { “object”: [ “user1@domain.com” ], “rl_vlaue”: “30”, “rl_frame”: “m” } ], “msg”: [ “rl_saved”, “user1@domain.com” ] } ]

AFTER:

curl -s -X ‘GET’ ‘https://mail.domain.com/api/v1/get/rl-mbox/mail.domain.com%40domain.com’ -H ‘accept: application/json’ -H ‘X-API-Key: XXXXXXXX’ | jq ‘.’

itkfm commented 8 months ago

Seems like the suggested fix from https://community.mailcow.email/d/478-mailcow-api-edit-mailbox-ratelimits hasn’t been incorporated yet.

itkfm commented 8 months ago

The request body should be an object, not an array of objects. rl_vlaue should be rl_value.