Email Management
Email Management
Manage mailboxes & mail stack. Mailbox addressed by :id.
Base: /api/v1/email · Auth: Authorization: Bearer wsp_…
Error envelope:
{ "success": false, "code": "VALIDATION_ERROR", "error": "Domain is required", "message": "…", "status": 400 }
Stack status — GET /api/v1/email/status
Response 200 (verified live):
{ "installed": false, "mta_installed": false, "mta_path": "",
"postfix": { "installed": false, "running": false },
"dovecot": { "installed": false, "running": false },
"dovecot_installed": false, "dovecot_running": false,
"clamav_installed": false, "clamav_running": false }
POST /api/v1/email/install (no body) bootstraps the stack.
Accounts
GET /api/v1/email/accounts → { "accounts": null, "total": 0 }
(verified live), or accounts = array.
POST /api/v1/email/accounts Request:
{ "domain": "example.com", "username": "info",
"password": "S3cure•pass", "quota_mb": 1024 }
domain/username/password required; quota_mb (0 = unlimited).
On success returns the account object.
Response 400 (verified live — empty body):
{ "success": false, "code": "VALIDATION_ERROR",
"error": "Domain is required", "message": "Domain is required",
"status": 400 }
GET /email/accounts/:id; PUT /email/accounts/:id
{ "password": "new", "quota_mb": 2048 };
POST /email/accounts/:id/toggle; DELETE /email/accounts/:id.
Forwarders / catch-all / autoresponder / vacation / sieve
POST /email/forwarders { "source": "a@x", "destination": "b@y" }; GET | PUT /email/catchall/:domain;
GET | PUT /email/autoresponders/:account_id;
GET /email/vacation/:domain; POST | PUT | DELETE /email/filters/:domain/:account (Sieve).
DKIM / mailing lists / admin
DKIM GET /email/dkim · /dkim/:domain/verify; POST | DELETE /email/dkim/:domain. Mailing list POST /email/mailinglist/:domain.
Spam/RBL/ClamAV + ratelimit groups are admin (/email/spam,
/email/rbl, /email/clamav, /email/ratelimit).
Conventions → Authentication, Error Handling.