Editing INI Files

This page describes in detail how to externally manage the mail server settings using other scripts and applications.

Automatic Reloading #

Ability Mail Server is designed for external control of all available settings. This is possible through the use of INI files which are simple text files editable by any script, application or text editor. The mail server periodically checks for any changes and then automatically loads in the new settings. The frequency of this checking is controlled by the General settings.

INI File Structure #

Each INI file follows the same structure and is made from a list of value pairs (e.g. attribute=value) of which there are 3 types; strings, numbers and booleans (where 0 is false and 1 is true).

Example 1: A section of the smtp.ini:

enabled=1
port=25
maxconnections=50
idletimeout=300
bindmethod=0
bindips=
useantihammering=0
usesslexplicit=0
usesslimplicit=0
usessl2withtls=1
sslport=465
sslcertificate=localhost
Some INI files also help organise information into sets, which are composed of an opening brace ('{') symbol and a name, the value pairs and a closing brace ('}') symbol.

Example 2: A section of the outmail.ini:

enabled=1
queuelifemins=26
resenddelaymins=5
maxqueuesize=5000
maxoutboundconnections=5
usesendwarningmails=0
attachoriginalmailtowarningmail=0
sendwarningmailsaftermins=60
usesendfailuremails=1
attachoriginalmailtofailuremail=0
usestaticroutes=1
{ route
 method=1
 usedns=0
 dns=
 tryonlyfirstmxhostthatconnects=0
 tryautodetectifgivendnsfail=0
 trydomainifnomxfound=1
 relayhost=smtp.adomain.com
 relayport=25
 userelaysmtpauth=0
 relayuser=
 relaypass=
 sslmode=0
}

Some INI files which contain undefined amounts of data can use unnamed value pairs or parameters. It is also quite common for sets to be nested within other sets.

Example 3: A section of the pop3retr.ini

enabled=1
maxconnections=20
maxqueuesize=500
pollfrequencymins=30
maxtriggersperday=2000
maxtriggersperdayperip=30
{ retrievals
 { -
  { foraddresses
   -=info@codecrafters.com
  }
  { retrieval
   enabled=1
   host=pop.adomain.com
   port=110
   user=cc
   password=letmein
   destinationfolder=Inbox
   sslmode=0
  }
 }
 { -
  { foraddresses
   -=bob@codecrafters.com
   -=mark@codecrafters.com
   -=simon@codecrafters.com
  }
  { retrieval
   enabled=1
   host=server
   port=110
   user=john
   password=letmein
   destinationfolder=
   sslmode=0
  }
 }
}

Any spaces at the beginning of a line are always ignored. To help structure a complex file, every set adds a space before its contained data (as in Example 3).

Simple Appending

If you do not wish to parse the INI file but simply change a field, this can be done by simply appending a new value pair onto the end of the file. When Ability Mail Server finds more than 1 value pair with the same name, the last one in the file will always be used.

Editing Service Files #

All the service INI files are located in the 'config' folder (usually C:\Code Crafters\Ability Mail Server 5\config). These can be opened and edited at any time.

Editing Account Files

There are 3 different types of account file, all of which are located in 3 different places:

  • Account Listings - These are all the files located in the 'accounts' directory (usually C:\Code Crafters\Ability Mail Server 5\config\accounts).
  • User Data - These are all the files located within a user's directory.
  • Mailing List Delivery Data - This is a single file which contains all the Mailing Lists delivery data.

Accessing Account Files

Because all account files can be accessed by multiple mail servers, editing account files is a little more complex. All the files are still basic INI files but access to these files must be controlled. User data files require you to open a file in the same directory called 'sync' before you open any of the INI files. The 'sync' file must be opened in write mode without sharing. This means that only one process will be able to open the 'sync' file at any one time. Once opened, you can then edit any of the files in that directory, but this does not include any sub directories. When you have finished editing the files, you must close the 'sync' file. The Mailing List delivery data files do not use 'sync' files but instead must always be opened in read-write mode without sharing (regardless of whether you intend to read or write). Account listings files work similar to user data files but have one extra step. To read the INI files, you need only open the 'sync' file in write mode without sharing, but to edit the INI files, you need to open both the 'editsync' and 'sync' files in write mode without sharing (in that order). This double protection is intended so that an administrator can edit the accounts over a period of time without having to save every small change to file. This makes account editing in the normal dialog interface and Remote Admin much quicker.

Simple Appending

To add a new user, group, domain, Mailing List or Shared Address Book, you can simply append a new set onto the end of the appropriate file.

See Also: General.