CLI API Documentation

Axigen's PHP Command Line Interface API reference guide

Classes

class   Domain

Modules

  updateAccount
  updateAccountClass
  configAdminLimits
  updateFolderRcpt
  updateGroup
  updateList
  configMigrationData
  configPublicFolder

Detailed Description

This is the object containing the Axigen domain data for the selected domain

Note of configFilters

Please note that (Sieve) filters are either managed from the WebAdmin or from the CLIAPI. If at least one WebAdmin filter is defined, the configFilters()->listActiveFilters() call will fail. This is caused by the Axigen CLI service refusing to allow updates on a filter that is managed by the WebAdmin interface. If no WebAdmin filters have been defined, you can use the configFilters API to define domain level filters.

Configuring a sieve filter via the CLIAPI

The first thing you need to do is to save the Sieve filter as a file in Axigen's filters directory. In the default configuration, that is /var/opt/axigen/filters. A filter might look like this:

[axi@axi]# cat /var/opt/axigen/filters/ca_filter.script
require ["fileinto", "envelope"];
if anyof (
    header :contains  ["Subject"] ["trash"]
) {
    fileinto "Trash";
    stop;
}
* 

Once the sieve filter file has been saved, you can activate it using the CLIAPI:

<?php
    // with "domain" as the domain object
    $cf = domain->configFilters();
    $cf->addScriptFilter("caFilter", "ca_filter.script");
    $cf->addActiveFilter("100", "caFilter", "script");
    $cf->save();
?>