Auto-install

tmda-cgi is now capable of autoinstalling TMDA on user accounts.

TMDA must already be installed on the server.

This feature does not install TMDA, but configures an already existing e-mail account so it will work with TMDA.

To use this feature, the user need only log in to tmda-cgi (program or remote authentication is strongly recommended if you wish to use auto-install) and click "Sign up." However, the system administrator will need to verify how the installation will be done beforehand!

skel
anomalies
   PERMISSIONS
   VIRTUAL_TEST
   REAL_ONLY
   VIRTUAL_ONLY

skel

Before allowing users to auto-install or auto-uninstall, carefully check over each file in the skel/install directory. These files will be copied to the user's directory upon installation.

Important note: The skel directories included with tmda-cgi were designed for servers running qmail. If you use a different mail server package, do not use the files as-is! You should look through these files and see how they work, but you will need to create a totally different set of skel files.

skel files allow for variable substitution. All of the following text strings, if found in the file or filename, will be replaced with the following:

%(Base)s The path to TMDA's root directory.
%(CryptKey)s A new valid, random, cryptographic key.
%(Domain)s Best guess of the user's domain.
%(Home)s The path to the user's home directory.
%(Parent)s The constant string "..".
%(User)s The user's login name, or the left-most portion (before the "@") of the user's e-mail address in the case of virtual users.
%(VirtUser)d 1 if the user is a virtual user, 0 if the user is real.
%(VPop)s The path to the virtual user's home directory (for example: /home/vpopmail).
%(VPopBin)s The path to the virtual user's bin directory (for example: /home/vpopmail/bin).

If you need to put a "%" in one of the skel files, you will have to type "%%" instead. This will prevent errors during the install process.

In addition to a skel/install directory, there is also a skel/uninstall directory. If you have any files which should be installed after the uninstall process is complete, you may place skeletons for them files here. For example, qmail users should add a .qmail-default file after uninstallation so that any future mail that comes in for a tagged address will still be accepted.

anomalies

skel directories may optionally have a file called anomalies. This file contains Python code which tells the installer/uninstaller what it should do beyond simply copying the files to the user's directory.

anomalies supports the following variables:

PERMISSIONS

A dictionary of filenames and what octal permissions should be assigned to them.

Install example:
PERMISSIONS = {".tmda/crypt_key": 0600}

VIRTUAL_TEST

A regular expression test which can be applied to a user's HOME directory. If the test matches, then the user is assumed to be a virtual user.

Example:
VIRTUAL_TEST = "^/home/vpopmail/domains/"

REAL_ONLY

A list of files which should only be copied if the user logging in is "real" (i.e. VIRTUAL_TEST did not match the user's HOME directory).

Install example:
REAL_ONLY = [".qmail", ".qmail-default"]

Uninstall example:
REAL_ONLY = [".qmail-default"]

VIRTUAL_ONLY

A list of files which should only be copied if the user logging in is a virtual user (i.e. VIRTUAL_TEST matched the user's HOME directory).

Install example:
VIRTUAL_ONLY = ["%(Parent)s/.qmail-%(User)s",
  "%(Parent)s/.qmail-%(User)s-default"]

Uninstall example:
VIRTUAL_ONLY = ["%(Parent)s/.qmail-%(User)s-default"]