Chapter 3. Mail Administration

Table of Contents
3.1. Managing Mail Domains
3.1.1. About Mail Domains
3.1.2. Configuring Mail Domains
3.1.3. Configuring Virtual Domains
3.2. Managing Mail Users
3.2.1. View Users
3.2.2. Find User
3.2.3. Create User
3.2.4. Delete User
3.3. Managing Mail Aliases
3.3.1. View Aliases
3.3.2. Find Aliases
3.3.3. Create Aliases
3.3.4. Delete Aliases
3.4. Backup and Restore
3.4.1. Backing Up the Messaging Server
3.4.2. Restoring Accidently Deleted Email
3.5. Mail Directory Recovery
3.5.1. Reconstructing Mailbox Directories
3.5.2. Reconstructing Quota Roots
3.5.3. Restoring the Mailbox List Database
3.5.4. Restoring Subscription Files

3.1. Managing Mail Domains

3.1.1. About Mail Domains

A mail domain is a name used for mail delivery that describes the site where a computer is located and generally includes the machine (host) name, a department (optionally), and the site's organization or country. In its default configuration, a system has exactly one IP address associated with each network interface and it has exactly one system name, which is also used as the mail domain name.

The default configuration for the Messaging Server assumes there is only one mail domain, with the same name as the system name, and one set of mail users who are addressed to that system name. This is sufficient for most simple mail systems.

The Messaging Server also enables virtual domains. You can create virtual domains if you want multiple mail domains presented from a single mail server. Messaging Server mail domains can be either attached to actual physical network interfaces or they can be virtual. There is no difference in how you configure them using the Server Manager. The only requirement is that all mail users and mail aliases under that domain must have addresses which are qualified by the domain's name. For example, if you create a virtual domain "abc.com" and create a mail account under that mail domain, the corresponding user must have an address of the form "username@abc.com".

Note: Creating a mail domain in the Messaging Server does not configure a new network address nor does it configure DNS for the domain names. It only configures the mail system to accept mail addressed to that mail domain. Network interfaces and name resolution can be managed efficiently with the Webmin interface; see the Caldera OpenLinux System Administration Guide for more information.

3.1.2. Configuring Mail Domains

In the Server Manager, click on these buttons in the Domains menu to:

View Domains 

Lists the mail domains controlled by the Messaging Server.

Create Domain 

Enter a mail domain name and description.

Delete Domain 

Deletes the domain names you select.

The Messaging Server supports multiple mail domains, with user and alias lists displayed in per-domain views. To switch to a different domain, select it from the Domain box in the upper right of the screen.

3.1.3. Configuring Virtual Domains

Before configuring the Messaging Server for virtual domains, you must create mail exchanger (MX) records in DNS to resolve virtual domain names to the Messaging Server host machine. To update DNS, use the Webmin DNS/Bind Server Module as described in "Creating a Mail Exchanger Record" in the Caldera OpenLinux System Administration Guide.

You can then create mail domains with the Server Manager using the new virtual domain names.

3.2. Managing Mail Users

You can create and modify mail accounts for users who receive mail on the Messaging Server. The email account includes:

Note: If you have large numbers of users or aliases on your Messaging Server, it may take some time to load the View displays, and these displays may occupy many screens.

Postfix requires (as do most MTAs under requirement by RFC822) that an account for "postmaster" exists so that messages to the address "postmaster@host.domain" can be delivered successfully. Typically, the postmaster receives any error messages generated by Postfix. The postmaster mail alias is created automatically during installation with the "admin" administrator account as its sole member. This alias should not be deleted from the server.

Although a postmaster alias is configured by default in the default Messaging Server domain, it is not created automatically when you create new domains. You should therefore configure an alias for the address "postmaster@host.newdomain" that can be delivered successfully to a destination of your choice. For more information, see "Managing Mail Aliases"; make sure you set the the Domain selection box to the new domain.

See also "Managing global user access privileges".

Use the Server Manager to enter and modify mail account information. In the Users menu, click on:

3.2.1. View Users

List all users in the selected mail domain, sorted by User ID. Clicking on the User ID link displays the user's complete account information. From this display you can take these User Actions:

  • Modify the listed settings

  • change the admin or user's Password. You can also change the admin password by clicking on Admin Password under the System menu in the Server Manager.

  • view Aliases to which the user is subscribed

  • Delete this user

3.2.2. Find User

Search for a user in the selected mail domain. You can enter a full or partial word to be found in the User ID or any of the Name fields. Click on the User ID links in the search results to display user information and take User Actions.

3.2.3. Create User

Create a new user. Required entries are marked with asterisks "*"; on some browsers, optional entries are displayed when you click on More.

*User ID 

An identification name for the user which is unique for the entire messaging server (unique across all mail domains). This is the name with which the user will authenticate for IMAP or POP access. Example: joes.

