ALIAS DISTRIBUTION IN CK:P

This document describes the setup and administration of aliases within the CKP project. It is designed to be read by system administrators. This document will only describe how the aliases are moved from one system to another. Later documents will describe how aliases are created and maintained.


Overview

Alias, in this instance, refer to the use of mail aliases. A mail alias is a way of routing mail so that mail sent to an aliased host (i.e. foo.com) is actually to another mail server (i.e. foo.pgh.pa.us). This provides a coherent mail addressing system for users within a domain. In the case of CK:P staff, faculty and students can receive mail at username@pps.pgh.pa.us. With the use of the alias file this mail is sent to the mail server at their site.

The goal of CK:P's alias distribution method is to have (mostly) identical alias files on each CKP host. This is done by the use of a Perl script aliasbuild which runs daily at 2:15am. The script aliasbuild looks in the file /etc/aliases.cfg for configuration information and instructions.

aliasbuild will write a new aliases file each time it is run. It builds the aliases file by merging the contents of several files specified in the configuration file.

Format of /etc/aliases.cfg

The configuration file for aliasbuild contains a series of options, one per line. Options start in the first column. An option can extend over multiple lines by ending a line with a bashslash (\). The backslash, newline and indenting whitespace are all replaced by a single space. Words in each command are separated by any amount of whitespace.

Blank lines and lines beginning with hashes (#) are ignored.

Valid commands are:

file FILENAME COMMAND 
	FILENAME is a file to include in the final aliases file. 
COMMAND is optional; if present it gives a (multi-word) command 
which will be interpreted by the c-shell. The command must 
generate the given FILENAME. COMMAND may contain colons (;) 
to execute multiple commands. 
aliases FILENAME 
	FILENAME is the name of the aliases file used by sendmail. 
It defaults to /etc/aliases (note that as shipped Digital Unix 
requires /var/ads/sendmail/aliases). 
newaliases COMMAND 
	This specifies a command which will rebuild the aliases 
database from the aliases file. The default is 
/usr/lib/sendmail -bi; NetBSD has sendmail in /usr/sbin. 
dir DIRNAME 
	DIRNAME is the directory name (default /var/aliases) 
used by aliasbuild to store files between invocations. This 
directory must be created before aliasbuild is run for 
the first time. 

Distribution of alias files

The alias files are distributed via HTTP (the protocol used by WWW servers). There is a Perl program /usr/local/bin/httpget which will gets the specifiied file from a WWW server. The syntax is:
httpget URL destinationfilename
The files are on www.pps.pgh.pa.us in /system. Thus:
httpget http://www.pps.pgh.pa.us/system/aliases.user /tmp/aliases.user
will get a file and put it in /tmp.

A sample aliases.cfg file

dir /var/aliases 
newaliases /usr/sbin/sendmail -bi 
file /etc/aliases.local file /tmp/aliases.user/usr/local/bin/httpget \
     http://www.pps.pgh.pa.us/system/aliases.user /tmp/aliases.user 
file /tmp/aliases.list/usr/local/bin/httpget\
     http://www.pps.pgh.pa.us/system/aliases.list /tmp/aliases.list 

Safety

Whenever aliasbuild runs a command to get a file, it caches that file in /var/aliases. If at some point in the future aliasbuild fails it will use the last cached file. The last cached file may be out of date, but it is better than not updating /etc/aliases at all or merging empty files into /etc/aliases. This protects against failures due to the network being down and some failures caused WWW server.

If one machine is updated and another is not (due to network problems), a mail loop may be created. There is no good solution to this; presumably the mail loop will be resolved at the next update.

Bugs

All of the servers access the WWW server at the same time. This can cause a significant problem with overloading. A better solution would be to turn off all sendmail processes prior to the alias update time, randomly assign each server an access time over a ten minute span, and then restart the sendmail processes afterwards.

The syntax of aliases.cfg is not as readable as it could be. Being that many of the commands are longer than 80 characters it can often be difficult to follow the flow of a command line. The option names are not intuitive or very descriptive.

 

Return to CK:P Internal Documents

 

Revision 1.1:April 29, 1996:CJR