Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | # |
2 | # Sendmail | |
3 | # Copyright (c) 1983 Eric P. Allman | |
4 | # Berkeley, California | |
5 | # | |
6 | # Copyright (c) 1983 Regents of the University of California. | |
7 | # All rights reserved. The Berkeley software License Agreement | |
8 | # specifies the terms and conditions for redistribution. | |
9 | # | |
10 | # @(#)tcpproto.mc 1.2 (Berkeley) 1/24/89 | |
11 | # @(#)proto.mc 1.20 (Berkeley) 1/25/89 | |
12 | # | |
13 | # built by phil on Wed Jan 25 11:48:18 PST 1989 | |
14 | # in /usr/src/local/nettables/sendmail.cf/cf on monet.Berkeley.EDU | |
15 | # | |
16 | ############################################################ | |
17 | ############################################################ | |
18 | ##### | |
19 | ##### SENDMAIL CONFIGURATION FILE | |
20 | ##### | |
21 | ############################################################ | |
22 | ############################################################ | |
23 | ||
24 | ||
25 | ################## | |
26 | # local info # | |
27 | ################## | |
28 | ||
29 | # file containing our internet aliases | |
30 | Fw/usr/lib/sendmail.cw | |
31 | ||
32 | ||
33 | ||
34 | ############################# | |
35 | ### Setup Information ### | |
36 | ############################# | |
37 | ||
38 | ||
39 | ###################### | |
40 | # General Macros # | |
41 | ###################### | |
42 | ||
43 | # local domain name | |
44 | DDYOUR_DOMAIN_GOES_HERE | |
45 | ||
46 | ||
47 | ||
48 | # UUCP relay host | |
49 | DRYOUR_UUCP_RELAY_GOES_HERE | |
50 | ||
51 | # csnet relay host | |
52 | DCYOUR_CSNET_RELAY_GOES_HERE | |
53 | ||
54 | # bitnet relay host | |
55 | DBYOUR_BITNET_RELAY_GOES_HERE | |
56 | ||
57 | # my official hostname | |
58 | Dj$w | |
59 | ||
60 | ||
61 | ||
62 | ############### | |
63 | # Classes # | |
64 | ############### | |
65 | ||
66 | # Internal ("fake") domains that we use in rewriting | |
67 | CIUUCP BITNET CSNET | |
68 | ||
69 | ||
70 | ||
71 | ||
72 | ###################### | |
73 | # Version Number # | |
74 | ###################### | |
75 | ||
76 | DZ1.34 | |
77 | ||
78 | ||
79 | ###################### | |
80 | # Special macros # | |
81 | ###################### | |
82 | ||
83 | # my name | |
84 | DnMAILER-DAEMON | |
85 | # UNIX header format | |
86 | DlFrom $g $d | |
87 | # delimiter (operator) characters | |
88 | Do.:%@!^=/[] | |
89 | # format of a total name | |
90 | Dq$g$?x ($x)$. | |
91 | # SMTP login message | |
92 | De$j Sendmail $v/$Z ready at $b | |
93 | ||
94 | ############### | |
95 | # Options # | |
96 | ############### | |
97 | ||
98 | # location of alias file | |
99 | OA/usr/lib/aliases | |
100 | # wait up to ten minutes for alias file rebuild | |
101 | Oa10 | |
102 | # substitution for space (blank) characters | |
103 | OB. | |
104 | # (don't) connect to "expensive" mailers | |
105 | #Oc | |
106 | # default delivery mode (deliver in background) | |
107 | Odbackground | |
108 | # temporary file mode | |
109 | OF0600 | |
110 | # default GID | |
111 | Og1 | |
112 | # location of help file | |
113 | OH/usr/lib/sendmail.hf | |
114 | # log level | |
115 | OL9 | |
116 | # default network name | |
117 | ONARPA | |
118 | # default messages to old style | |
119 | Oo | |
120 | # queue directory | |
121 | OQ/usr/spool/mqueue | |
122 | # read timeout -- violates protocols | |
123 | Or2h | |
124 | # status file | |
125 | OS/usr/lib/sendmail.st | |
126 | # queue up everything before starting transmission | |
127 | Os | |
128 | # default timeout interval | |
129 | OT3d | |
130 | # time zone names (V6 only) | |
131 | OtPST,PDT | |
132 | # default UID | |
133 | Ou1 | |
134 | # wizard's password | |
135 | OW* | |
136 | # load average at which we just queue messages | |
137 | Ox8 | |
138 | # load average at which we refuse connections | |
139 | OX12 | |
140 | ||
141 | ########################### | |
142 | # Message precedences # | |
143 | ########################### | |
144 | ||
145 | Pfirst-class=0 | |
146 | Pspecial-delivery=100 | |
147 | Pbulk=-60 | |
148 | Pjunk=-100 | |
149 | ||
150 | ##################### | |
151 | # Trusted users # | |
152 | ##################### | |
153 | ||
154 | Troot | |
155 | Tdaemon | |
156 | Tuucp | |
157 | ||
158 | ######################### | |
159 | # Format of headers # | |
160 | ######################### | |
161 | ||
162 | H?P?Return-Path: <$g> | |
163 | HReceived: $?sfrom $s $.by $j ($v/$Z) | |
164 | id $i; $b | |
165 | H?D?Resent-Date: $a | |
166 | H?D?Date: $a | |
167 | H?F?Resent-From: $q | |
168 | H?F?From: $q | |
169 | H?x?Full-Name: $x | |
170 | HSubject: | |
171 | # HPosted-Date: $a | |
172 | # H?l?Received-Date: $b | |
173 | H?M?Resent-Message-Id: <$t.$i@$j> | |
174 | H?M?Message-Id: <$t.$i@$j> | |
175 | ||
176 | ||
177 | ||
178 | ########################### | |
179 | ### Rewriting Rules ### | |
180 | ########################### | |
181 | ||
182 | ||
183 | ################################ | |
184 | # Sender Field Pre-rewriting # | |
185 | ################################ | |
186 | S1 | |
187 | #R$*<$*>$* $1$2$3 defocus | |
188 | ||
189 | ################################### | |
190 | # Recipient Field Pre-rewriting # | |
191 | ################################### | |
192 | S2 | |
193 | #R$*<$*>$* $1$2$3 defocus | |
194 | ||
195 | ||
196 | ||
197 | ################################# | |
198 | # Final Output Post-rewriting # | |
199 | ################################# | |
200 | S4 | |
201 | ||
202 | R@ $@ handle <> error addr | |
203 | ||
204 | # resolve numeric addresses to name if possible | |
205 | R$*<@[$+]>$* $:$1<@$[[$2]$]>$3 lookup numeric internet addr | |
206 | ||
207 | # externalize local domain info | |
208 | R$*<$+>$* $1$2$3 defocus | |
209 | R@$+:@$+:$+ @$1,@$2:$3 <route-addr> canonical | |
210 | ||
211 | # UUCP must always be presented in old form | |
212 | R$+@$-.UUCP $2!$1 u@h.UUCP => h!u | |
213 | ||
214 | # delete duplicate local names | |
215 | R$+%$=w@$=w $1@$w u%host@host => u@host | |
216 | R$+%$=w@$=w.$D $1@$w u%host@host => u@host | |
217 | ||
218 | ||
219 | ########################### | |
220 | # Name Canonicalization # | |
221 | ########################### | |
222 | S3 | |
223 | ||
224 | # handle "from:<>" special case | |
225 | R$*<>$* $@@ turn into magic token | |
226 | ||
227 | # basic textual canonicalization -- note RFC733 heuristic here | |
228 | R$*<$*<$*<$+>$*>$*>$* $4 3-level <> nesting | |
229 | R$*<$*<$+>$*>$* $3 2-level <> nesting | |
230 | R$*<$+>$* $2 basic RFC821/822 parsing | |
231 | ||
232 | # make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later | |
233 | R@$+,$+ @$1:$2 change all "," to ":" | |
234 | ||
235 | # localize and dispose of route-based addresses | |
236 | R@$+:$+ $@$>6<@$1>:$2 handle <route-addr> | |
237 | ||
238 | # more miscellaneous cleanup | |
239 | R$+ $:$>8$1 host dependent cleanup | |
240 | R$+:$*;@$+ $@$1:$2;@$3 list syntax | |
241 | R$+:$*; $@$1:$2; list syntax | |
242 | R$+@$+ $:$1<@$2> focus on domain | |
243 | R$+<$+@$+> $1$2<@$3> move gaze right | |
244 | R$+<@$+> $@$>6$1<@$2> already canonical | |
245 | ||
246 | # convert old-style addresses to a domain-based address | |
247 | R$+^$+ $1!$2 convert ^ to ! | |
248 | R$-!$+ $@$>6$2<@$1.UUCP> resolve uucp names | |
249 | R$+.$-!$+ $@$>6$3<@$1.$2> domain uucps | |
250 | R$+!$+ $@$>6$2<@$1.UUCP> uucp subdomains | |
251 | R$+%$+ $:$>9$1%$2 user%host | |
252 | R$+<@$+> $@$>6$1<@$2> already canonical | |
253 | R$-.$+ $@$>6$2<@$1> host.user | |
254 | ||
255 | ||
256 | ################################# | |
257 | # special local conversions # | |
258 | ################################# | |
259 | ||
260 | S6 | |
261 | R$*<@$=w>$* $:$1<@$w>$3 get into u@$w form | |
262 | R$*<@$=w.$D>$* $:$1<@$w>$3 | |
263 | R$*<@$=U.UUCP>$* $:$1<@$w>$3 | |
264 | ||
265 | ################################ | |
266 | # Change rightmost % to @. # | |
267 | ################################ | |
268 | ||
269 | S9 | |
270 | R$*%$* $1@$2 First make them all @'s. | |
271 | R$*@$*@$* $1%$2@$3 Undo all but the last. | |
272 | R$*@$* $@$1<@$2> Put back the brackets. | |
273 | ||
274 | ||
275 | ||
276 | ################### | |
277 | ### Mailers ### | |
278 | ################### | |
279 | ||
280 | ||
281 | ############################################################ | |
282 | ############################################################ | |
283 | ##### | |
284 | ##### Local and Program Mailer specification | |
285 | ##### | |
286 | ############################################################ | |
287 | ############################################################ | |
288 | ||
289 | Mlocal, P=/bin/mail, F=rlsDFMmn, S=10, R=20, A=mail -d $u | |
290 | Mprog, P=/bin/sh, F=lsDFMe, S=10, R=20, A=sh -c $u | |
291 | ||
292 | S10 | |
293 | R@ $n errors to mailer-daemon | |
294 | ||
295 | ||
296 | ############################################################ | |
297 | ############################################################ | |
298 | ##### | |
299 | ##### Local Domain SMTP Mailer specification | |
300 | ##### | |
301 | ##### Messages processed by this specification are assumed to remain | |
302 | ##### the local domain. Hence, they can refer to hosts that are | |
303 | ##### not registered in the NIC host table. | |
304 | ##### | |
305 | ############################################################ | |
306 | ############################################################ | |
307 | ||
308 | Mtcpld, P=[IPC], F=mDFMueXLC, S=17, R=27, A=IPC $h, E=\r\n | |
309 | ||
310 | S17 | |
311 | ||
312 | # cleanup forwarding a bit | |
313 | R$*<$*>$* $1$2$3 defocus | |
314 | R$* $:$>3$1 canonicalize | |
315 | R$*%$*<@$w> $:$>9$1%$2 user%localhost@localdomain | |
316 | ||
317 | # pass <route-addr>'s through | |
318 | R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr> | |
319 | ||
320 | # map colons to dots everywhere | |
321 | R$*:$* $1.$2 map colons to dots | |
322 | ||
323 | # output local host as user@host.domain | |
324 | R$- $@$1<@$w> user w/o host | |
325 | R$+<@$w> $@$1<@$w> this host | |
326 | R$+<@$=w> $@$1<@$w> or an alias | |
327 | R$+<@$-> $:$1<@$[$2$]> ask nameserver | |
328 | R$+<@$w> $@$1<@$w> this host | |
329 | R$+<@$-> $@$1<@$2.$D> if nameserver fails | |
330 | ||
331 | # if not local, and not a "fake" domain, ask the nameserver | |
332 | R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain | |
333 | R$+<@[$+]> $@$1<@[$2]> already ok | |
334 | ||
335 | # output fake domains as user%fake@relay | |
336 | ||
337 | R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.bitnet | |
338 | R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET | |
339 | R$+<@$+.UUCP> $@$2!$1<@$w> user@host.UUCP | |
340 | ||
341 | ||
342 | S27 | |
343 | ||
344 | # cleanup | |
345 | R$*<$*>$* $1$2$3 defocus | |
346 | R$* $:$>3$1 now canonical form | |
347 | R$*%$*<@$w> $:$>9$1%$2 user%localhost@localdomain | |
348 | ||
349 | # pass <route-addr>'s through | |
350 | R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr> | |
351 | ||
352 | # map colons to dots everywhere | |
353 | R$*:$* $1.$2 map colons to dots | |
354 | ||
355 | # output local host as user@host.domain | |
356 | R$- $@$1<@$w> user w/o host | |
357 | R$+<@$w> $@$1<@$w> this host | |
358 | R$+<@$=w> $@$1<@$w> or an alias | |
359 | R$+<@$-> $:$1<@$[$2$]> ask nameserver | |
360 | R$+<@$w> $@$1<@$w> this host | |
361 | R$+<@$-> $@$1<@$2.$D> if nameserver fails | |
362 | ||
363 | # if not local, and not a "fake" domain, ask the nameserver | |
364 | R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain | |
365 | R$+<@[$+]> $@$1<@[$2]> already ok | |
366 | ||
367 | # output fake domains as user%fake@relay | |
368 | ||
369 | R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.BITNET | |
370 | R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET | |
371 | R$+<@$+.UUCP> $@$2!$1 user@host.UUCP | |
372 | ||
373 | ||
374 | ||
375 | ############################################################ | |
376 | ############################################################ | |
377 | ##### | |
378 | ##### Internet SMTP Mailer specification | |
379 | ##### | |
380 | ##### Messages processed by this specification are assumed to leave | |
381 | ##### the local domain -- hence, they must be canonical according to | |
382 | ##### RFC822 etc. This means that machines not registered with | |
383 | ##### the NIC must be hidden behind our Internet relay. | |
384 | ##### | |
385 | ############################################################ | |
386 | ############################################################ | |
387 | ||
388 | Mtcp, P=[IPC], F=mDFMueXLC, S=14, R=24, A=IPC $h, E=\r\n | |
389 | ||
390 | S14 | |
391 | ||
392 | # pass <route-addr>'s through | |
393 | R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr> | |
394 | ||
395 | # map colons to dots everywhere | |
396 | R$*:$* $1.$2 map colons to dots | |
397 | ||
398 | # output local host in user@host.domain syntax | |
399 | R$- $1<@$w> user w/o host | |
400 | R$+<@$=w> $:$1<@$w> this host | |
401 | R$+<@$-> $:$1<@$[$2$]> canonicalize into dom | |
402 | R$+<@$-> $:$1<@$2.$D> if nameserver fails | |
403 | R$+<@$=N.$D> $@$1<@$2.$D> nic-reg hosts are ok | |
404 | R$+<@$*.$D> $@$1%$2.$D<@$A> else -> u%h@gateway | |
405 | ||
406 | # if not local, and not a "fake" domain, ask the nameserver | |
407 | R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain | |
408 | R$+<@[$+]> $@$1<@[$2]> already ok | |
409 | ||
410 | # output internal ("fake") domains as "user%host@relay" | |
411 | ||
412 | R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.BITNET | |
413 | R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET | |
414 | R$+<@$+.UUCP> $@$2!$1<@$w> user@host.UUCP | |
415 | ||
416 | ||
417 | S24 | |
418 | ||
419 | # put in <> kludge | |
420 | R$*<$*>$* $1$2$3 defocus | |
421 | R$* $:$>3$1 now canonical form | |
422 | ||
423 | # pass <route-addr>'s through | |
424 | R<@$+>$* $@<@$[$1$]>$2 resolve <route-addr> | |
425 | ||
426 | # map colons to dots everywhere..... | |
427 | R$*:$* $1.$2 map colons to dots | |
428 | ||
429 | # output local host in user@host.domain syntax | |
430 | R$- $1<@$w> user w/o host | |
431 | R$+<@$=w> $:$1<@$w> this host | |
432 | R$+<@$-> $:$1<@$[$2$]> canonicalize into dom | |
433 | R$+<@$-> $:$1<@$2.$D> if nameserver fails | |
434 | R$+<@$=N.$D> $@$1<@$2.$D> nic-reg hosts are ok | |
435 | R$+<@$*.$D> $@$1%$2.$D<@$A> else -> u%h@gateway | |
436 | ||
437 | # if not local, and not a "fake" domain, ask the nameserver | |
438 | R$+<@$+.$~I> $@$1<@$[$2.$3$]> user@host.domain | |
439 | R$+<@[$+]> $@$1<@[$2]> already ok | |
440 | ||
441 | # Hide fake domains behind relays | |
442 | ||
443 | R$+<@$+.BITNET> $@$1%$2.BITNET<@$B> user@host.BITNET | |
444 | R$+<@$+.CSNET> $@$1%$2.CSNET<@$C> user@host.CSNET | |
445 | R$+<@$+.UUCP> $@$2!$1 user@host.UUCP | |
446 | ||
447 | ||
448 | ||
449 | ||
450 | ||
451 | ##################### | |
452 | ### Rule Zero ### | |
453 | ##################### | |
454 | ||
455 | ||
456 | ############################################################ | |
457 | ############################################################ | |
458 | ##### | |
459 | ##### RULESET ZERO PREAMBLE | |
460 | ##### | |
461 | ##### The beginning of ruleset zero is constant through all | |
462 | ##### configurations. | |
463 | ##### | |
464 | ############################################################ | |
465 | ############################################################ | |
466 | ||
467 | S0 | |
468 | ||
469 | # first make canonical | |
470 | R$*<$*>$* $1$2$3 defocus | |
471 | R$+ $:$>3$1 make canonical | |
472 | ||
473 | # handle special cases | |
474 | R$*<@[$+]>$* $:$1<@$[[$2]$]>$3 numeric internet addr | |
475 | R$*<@[$+]>$* $#tcp$@[$2]$:$1@[$2]$3 numeric internet spec | |
476 | R$+ $:$>6$1 | |
477 | R$-<@$w> $#local$:$1 | |
478 | R@ $#error$:Invalid address handle <> form | |
479 | ||
480 | # canonicalize using the nameserver if not internal domain | |
481 | R$*<@$*.$~I>$* $:$1<@$[$2.$3$]>$4 | |
482 | R$*<@$->$* $:$1<@$[$2$]>$3 | |
483 | R$*<@$->$* $:$1<@$2.$D>$3 if nameserver fails | |
484 | ||
485 | # now delete the local info | |
486 | R<@$w>:$* $@$>0$1 @here:... -> ... | |
487 | R$*<@$w> $@$>0$1 ...@here -> ... | |
488 | ||
489 | ################################## | |
490 | # End of ruleset zero preamble # | |
491 | ################################## | |
492 | ||
493 | ||
494 | ############################################### | |
495 | ### Machine dependent part of Rule Zero ### | |
496 | ############################################### | |
497 | ||
498 | ||
499 | ||
500 | ||
501 | ||
502 | # resolve fake top level domains by forwarding to other hosts | |
503 | R$*<@$+.BITNET>$* $#tcp$@$B$:$1<@$2.BITNET>$3 user@host.BITNET | |
504 | R$*<@$+.CSNET>$* $#tcp$@$C$:$1<@$2.CSNET>$3 user@host.CSNET | |
505 | ||
506 | ||
507 | # forward non-local UUCP traffic to our UUCP relay | |
508 | R$*<@$*.UUCP>$* $#tcpld$@$R$:$1<@$2.UUCP> uucp mail | |
509 | ||
510 | # hide behind our internet relay when talking to people in the arpa domain | |
511 | R$*<@$*.arpa>$* $#tcp$@$2.arpa$:$1<@$2.arpa>$3 user@host.arpa | |
512 | ||
513 | # but speak domains to them if they speak domains too | |
514 | R$*<@$*>$* $#tcpld$@$2$:$1<@$2>$3 user@host.domain | |
515 | ||
516 | # remaining names must be local | |
517 | R$+ $#local$:$1 everything else |