The email function manages the mailboxes of a hosting account. emailadmin returns the server administrator’s email address.
URL: https://YOUR-SERVER:2304/v1/email/ — permission Email.
Note: Creating a mailbox uses the parameters email + domain. All other actions identify the mailbox with mailbox = the full address (info@example.com). Using email for those actions returns an error page.
Create a mailbox (action=add)
| Parameter | Description |
|---|---|
user | Hosting account username |
email | Part before @, for example info |
domain | Domain of the account |
pass | Mailbox password |
quotamail | Mailbox size in MB (0 = unlimited) |
curl -k -X POST https://203.0.113.10:2304/v1/email/ \
-d "key=YOUR_API_KEY&action=add&user=john&email=info&domain=example.com&pass=S3cretPass"amail=100"
{"status":"OK"}
List mailboxes (action=list)
curl -k -X POST https://203.0.113.10:2304/v1/email/ -d "key=YOUR_API_KEY&action=list&user=john"
{"status":"OK","result":[{"email":"info@example.com","pass":"{SHA512-CRYPT}$6$…","quota":"104857600","consumed":0,"status":"1"}]}
| Field | Meaning |
|---|---|
email | Mailbox address |
quota | Quota in bytes (104857600 = 100 MB) |
consumed | Used space |
status | 1 = active |
pass | Password hash — do not log or display it |
Update a mailbox (action=udp)
| Parameter | Description |
|---|---|
user | Hosting account username |
mailbox | Full address |
password | New password (optional) |
quota | New quota in MB (optional) |
curl -k -X POST https://203.0.113.10:2304/v1/email/ \
-d "key=YOUR_API_KEY&action=udp&user=john&mailbox=info@example.com&password=N3wS3cret"a=200"
{"status":"OK"}
Suspend, unsuspend and delete
curl -k -X POST https://203.0.113.10:2304/v1/email/ -d "key=YOUR_API_KEY&action=susp&user=john&mailbox=info@example.com"
curl -k -X POST https://203.0.113.10:2304/v1/email/ -d "key=YOUR_API_KEY&action=unsp&user=john&mailbox=info@example.com"
curl -k -X POST https://203.0.113.10:2304/v1/email/ -d "key=YOUR_API_KEY&action=del&user=john&mailbox=info@example.com"
{"status":"OK"}
A suspended mailbox cannot log in or receive mail. Deleting a mailbox removes all its messages.
Server admin email (emailadmin)
URL: /v1/emailadmin/ — action=list. Returns the email address of the server administrator.
curl -k -X POST https://203.0.113.10:2304/v1/emailadmin/ -d "key=YOUR_API_KEY&action=list"
{"status":"OK","emailadmin":"admin@example.com"}