Tool.exe/Tool.sh

This is a command line tool which you can use to administer domains and accounts as well as all system variables. You can find it directly in the InstallDirectory folder. It is easy to use and you only have to know the API constants. Complete list of API constants is in the APIconst.pas file in the InstallDirectory\API\Delphi\ folder.

Note: Using tool.exe for performing large operation can cause temporary service unavailability because the service needs to be restarted for some changes in configuration. For servers with many domains and many users with high load, restarting can take some time. Therefore, we recommend performing large batches of changes in low-load periods.

Command line tool does not support multi-line, you can encounter this e.g. using the autoresponder variable.

Command

Description

CREATE

Creates a new object. It is followed by a type (domain or account) and a list of variables and values you want to assign to these variables.

DELETE

Deletes an object. It is followed by a type (domain or account) and a unique name of object you want to delete.

MODIFY

Modifies any variable (property) of an object. It is followed by a type of object and a list of variables and values you want to assign to these variables.

DISPLAY

Displays any variable (property) of an object. It is followed by a type of object (domain, account or system) and a list of variables you want to show. Result is generated with double line feeds.

EXPORT

Does the same as DISPLAY command but this command shows on the screen everything separated by comma (CSV format). Result is generated without double line feeds.

IMPORT

Imports objects in CSV format from file, if objects already exists its overwritten without warning.

FILE

Calls file functions. It is followed by USERSTATISTICS and all its parameters (see below).

Parameter

Description

ACCOUNT [variables]

Address any account on the server.

DOMAIN [variables]

Address any domain on the server.

SYSTEM [variables]

Address any system variable such as c_version, c_name, etc. List is also in APIConst.pas

BATCH batchfile

Allows you to run a batch file with a set of commands included. See examples below.

Batchfile is just a common text file with commands. Each on a separate line. These commands must not include "tool" at the beginning. Just the commands and parameters.

USERSTATISTICS fromdate todate filterstring outputfile

Saves user statistics between fromdate and todate to specified output file for all users that fulfill the condition of filterstring.

fromdate, todate have yyyy/mm/dd format

filterstring supports also asterisks and question marks to specify more accounts. If it does not contain @ symbol it is considered as domain name.

outputfile if you do not specify absolute path, it will be saved to the <InstallDirectory> folder.

How to create other types of accounts

To create other types of accounts, use the u_type property. Its values are also written in the APIConst.pas file. For example, mailing list has 1 as a value of this property. So if I want to create mailing list, I will have to use this:

tool create account mailing@icewarpdemo.com u_type 1 m_owneraddress "admin@icewarpdemo.com"

Usage

The form of the command: tool [options] {command} {object} {parameters}

  1. To create an account with New Account in Full Name field and pass as password.

    tool create account new@icewarpdemo.com u_name "New Account" u_password "pass" u_accounttype 2

  2. To show values of both variables of u_mailbox and u_accounttype of the new@icewarpdemo.com account.

    tool display account new@icewarpdemo.com u_mailbox u_accounttype

  3. To delete the oldone.net domain from your server.

    tool delete domain oldone.net

  4. To change all accounts in icewarpdemo.com to IMAP accounts.

    tool modify account *@icewarpdemo.com u_accounttype 2

  5. To save user statistics between dates 2004/12/25 and 2004/12/31 for all accounts in icewarpdemo.com domain to the statistics.txt file. This file can be found in the <install_dir> folder.

    tool file userstatistics 2004/12/25 2004/12/31 icewarpdemo.com statistics.txt

  6. To see the d_description and d_postmaster variables for all domains in CSV format each value is separated by comma.

    tool export domain * d_description d_postmaster

  7. To export the three above fields, and put user's full email address into the first column.

    tool export account *@* u_mailbox u_name u_password > accounts.txt

  8. To import three fields from CSV.

    tool import account "domain_com.csv" u_name u_passwordu_comment

    Note: The first field imported from this CSV file is an email address. It is imported automatically and is not to be written in the import command. It has to be specified in CSV in the first place.

  9. To see the system variable that contains a POP3 service port.

    tool display system c_config_services_pop3_port

  10. To create three mailing lists defined in the create_mailing.txt file.

    tool file batch create_mailing.txt

    Where create_mailing.txt looks like:

    • create account mailing1@icewarpdemo.com u_type 1 m_owneraddress "admin@icewarpdemo.com"

    • create account mailing2@icewarpdemo.com u_type 1 m_owneraddress "admin@icewarpdemo.com"

    • create account mailing3@icewarpdemo.com u_type 1 m_owneraddress "admin@icewarpdemo.com"

  11. To verify which accounts do not comply with the new password policy.

    tool check account *@* passpolicy

  12. To redirect to a file.

    tool check account *@* passpolicy > {filename}

  13. Example:

    tool check account *@* passpolicy>outofpolicy.txt
  14. Gets a listing of accounts with double line feeds.

    tool display account @*@ > accounts.txt

  15. Gets listing with single line feeds.

    tool export account *@* > accounts.txt