home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.muug.mb.ca
/
2014.06.ftp.muug.mb.ca.tar
/
ftp.muug.mb.ca
/
pub
/
src
/
autoalias.shar
/
README
< prev
Wrap
Text File
|
1993-09-20
|
2KB
|
47 lines
This archive contains stuff related to sendmail aliases.
The nameptx program, used by the addaliases script, is based on
nptx.c from the smail 2.5 source distribution. The script generates
the /etc/aliases file and automatically makes full name aliases
from the names in the YP passwd file. It's smart enough to prevent
someone's last name from overriding someone else's user ID, but it
will still allow some ambiguous aliases through.
E.g. If smi01 is Tim Smith and smith is Tom Smith, it won't alias
smith to smi01, but it will alias t.smith to smi01 (even though it
could just as well apply to smith, i.e. Tom Smith.) If there is
no user ID smith, then smith will be aliased to the first user ID
alphabetically (actually by ASCII sort), whose owner's last name
is Smith.
Files included are:
README - You're looking at it
addaliases - script to generate new /etc/aliases
aliases.sample - sample /etc/aliases file, if you have none
nameptx.c - source code for /usr/local/bin/nameptx
The addaliases script will have to be customized for your site.
Edit the definitions at the start of the script, as appropriate.
The nameptx program should compile in a straightforward manner on
most systems. (Usually, "cc -O -o nameptx nameptx.c" will do it.)
Read the comments for more details.
Use the sample aliases file for ideas on how to set up your own
file.
To get addaliases to delete ambiguous records altogether, replace
the lines:
sort | sort -mu +0 -1 | # sort 1st by whole record,
# so priority code recognized
with:
# Remove all ambiguous/duplicate name permutations
sort -u | awk '$1 != key && rec != "" { print rec }
$1 == key { rec = "" }
$1 != key { key = $1; rec = $0 }
END { if (rec != "") print rec }' |