1MH-ALIAS(5)                  [nmh-1.2-20070115cvs]                 MH-ALIAS(5)
2
3
4

NAME

6       mh-alias - alias file for nmh message system
7

SYNOPSIS

9       any nmh command
10

DESCRIPTION

12       This  describes both nmh personal alias files and the global alias file
13       for nmh mail delivery, the file
14
15            /etc/nmh/MailAliases
16
17       It does not describe aliases files used by the message  transport  sys‐
18       tem.  Each line of the alias file has the format:
19
20            alias : address-group
21       or
22            alias ; address-group
23       or
24            < alias-file
25       or
26            ; comment
27
28       where:
29
30            address-group  := address-list
31                           |  < file
32                           |  = UNIX-group
33                           |  + UNIX-group
34                           |  *
35
36            address-list   := address
37                           |  address-list, address
38
39       Continuation  lines in alias files end with `\' followed by the newline
40       character.
41
42Alias-file” and “file” are UNIX file names.   UNIX-group  is  a  group
43       name  (or  number)  from  /etc/group.   An address is a “simple” Inter‐
44       net-style address.  Througout this file, case is  ignored,  except  for
45       file names.
46
47       If  the  line  starts  with a `<', then the file named after the `<' is
48       read for more alias definitions.  The reading is done recursively, so a
49       `<'  may  occur  in  the  beginning  of an alias file with the expected
50       results.
51
52       If the address-group starts with a `<', then the file named  after  the
53       `<'  is  read  and  its  contents are added to the address-list for the
54       alias.
55
56       If the address-group starts with an `=', then the  file  /etc/group  is
57       consulted  for  the  UNIX-group  named  after the `='.  Each login name
58       occurring as a member of the group is added to the address-list for the
59       alias.
60
61       In  contrast,  if  the  address-group  starts with a `+', then the file
62       /etc/group is consulted to determine the  group-id  of  the  UNIX-group
63       named after the `+'.  Each login name occurring in the /etc/passwd file
64       whose group-id is indicated by this group is added to the  address-list
65       for the alias.
66
67       If  the  address-group is simply `*', then the file /etc/passwd is con‐
68       sulted and all login names with a userid greater than some magic number
69       (usually 200) are added to the address-list for the alias.
70
71       In  match,  a  trailing  “*” on an alias will match just about anything
72       appropriate.  (See example below.)
73
74       An approximation of the way aliases are resolved  at  posting  time  is
75       (it's not really done this way):
76
77         1) Build  a  list  of all addresses from the message to be delivered,
78            eliminating duplicate addresses.
79
80         2) If this draft  originated  on  the  local  host,  then  for  those
81            addresses  in  the  message  that  have no host specified, perform
82            alias resolution.
83
84         3) For each line in the alias file, compare “alias”  against  all  of
85            the  existing  addresses.   If a match, remove the matched “alias”
86            from  the  address  list,  and  add  each  new  address   in   the
87            address-group  to  the  address  list  if it is not already on the
88            list.   The  alias  itself  is  not  usually  output,  rather  the
89            address-group  that  the  alias  maps  to  is  output instead.  If
90            “alias” is terminated with a `;' instead of a `:', then  both  the
91            “alias”  and  the address are output in the correct format.  (This
92            makes replies possible since nmh aliases and personal aliases  are
93            unknown to the mail transport system.)
94
95       Since the alias file is read line by line, forward references work, but
96       backward references are not recognized, thus, there is no recursion.
97
98       Example Alias File:
99
100            </etc/nmh/BBoardAliases
101            sgroup: fred, fear, freida
102            b-people: Blind List: bill, betty;
103            fred: frated@UCI
104            UNIX-committee: <unix.aliases
105            staff: =staff
106            wheels: +wheel
107            everyone: *
108            news.*: news
109
110       The first line says that more aliases should immediately be  read  from
111       the  file /etc/nmh/BBoardAliases.  Following this, “fred” is defined as
112       an alias for “frated@UCI”, and “sgroup” is defined as an alias for  the
113       three names “frated@UCI”, ”fear”, and ”freida”.
114
115       The  alias  “b-people”  is  a  blind  list which includes the addresses
116       “bill” and “betty”; the message will be delieved  to  those  addresses,
117       but  the  message  header  will   show  only  “Blind  List: ;” (not the
118       addresses).
119
120       Next, the definition of “UNIX-committee” is given by reading  the  file
121       unix.aliases  in  the  users  nmh  directory, “staff” is defined as all
122       users who are listed as members of the group “staff” in the  /etc/group
123       file,   and  “wheels”  is  defined  as  all  users  whose  group-id  in
124       /etc/passwd is equivalent to the “wheel” group.
125
126       Finally,  “everyone”  is  defined  as  all  users  with  a  user-id  in
127       /etc/passwd  greater  than 200, and all aliases of the form “news.<any‐
128       thing>” are defined to be “news”.
129
130       The key thing to understand about aliasing in nmh is  that  aliases  in
131       nmh alias files are expanded into the headers of messages posted.  This
132       aliasing occurs first, at posting time, without the  knowledge  of  the
133       message transport system.  In contrast, once the message transport sys‐
134       tem is given a message to deliver to a  list  of  addresses,  for  each
135       address  that  appears  to  be  local, a system-wide alias file is con‐
136       sulted.  These aliases are NOT expanded into the  headers  of  messages
137       delivered.
138
139

HELPFUL HINTS

141       To use aliasing in nmh quickly, do the following:
142
143         1) In  your  .mh_profile,  choose  a  name  for  your alias file, say
144aliases”, and add the line:
145
146              Aliasfile: aliases
147
148         2) Create the file “aliases” in your nmh directory.
149
150         3) Start adding aliases to your “aliases” file as appropriate.
151
152

FILES

154       /etc/nmh/MailAliases       global nmh alias file
155
156

PROFILE COMPONENTS

158       Aliasfile:           For a default alias file
159
160

SEE ALSO

162       ali(1), send(1), whom(1), group(5), passwd(5), conflict(8), post(8)
163
164

CONTEXT

166       None
167
168

BUGS

170       Although the forward-referencing semantics of  mh-alias  files  prevent
171       recursion,  the “< alias-file” command may defeat this.  Since the num‐
172       ber of file descriptors is finite (and  very  limited),  such  infinite
173       recursion will terminate with a meaningless diagnostic when all the fds
174       are used up.
175
176       Forward references do not work correctly inside blind lists.
177
178
179
180MH.6.8                            1 Jul 2003                       MH-ALIAS(5)
Impressum