Adding a Virtual Host (adddomain.exe)

AddDomain.exe is a utility for adding virtual domains. It can be used to simply add a single domain, but is especially useful in a batch file to add multiple domains.

Basic Command Syntax and Example

Usage:

adddomain -h Hostname -i IPAddress -t TopDir  

[-a Aliases -u IM | NT | External -x MaxMBXSize -s MaxMBXMsgs -r MaxUsers]

adddomain -h Hostname -m

[-t TopDir -a Aliases -x MaxMBXSize -s MaxMBXMsgs -r MaxUsers]

adddomain -h Hostname -i IPAddress -t TopDir -u External

[-e DLLFilename -o ODBC_DSN -n TableName]

adddomain -h Hostname -delete

adddomain -f Filename

Examples:

  1. In the following example, since the -e, -o,or -n options are not specified, the external database relies on the default “values %“Imail_top dir”%odbcuser.dll , IMAILSECDB, and [default] accordingly:

    adddomain -h newhost1 -i virtual -u external

  2. The following command populates an external database with settings of C:\mydll.dll, IMAILSECDB, and [default]:

    adddomain -h newhost2 -i virtual -u external -e C:\mydll.dll

  3. The following example changes an existing host (notice the -m for modify) to use an ODBC Data Source Name (DSN) of MyNewDSN. If the other fields of -e and -n were previously set, they will be preserved. If the other fields of -e and -n were not previously set, they will be set with the default values:

    adddomain -h ExistingHost -m -u external -o MyNewDSN

    Note: The -e, -o, and -n commands must be used in conjunction with -u EXTERNAL.

  4. If you need to specify a DSN other than ‘IMailSecDB,’ or you need to specify a userID and password (required when setting up a DSN to connect to an SQL database), use the -o switch :

    adddomain -h ExistingHost -m -u external -o IMailSecDB;UID=MyUser;

    PWD=MyPassword

  5. The following example shows how to add a new virtual host (or virtual host with an IP ) using an external database:

    adddomain -u external -t C:\IMail\newdomain_com -i virtual

    -o IMailSecDB;UID=sqluser;PWD=sqlpassword -n table_name

  6. Adddomain.exe supports the following command line options:

Command

Function

-h

Fully qualified host name; must match the IMail official host name

-i

IP address or virtual IP address for an IP-less host

-t

Path (full or relative) to the top directory for the domain

-m

Command to modify existing settings instead of creating new ones

-a

Alias list for a host

-u

User data base to use (IMail, NT, or external)

-e

Path to external database implementation DLL

-o

External database ODBC system Data Source Name (DSN )

-n

External database table name

-x

Default max mailbox size (in kbytes).

-s

Default max number of messages for mailbox.

-f

Path to the file containing the settings to modify

-r

Maximum number of users allowed on this host.

-delete

Removes the virtual host.

Note:  AddDomain.exe does not warn when assigning already claimed IP addresses to new hosts. Assigning an already used IP address to another host will orphan the original host without warning.