source: trunk/third/nmh/man/mh-alias.man @ 12455

Revision 12455, 6.4 KB checked in by danw, 26 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r12454, which included commits to RCS files with non-trunk default branches.
Line 
1.\"
2.\" %nmhwarning%
3.\" $Id: mh-alias.man,v 1.1.1.1 1999-02-07 18:14:20 danw Exp $
4.\"
5.\" include the -mh macro file
6.so %etcdir%/tmac.h
7.\"
8.TH MH-ALIAS %manext5% MH.6.8 [%nmhversion%]
9.SH NAME
10mh-alias \- alias file for nmh message system
11.SH SYNOPSIS
12.in +.5i
13.ti -.5i
14any \fInmh\fR command
15.in -.5i
16.SH DESCRIPTION
17This describes both \fInmh\fR personal alias files and
18the global alias file for nmh mail delivery, the file
19
20        %etcdir%/MailAliases
21
22It does \fBnot\fR describe aliases files used by the message transport system.
23Each line of the alias file has the format:
24
25        alias : address\-group
26.br
27or
28.br
29        alias ; address\-group
30.br
31or
32.br
33        < alias\-file
34.br
35or
36.br
37        ; comment
38.br
39
40where:
41
42        address\-group  :=  address\-list
43.br
44                       |   \*(lq<\*(rq file
45.br
46                       |   \*(lq=\*(rq UNIX\-group
47.br
48                       |   \*(lq+\*(rq UNIX\-group
49.br
50                       |   \*(lq*\*(rq
51
52.br
53        address\-list   :=  address
54.br
55                       |   address\-list, address
56.br
57
58Continuation lines in alias files end with `\\' followed by the newline
59character.
60
61Alias\-file and file are UNIX file names.  UNIX\-group is a group name
62(or number) from \fI/etc/group\fR.  An address is a \*(lqsimple\*(rq
63Internet\-style address.  Througout this file, case is ignored, except
64for alias\-file names.
65
66If the line starts with a `<', then the file named after the `<' is
67read for more alias definitions.  The reading is done recursively, so a
68`<' may occur in the beginning of an alias file with the expected results.
69
70If the address\-group starts with a `<', then the file named after the
71`<' is read and its contents are added to the address\-list for the alias.
72
73If the address\-group starts with an `=', then the file \fI/etc/group\fR
74is consulted for the UNIX\-group named after the `='.  Each login name
75occurring as a member of the group is added to the address\-list for
76the alias.
77
78In contrast, if the address\-group starts with a `+', then the file
79\fI/etc/group\fR is consulted to determine the group\-id of the
80UNIX\-group named after the `+'.  Each login name occurring in the
81\fI/etc/passwd\fR file whose group\-id is indicated by this group is
82added to the address\-list for the alias.
83
84If the address\-group is simply `*', then the file \fI/etc/passwd\fR is
85consulted and all login names with a userid greater than some magic number
86(usually 200) are added to the address\-list for the alias.
87
88In match, a trailing * on an alias will match just about anything
89appropriate.  (See example below.)
90
91An approximation of the way aliases are resolved at posting time is
92(it's not really done this way):
93
94.in +.5i
951) Build a list of all addresses from the message to be delivered,
96eliminating duplicate addresses.
97
982) If this draft originated on the local host, then for those addresses in
99the message that have no host specified, perform alias resolution.
100
1013) For each line in the alias file, compare \*(lqalias\*(rq against all of
102the existing addresses.  If a match, remove the matched \*(lqalias\*(rq
103from the address list, and add each new address in the address\-group to
104the address list if it is not already on the list.  The alias itself is
105not usually output, rather the address\-group that the alias maps to is
106output instead.  If \*(lqalias\*(rq is terminated with a `;' instead of
107a `:', then both the \*(lqalias\*(rq and the address are output in the
108correct format.  (This makes replies possible since \fInmh\fR aliases
109and personal aliases are unknown to the mail transport system.)
110.in -.5i
111
112Since the alias file is read line by line, forward references work, but
113backward references are not recognized, thus, there is no recursion.
114
115.ne 10
116\fBExample:\fR
117.nf
118.in +.5i
119<%etcdir%/BBoardAliases
120sgroup: fred, fear, freida
121b-people: Blind List: bill, betty;
122fred: frated@UCI
123UNIX\-committee: <unix.aliases
124staff: =staff
125wheels: +wheel
126everyone: *
127news.*: news
128.in -.5i
129.fi
130
131The first line says that more aliases should immediately be read from
132the file \fI%etcdir%/BBoardAliases\fR.  Following this, \*(lqfred\*(rq
133is defined as an alias for \*(lqfrated@UCI\*(rq, and \*(lqsgroup\*(rq
134is defined as an alias for the three names \*(lqfrated@UCI\*(rq,
135\*(rqfear\*(rq, and \*(rqfreida\*(rq.
136.sp
137The alias \*(lqb-people\*(rq is a blind list which includes the addresses
138\*(lqbill\*(rq and \*(lqbetty\*(rq; the message will be delieved to those
139addresses, but the message header will  show only \*(lqBlind List: ;\*(rq
140(not the addresses).
141.sp
142Next, the definition of \*(lqUNIX\-committee\*(rq is given by
143reading the file \fIunix.aliases\fR in the users \fInmh\fR directory,
144\*(lqstaff\*(rq is defined as all users who are listed as members of the
145group \*(lqstaff\*(rq in the \fI/etc/group\fR file, and \*(lqwheels\*(rq
146is defined as all users whose group\-id in \fI/etc/passwd\fR is equivalent
147to the \*(lqwheel\*(rq group.
148.sp
149Finally, \*(lqeveryone\*(rq is defined as all users with a user\-id
150in \fI/etc/passwd\fR greater than 200, and all aliases of the form
151\*(lqnews.<anything>\*(rq are defined to be \*(lqnews\*(rq.
152
153The key thing to understand about aliasing in \fInmh\fR is that aliases
154in \fInmh\fR alias files are expanded into the headers of messages posted.
155This aliasing occurs first, at posting time, without the knowledge of the
156message transport system.  In contrast, once the message transport system
157is given a message to deliver to a list of addresses, for each address
158that appears to be local, a system\-wide alias file is consulted.  These
159aliases are \fBNOT\fR expanded into the headers of messages delivered.
160.Hh
161To use aliasing in \fInmh\fR quickly, do the following:
162
163.in +.5i
164First, in your \fI\&.mh\(ruprofile\fR, choose a name for your alias
165file, say \*(lqaliases\*(rq, and add the line:
166
167.nf
168.in +.5i
169Aliasfile: aliases
170.\" ali: \-alias aliases
171.\" send: \-alias aliases
172.\" whom: \-alias aliases
173.in -.5i
174.fi
175
176Second, create the file \*(lqaliases\*(rq in your \fInmh\fR directory.
177
178Third, start adding aliases to your \*(lqaliases\*(rq file as appropriate.
179.in -.5i
180.Fi
181^%etcdir%/MailAliases~^global nmh alias file
182.Pr
183^Aliasfile:~^For a default alias file
184.Sa
185ali(1), send(1), whom(1), group(5), passwd(5), conflict(8), post(8)
186.De
187None
188.Co
189None
190.Bu
191Although the forward-referencing semantics of \fImh\-alias\fR files
192prevent recursion, the \*(lq<\ alias\-file\*(rq command may defeat this.
193Since the number of file descriptors is finite (and very limited), such
194infinite recursion will terminate with a meaningless diagnostic when
195all the fds are used up.
196.sp
197Forward references do not work correctly inside blind lists.
198.En
Note: See TracBrowser for help on using the repository browser.