Note: This name cannot be the the same as any system user name.

First Name 

The first name of the user (example: "Joe").

Last Name 

The last name of the user (example: "Smith").

Note: A Display Name is created by default in the View Users menu from the first and last names.

*Mail address 

The primary Internet email address for the user. The mail domain is automatically set to the domain listed in the Server Manager toolbar. The name used here does not have to be the same as the User ID.

*Password 

The user's password used to authenticate for IMAP/POP/LDAP access. You must confirm the password you entered.

Work Phone 

The business phone number of the user.

Mobile Phone 

The mobile phone number of the user.

Home Phone 

The home phone number of the user.

Pager 

The pager number of the user.

FAX 

The facsimile telephone number of the user.

Title 

The job title for the user.

Office Location 

The physical delivery office name for the user.

Alternate Mail 

An alternate email address for the user. The email address must be qualified with the name of the mail domain under which the user resides, which is automatically set to the domain listed in the Server Manager toolbar.

Note: This field can only be modified using the Server Manager; users cannot do so.

Forward Mail To: 

An email address to which to forward all the user's email.

When you have entered all required and optional information, click on Create to enter the new user account information.

3.2.4. Delete User

Select a User ID to delete. When you click on Select, all the associated user information is erased from the LDAP database. You can also delete users from the View Users display.

Caution

If you delete a user who is the last owner or member of an alias, the alias will be silently deleted. Before removing a user, we recommend that you see check their aliases; to do so, click on Aliases in their View User display. For this reason, we also recommend that every alias have at least two owners, and that important aliases also include the admin user as an owner or member.

You cannot delete the admin user.

3.3. Managing Mail Aliases

You can create and modify mail aliases on the Messaging Server. Mail aliases allow you to:

Note: If you have large numbers of users or aliases on your Messaging Server, it may take some time to load the View displays, and these displays may occupy many screens.

Use the Server Manager to enter and modify mail alias information. In the Aliases menu, click on:

3.3.1. View Aliases

Lists all aliases in the selected mail domain, sorted by Alias. Clicking on the Alias link displays the complete alias information. From this display you can take these Alias Actions:

  • Modify the Description and Membership settings

  • add or remove alias Members; enter names or Browse user and alias lists

  • add or remove alias Owners

  • specify Programs/Files for the alias

  • Delete this alias

Caution

If you delete a user who is the last owner or member of an alias, the alias will be silently deleted. Before removing a user, we recommend that you see check their aliases; to do so, click on Aliases in their View User display. For this reason, we also recommend that every alias have at least two owners, and that important aliases also include the admin user as an owner or member.

3.3.2. Find Aliases

Search for an alias in the selected mail domain. You can enter a full or partial word to be found in the Alias or Name fields. Click on the Alias links in the search results to display alias information and take Alias Actions.

3.3.3. Create Aliases

Create a new alias. Required entries are marked with asterisks "*"; on some browsers, optional entries are displayed when you click on More.

*Alias 

An identification name for the alias which is unique for the entire messaging server (unique across all mail domains), appended with the name of the mail domain under which the alias resides. This mail domain is automatically set to the domain listed in the Server Manager toolbar.

Description 

The description of the mail alias. Example: "The Company Glee Club".

*Owner 

The email address(es) of owner(s) of the alias; there must always be at least one owner. By default, the user that creates an alias is automatically listed as an owner and a member, but this default does not apply to admin users, who must explicity add themselves as owners or members if desired. Multiple owners are permitted, each of whom have the ability to modify alias attributes, add and remove owners, and delete the alias. Only existing owners can add or remove other owners; if an alias is restricted, only owners can add or remove members.

Note: We recommend that every alias have at least two owners, and that important aliases also include the admin user as an owner or member.

Membership 

Radio buttons indicating whether the alias is Open or Restricted; the default is Open. Users can add or remove themselves to or from an Open alias, but a user cannot add or remove others from an Open alias unless that user is also an owner. To add or remove themselves to or from Restricted aliases, users must ask an owner.

*Alias Member(s) 

The email address(es) of members of the alias. At least one member must be added, in a comma-separated list. Members can be entered as:

  • User IDs (if in the current mail domain ).

  • aliases (if in the current mail domain ). A mail alias can contain the names of other aliases.

  • complete email addresses (if in a different mail domain).

In addition to manually entering individual names, you can also click on Browse to view lists of users and aliases in the current domain. To add a user or alias to the new alias, click on the plus sign (+) in Add column, and the user name will be added in the Create Aliases screen. Close the Browse window when you have finished selecting new members.

Append File 

The path of a file on the system to which mail to this alias will be appended. This file must conform to Postfix specifications for the /file/name value in alias database input files; see the Postfix aliases(5) manual page for further information. Mail cannot be appended to files owned by root. Only the admin user can set this attribute.

