Back to the main page

cmail-api

HTTP API to the master database

This module provides an HTTP API into the master database as well as configured user databases. It can be used to enable graphical or automated configuration of the system, such as setting up users, adressses and routing.

Requirements

In order to be able to run the API server, you need the following technologies

Basic Configuration

  1. Edit the config.php.sample to your liking and configuration
  2. Copy or rename config.php.sample to config.php
  3. Make sure the httpd has read and write access to the folder containing the database as well as the database file itself
  4. Link or copy the API module's folder into the httpd's served directory tree

Options available in config.php

NameParametersDescription
$dbpathStringPath to master database.
$modulelistArray List of active Modules. This map has as key the module class name and the value as path to the module php file.
Here is a list of valid modules which we provide:
Modules Address With this module you can modify addresses the server will accept and map these to users.
User (required) This Module controls all user related stuff and provides the authorization and rights for users.
Delegate This Module manages user and address delegations. If you use the delegate right (see "Rights") you need this module.
MSA This Module manages routing decisions for users.
POP This Module manages access to the pop service and can unlock pop locks. If you don't need the pop service you can disable it.
Mailbox This Module manages the access to the webmailer. Enabled user can read and write mails with the webmailer. If you don't need the webmailer then disable the webmailer module.

Endpoints

ModuleEndpointRightDescription
General /?get-modules * Returns all active modules.
User users/?get admin Return all users.
delegate Return all delegeted users.
* Return the authenticated user.
users/?add admin Adds an user.
users/?delete admin Delete the given user.
users/?set_password admin, delegate (only delegated users) or user (only user) Sets the password of the user.
users/?add_right admin Adds a right to a user.
users/?delete_right admin Deletes a right of a user.
users/?update-rights admin Updates rights for a user.