summaryrefslogtreecommitdiff
path: root/static/unix-v10/man8/upas.8
blob: 8cf496bdb300b9a8b1756de85b8cf140a12a7a5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
.TH UPAS 8
.CT 1 sa_auto sa_mortals
.SH NAME 
upas, rmail, translate \- mail delivery system
.SH SYNOPSIS
.B rmail
.I person ...
.PP
.B /usr/lib/upas/translate
.I name
.PP
.B /usr/lib/upas/auth
.I sender
.I receiver
.SH DESCRIPTION
Users send mail by
.IR mail (1).
Remote machines use
.I rmail.
Both call on
.I upas
programs.
.PP
Mail addresses are interpreted
according to rewrite rules as
described below.
When the addresses for a
.I mail
or
.I rmail 
command have been interpreted, they are bundled by
network and passed to network-specific handlers,
such as
.IR route.inet .
.PP
.I Translate
looks up a mail
.I name
in an alias list (see
.IR mail (6))
and places the result on standard output.
.PP
.I Auth
is called by
.I upas
to authorize mail delivery for each
.I sender, receiver
pair.
The mail is accepted if
the previous hop was a trusted gateway machine in
.FR /usr/lib/upas/gateways ,
or all the machines in the source or destination path are in 
.FR /usr/lib/upas/attlist .
.SS Rewrite rules
Each line of the file 
.F /usr/lib/upas/rewrite
is a rule.
Blank lines and lines beginning with
.B #
are ignored.
.PP
Each rewriting rule consists of (up to) 4 strings:
.TP
.I pattern
A regular expression in the style of
.IR regexp (3).
The
.I pattern
is applied to mail destination addresses.
The pattern match is case-insensitive
and must match the entire address.
.TP
.I type
The type of rule; see below.
.TP
.I arg1
An
.IR ed (1)
style replacement string, with
.BI \e n
standing for the text matched by the
.IR n th
parenthesized subpattern.
.TP
.I arg2
Another
.IR ed (1)
style replacement string.
.PP
In each of these fields the substring
.L \es
is replaced by the login id of the
sender and the substring
.L \el
is replaced by the name of the local machine.
.PP
When delivering a message,
.I mail
starts with the first rule and continues down the list until a pattern
matches the destination address.
It then performs one of the following actions depending on rule type:
.PD 0
.TP
.B >>
Append the mail to the file indicated by expanding
.IR arg1 ,
provided that file appears to be a valid mailbox.
.TP
.B |
Pipe the mail through the command formed from concatenating the
expanded
.I arg1
and
.I arg2.
.TP
.B alias
Replace the address by the address(es) specified
by expanding
.I arg1
and recur.
.TP
.B translate
Replace the address by the address(es) output by the
command formed by expanding
.I arg1
and recur.
.TP
.B auth
Call the program in expanded
.I arg1
and authorize(reject) the mail if it returns a zero(non-zero) return code.
.PD
.PP
.I Mail
expands the addresses recursively until each address has matched a
.L >>
or
.L |
rule or until the recursion depth indicates a rewriting loop
(currently 32).
.PP
An 
.L auth
operator is only applied once per address.
If no 
.L auth 
rule is encountered, the mail is accepted.
.PP
If several addresses match
.L |
rules and result in the same
expanded
.IR arg1 ,
the message is delivered to all those addresses
by a single command,
composed by concatenating the common
expanded
.I arg1
and each expanded
.IR arg2 .
This is meant to make less work of
a message to several recipients on the same machine.
For example, the rule
.IP
.L
([^!]+)!(.+)   |   "uux - -a \\s \\1!rmail"   \\2
.LP
causes
.L mail r70!pjw r70!ken
to generate the single delivery command
.LR "uux -a rob r70!rmail pjw ken" .
.SH EXAMPLES
A sample rewrite file:
.PP
.EX
.ta \w'([^!]+)[%@]([^!@%]+) 'u +\w'alias  'u
# local mail
[^!@%]+	translate  "exec translate '&'"
local!([^!@%]+)	>>	/usr/spool/mail/\e1
\el!(.+)	alias	\e1	
.EE
.PP
.EX
# convert %@ format to ! format
(_822_)!((.+)!)?([^!]+)[%@]([^!%@]+)  \e
	alias	\e1!\e2\e5!\e4
([^!]+)[%@]([^!@%]+)	alias	_822_!\e2!\e1
_822_!(.+)	alias	\e1	
.EE
.PP
.EX
# special domains
[^!]+wisc\e.edu!.+	alias	xunet!&	
.EE
.PP
.EX
# network gateways
(csnet|bitnet)!(.+)	alias	inet!&
acsnet!.+
.EE
.PP
.EX
# real networks
inet!([^!]+)!(.+)	|	"/usr/lib/upas/route.inet '\es' '\e1'" "'\e2'"
([^!]+)!(.+)	|	"/usr/lib/upas/route '\es' '\e1'" "'\e2'"
.EE
.PP
.EX# anything else goes to research
.*	alias	research!&
.EE
.SH FILES
.TF /n/bowell/usr/lib/upas/mkfile
.TP
.F /usr/lib/upas/namefiles
list of files to search
.TP
.F $HOME/lib/names
private aliases
.TP
.F /usr/lib/upas/rewrite
rewriting rules
.TP
.F /usr/lib/upas/attlist
known AT&T machines
.TP
.F /usr/lib/upas/gateways
machines that check mail authorization reliably
.TP
.F /usr/lib/upas/translate
alias lookup
.TP
.F /usr/lib/upas/route.*
mail interfaces to specific networks
.TP
.F /usr/lib/upas/route
interface to local (i.e. AT&T) Datakit network
.TP
.F /bin/mail
shell file that calls the mailer
.TP
.F /usr/lib/upas/send
actually delivery program
.TP
.F /bin/rmail
linked to /usr/lib/upas/send
.TP
.F /usr/spool/mail/*
mailboxes
.TP
.F /usr/spool/mail/mail.log*
delivery logs
.TP
.F /n/bowell/usr/lib/upas/mkfile
updates various mail and uucp files
.TP
.F /etc/passwd
authentication
.TP
.F /tmp/ma*
temp file
.TP
.F /tmp/ml*
lock file
.TP
.F $HOME/dead.letter
unmailable text
.SH "SEE ALSO"
.IR uucp (1), 
.IR mail (1), 
.IR mail (6),
.IR smtp (8)
.br
D. L. Presotto and W. R. Cheswick,
`Upas\(ema simpler approach to network mail',
this manual, Volume\ 2