Open mostafa0017 opened 2 months ago
Is there no endpoint in the API @FreddleSpl0it?
So I wanted to use recovery_email in a POST request to create a mailbox, but sadly this >value is ignored if I tried and a mailbox gets created without it.
edit file /opt/mailcowdockerized/data/web/inc/functions.mailbox.inc.php
goto line 1079: add recovery_email as follows:
1078 $recovery_email = (isset($_data['recovery_email'])) ? strval($_data['recovery_email']) : strval($MAILBOX_DEFAULT_ATTRIBUTES['recovery_email']);
1079 $mailbox_attrs = json_encode( 1080
goto line 1094: add recovery_email as follows:
1094 'attribute_hash' => $attribute_hash, 1095 'recovery_email' => $recovery_email
docker compose down ; docker compose up -d
curl example to create mailbox with recovery email:
curl -v -X 'POST' \ 'https://your-maildoain.tld/api/v1/add/mailbox' \ -H 'X-API-Key: your api-key' \ -H 'Content-Type: application/json' \ -d '{ "active": "1", "domain": "yourdomain.tld", "local_part": "info3", "name": "Full name", "password": "123123", "password2": "123123", "quota": "3072", "force_pw_update": "0", "tls_enforce_in": "1", "tls_enforce_out": "1", "recovery_email": "recovery_email@hotmail.com" }'
Summary
Currently, If I sent a get request to get a mailbox I receive:
So I wanted to use
recovery_email
in a POST request to create a mailbox, but sadly this value is ignored if I tried and a mailbox gets created without it.Motivation
It would benefit all the API users by adding another value to be set while creating a mailbox.
Additional context
No response