E-mail
All user email boxes reside in the /var/mail directory by default. The system automatically creates email boxes for
account users. If no other email routing settings (such as aliases or virtmaps) are configured, by default the username
of each user functions as a valid email for all domains that resolve to the account. For example, if domain1.com and
domain2.com resolve to the account, for the user bob, both bob@domain1.com and bob@domain2.com would deliver email to
the /var/mail/bob email box. The system checks for matches in email routing and addresses in the following order and
delivers to the first match it finds:
This section discusses virtmap, catchall, and alias configurations.
To edit the virtmaps and aliases files, you must be the root user. You can become the root user by typing su at the
command line and supplying the root user password.
Virtmaps
Virtmaps route the full email address (both sides of the "@") to a local user, alias, or remote email address, but
cannot map to files or programs. Only aliases can route email to a file or program. A virtmap consists of the virtmap
and its destination, or mapping. For example, a virtmap for bob@domain1.com could be mapped to the user bob with the
following virtmap entry:
bob@domain1.com bob
Virtmaps allow you to create email addresses without the need to create a corresponding user. For example, a virtmap
for bob@domain2.com could be mapped to bob@remotedomain.com with the following virtmap entry:
bob@domain2.com bob@remotedomain.com
Specify virtmaps in the /etc/mail/virtusertable file, with one virtmap entry per line. The virtusertable.sample file
provided with each account contains example virtmaps. You can change virtmap settings by editing the virtusertable file
and then executing the vnewvirtmaps command from the command prompt to load the virtmaps into the system.
Catchalls
Catchall virtmaps should be used sparingly. Spammers often send many emails to every conceivable address for a domain,
often numbering in the thousands. A catchall virtmap would cause the system to receive all of these emails and map them
to the recipient.
A catchall virtmap maps all email not otherwise configured with a virtmap for a given domain to a single recipient. For
example, the following catchall virtmap would map all email not configured with another virtmap for the domain company.com
to the joe user:
@company.com joe
If no virtmap exists for an email address, and a catchall virtmap is configured for the domain, the system would route
all email sent to that address to the catchall virtmap.
Aliases
Email aliases simply forward email to a user, alias, email address, list of addresses, file, or program. Aliases allow
you to create email addresses without the need to create a corresponding user. For example, the following alias would
forward email sent to webmaster@domain.com to the stan user:
webmaster: stan
Aliases also allow you to send email to a list or to a program. For example, the following alias would forward email
sent to sales@corporation.com to the bob, joe, and stan users:
sales: bob,joe,stan
For long email lists, place the emails in a file, one address per line, and use the include option. For example, the
following alias would forward email sent to promotion@website.com to all addresses in the /lists/promotion file:
promotion: :include: /lists/promotion
Specify aliases in the /etc/mail/aliases file, with one alias per line. You configure the aliases by editing the
aliases file according to your needs. After making changes to the file, execute the vnewaliases command from the
command prompt to load the aliases into the system.
The system only considers the first portion of the email address (before "@") for aliases. To map an entire email
address to a certain recipient, use a virtmap.

|