Pipe Program 

A program through which to pipe a message sent to the alias. This command must conform to Postfix specifications for the |command value in alias database input files; see the Postfix aliases(5) manual page for more information. Only the admin user can set this attribute.

Caution

If used improperly, setting the Append File and Pipe Program options can cause serious system problems, such as filesystem overruns and security breaches.

When you have entered all required and optional information, click on Create to enter the new alias information.

3.3.4. Delete Aliases

Select an Alias to delete. You can also delete users from the View Aliases display.

3.4. Backup and Restore

3.4.1. Backing Up the Messaging Server

To protect users against accidental file deletion and catastrophic system failures, backups of the Messaging Server should be performed regularly. Particular care should be taken to make regular (and multiple) backups of the file /var/imap/mailboxes.db. See the discussion under "Mail Directory Recovery" below for more information.

Linux backup utilities such as tar(1), cpio(1L), and afio(1) may be used to backup and restore the Messaging Server. Commercial backup products are also available, which offer many additional features including faster restore. The current list of supported backup products can be found in the Late News document on the Messaging Server documentation website:

http://www.caldera.com/support/docs/volution/msg

Caution

To avoid synchronization problems, we recommend that you disable the cyrus service while performing the critical backup of the mailboxes.db file. The cyrus service can be stopped and restarted using the Server Manager or from the command line with the /etc/rc.d/init.d/cyrus script.

3.4.2. Restoring Accidently Deleted Email

To restore a specific user's email, simply restore the contents of the directory /var/spool/imap/user/UserID, where UserID is the Messaging Server unique identifier for that user. After restoring the directory, you must run the command:

su cyrus -c /usr/cyrus/bin/reconstruct

This will inform the Messaging Server that old email has been restored and should now made visible to users.

See also the reconstruct(8) manual pages.

3.5. Mail Directory Recovery

This section describes how to perform disaster recovery on the various databases used by the Cyrus IMAP component of the Messaging Server. Inconsistencies can occur in these databases in the event of an unforseen event such as a system crash.

Should a mail system failure occur, first view the log files and try to determine what went wrong. Of particular interest are the files:

The Messaging Server provides special tools needed to recover the IMAP databases. All of the tools described below can be found in the /usr/cyrus/bin/.

3.5.1. Reconstructing Mailbox Directories

The largest databases in the Messaging Server are stored in mailbox directories. By default the Messaging Server mailbox directories are found under /var/spool/imap/user/user_name.

Each mailbox directory contains message files. There is one message file for each message stored on the IMAP server. The name of each message consists of the message's unique identifier number, followed by a dot (.).

In addition to the message files, each mailbox directory also may contain the files cyrus.header, cyrus.index, cyrus.cache, and cyrus.seen. Each of these files contains additional information about the mailbox which is used by the Cyrus IMAP server.

The reconstruct utility is used to recover from mailbox directory corruption. An administrator can recover from a damaged disk by restoring message files from a backup and running the reconstruct command to regenerate what it can of the other files. By default, reconstruct acts on all of the mailbox directories on the system. After running reconstruct, you should also run quota -f as described below.

See also the reconstruct(8) and quota(8) manual pages.

3.5.2. Reconstructing Quota Roots

The quota subdirectory is found by default on the Messaging Server as /var/imap/quota/. This directory contains one file per quota root, with the file name being the name of the quota root. These files store the quota usage and limits of each of the quota roots. For more information, see "Setting Cyrus Mailbox Quotas".

The quota program, when invoked with the -f switch, recalculates the quota root of each mailbox and the quota usage of each quota root.

You may wish to remove a quota root. To do so, remove the quota root's file, then run quota -f to make the quota files consistent again.

See also the quota(8) manual page.

3.5.3. Restoring the Mailbox List Database

The mailboxes file, /var/imap/mailboxes.db, is the most critical file in the Cyrus IMAP system. It contains a sorted list of each mailbox on the server, along with the mailboxes quota root and ACL. The command ctl_mboxlist -r can be used to restore a mailboxe's database file if it becomes corrupt. Should that fail, a copy of the mailboxes.db file is saved in the /var/opt/lsb-caldera.com-volution/msg/ directory every time a cyrus mailbox is created, deleted, or modified by any of the Messaging Server tools. Should all else fail, you may restore this copy to the /var/imap directory and run ctl_mboxlist -r.

See also the ctl_mboxlist(8) manual page.

3.5.4. Restoring Subscription Files

The subdirectory /var/imap/user of the configuration directory contains user subscriptions. There is one file per user, with a filename of the userid followed by the suffix .sub. Each file contains a sorted list of subscribed mailboxes.

There is no program to recover from damaged subscription files. You may recover from lost files simply by restoring from backups.