xref: /386bsd/usr/src/usr.sbin/sendmail/cf/cf/obj/python.cf (revision a2142627)
1#
2# Copyright (c) 1983 Eric P. Allman
3# Copyright (c) 1988, 1993
4#	The Regents of the University of California.  All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9# 1. Redistributions of source code must retain the above copyright
10#    notice, this list of conditions and the following disclaimer.
11# 2. Redistributions in binary form must reproduce the above copyright
12#    notice, this list of conditions and the following disclaimer in the
13#    documentation and/or other materials provided with the distribution.
14# 3. All advertising materials mentioning features or use of this software
15#    must display the following acknowledgement:
16#	This product includes software developed by the University of
17#	California, Berkeley and its contributors.
18# 4. Neither the name of the University nor the names of its contributors
19#    may be used to endorse or promote products derived from this software
20#    without specific prior written permission.
21#
22# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32# SUCH DAMAGE.
33#
34
35
36######################################################################
37######################################################################
38#####
39#####		SENDMAIL CONFIGURATION FILE
40#####
41##### built by eric@vangogh.CS.Berkeley.EDU on Mon Apr 18 22:21:50 PDT 1994
42##### in /usr/src/usr.sbin/sendmail/cf/cf
43#####
44######################################################################
45######################################################################
46
47#####  @(#)cf.m4	8.4 (Berkeley) 12/24/93  #####
48
49#####  @(#)python.mc	8.1 (Berkeley) 6/7/93  #####
50
51#####  @(#)bsd4.4.m4	8.2 (Berkeley) 2/10/94  #####
52
53#####  @(#)cs.exposed.m4	8.1 (Berkeley) 6/7/93  #####
54
55#####  @(#)Berkeley.m4	8.5 (Berkeley) 2/18/94  #####
56
57#####  @(#)redirect.m4	8.2 (Berkeley) 12/27/93  #####
58
59
60
61
62#####  @(#)use_cw_file.m4	8.1 (Berkeley) 6/7/93  #####
63
64
65#####  @(#)cssubdomain.m4	8.1 (Berkeley) 6/7/93  #####
66
67
68
69# accept mail sent to the domain head
70DDBostic.COM
71
72
73
74#####  @(#)proto.m4	8.45 (Berkeley) 3/4/94  #####
75
76
77# level 5 config file format
78V5
79
80##################
81#   local info   #
82##################
83
84Cwlocalhost
85# file containing names of hosts for which we receive email
86Fw-o /etc/sendmail.cw
87
88
89CP.
90
91# UUCP relay host
92DYucbvax.Berkeley.EDU
93CPUUCP
94
95#  BITNET relay host
96DBCMSA.Berkeley.EDU
97CPBITNET
98
99# "Smart" relay host (may be null)
100DS
101
102# who I send unqualified names to (null means deliver locally)
103DRvangogh.CS.Berkeley.EDU
104
105# who gets all local email traffic ($R has precedence for unqualified names)
106DH
107
108# who I masquerade as (null for no masquerading)
109DMvangogh.CS.Berkeley.EDU
110
111# class L: names that should be delivered locally, even if we have a relay
112# class E: names that should be exposed as from this host, even if we masquerade
113#CLroot
114CEroot
115
116# operators that cannot be in local usernames (i.e., network indicators)
117CO @ % !
118
119# a class with just dot (for identifying canonical names)
120C..
121
122# dequoting map
123Kdequote dequote
124
125
126CPREDIRECT
127
128######################
129#   Special macros   #
130######################
131
132# SMTP initial login message
133De$j Sendmail $v/$Z ready at $b
134
135# UNIX initial From header format
136DlFrom $g  $d
137
138# my name for error messages
139DnMAILER-DAEMON
140
141# delimiter (operator) characters
142Do.:%@!^/[]
143
144# format of a total name
145Dq$?x$x <$g>$|$g$.
146
147# Configuration version number
148DZ8.6.9
149
150
151###############
152#   Options   #
153###############
154
155# strip message body to 7 bits on input?
156O7False
157
158# wait (in minutes) for alias file rebuild
159Oa10
160
161# location of alias file
162OA/etc/aliases
163
164# minimum number of free blocks on filesystem
165Ob4
166
167# substitution for space (blank) characters
168OB.
169
170# avoid connecting to "expensive" mailers on initial submission?
171OcFalse
172
173# checkpoint queue runs after every N successful deliveries
174OC10
175
176# default delivery mode
177Odbackground
178
179# automatically rebuild the alias database?
180ODFalse
181
182# error message header/file
183#OE/etc/sendmail.oE
184
185# error mode
186#Oep
187
188# save Unix-style "From_" lines at top of header?
189OfFalse
190
191# temporary file mode
192OF0600
193
194# match recipients against GECOS field?
195OGFalse
196
197# default GID
198Og1
199
200# maximum hop count
201Oh17
202
203# location of help file
204OH/usr/share/misc/sendmail.hf
205
206# ignore dots as terminators in incoming messages?
207OiFalse
208
209# Insist that the BIND name server be running to resolve names
210OI
211
212# deliver MIME-encapsulated error messages?
213OjTrue
214
215# Forward file search path
216OJ$z/.forward.$w:$z/.forward
217
218# open connection cache size
219Ok2
220
221# open connection cache timeout
222OK5m
223
224# use Errors-To: header?
225OlFalse
226
227# log level
228OL9
229
230# send to me too, even in an alias expansion?
231OmFalse
232
233# verify RHS in newaliases?
234OnTrue
235
236# default messages to old style headers if no special punctuation?
237OoTrue
238
239# SMTP daemon options
240#OOPort=esmtp
241
242# privacy flags
243Opauthwarnings
244
245# who (if anyone) should get extra copies of error messages
246#OPPostmaster
247
248# slope of queue-only function
249#Oq600000
250
251# queue directory
252OQ/var/spool/mqueue
253
254# read timeout -- now OK per RFC 1123 section 5.3.2
255#Ordatablock=10m
256
257# queue up everything before forking?
258OsTrue
259
260# status file
261OS/var/log/sendmail.st
262
263# default message timeout interval
264OT5d/4h
265
266# time zone handling:
267#  if undefined, use system default
268#  if defined but null, use TZ envariable passed in
269#  if defined and non-null, use that info
270#Ot
271
272# default UID
273Ou1
274
275# list of locations of user database file (null means no lookup)
276OU/usr/sww/share/lib/users.cs.db,/usr/sww/share/lib/users.eecs.db
277
278# fallback MX host
279#OVfall.back.host.net
280
281# if we are the best MX host for a site, try it directly instead of config err
282OwFalse
283
284# load average at which we just queue messages
285Ox8
286
287# load average at which we refuse connections
288OX12
289
290# work recipient factor
291#Oy30000
292
293# deliver each queued job in a separate process?
294OYFalse
295
296# work class factor
297#Oz1800
298
299# work time factor
300#OZ90000
301
302###########################
303#   Message precedences   #
304###########################
305
306Pfirst-class=0
307Pspecial-delivery=100
308Plist=-30
309Pbulk=-60
310Pjunk=-100
311
312#####################
313#   Trusted users   #
314#####################
315
316Troot
317Tdaemon
318Tuucp
319
320#########################
321#   Format of headers   #
322#########################
323
324H?P?Return-Path: $g
325HReceived: $?sfrom $s $.$?_($?s$|from $.$_) $.by $j ($v/$Z)$?r with $r$. id $i$?u for $u$.; $b
326H?D?Resent-Date: $a
327H?D?Date: $a
328H?F?Resent-From: $q
329H?F?From: $q
330H?x?Full-Name: $x
331HSubject:
332# HPosted-Date: $a
333# H?l?Received-Date: $b
334H?M?Resent-Message-Id: <$t.$i@$j>
335H?M?Message-Id: <$t.$i@$j>
336#
337######################################################################
338######################################################################
339#####
340#####			REWRITING RULES
341#####
342######################################################################
343######################################################################
344
345
346###########################################
347###  Rulset 3 -- Name Canonicalization  ###
348###########################################
349S3
350
351# handle null input (translate to <@> special case)
352R$@			$@ <@>
353
354# basic textual canonicalization -- note RFC733 heuristic here
355R$*<$*>$*<$*>$*		$2$3<$4>$5			strip multiple <> <>
356R$*<$*<$+>$*>$*		<$3>$5				2-level <> nesting
357R$*<>$*			$@ <@>				MAIL FROM:<> case
358R$*<$+>$*		$2				basic RFC821/822 parsing
359
360# handle list:; syntax as special case
361R$*:;$*			$@ $1 :; <@>
362
363# make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
364R@ $+ , $+		@ $1 : $2			change all "," to ":"
365
366# localize and dispose of route-based addresses
367R@ $+ : $+		$@ $>96 < @$1 > : $2		handle <route-addr>
368
369# find focus for list syntax
370R $+ : $* ; @ $+	$@ $>96 $1 : $2 ; < @ $3 >	list syntax
371R $+ : $* ;		$@ $1 : $2;			list syntax
372
373# find focus for @ syntax addresses
374R$+ @ $+		$: $1 < @ $2 >			focus on domain
375R$+ < $+ @ $+ >		$1 $2 < @ $3 >			move gaze right
376R$+ < @ $+ >		$@ $>96 $1 < @ $2 >		already canonical
377
378# do some sanity checking
379R$* < @ $* : $* > $*	$1 < @ $2 $3 > $4		nix colons in addrs
380
381# convert old-style addresses to a domain-based address
382R$- ! $+		$@ $>96 $2 < @ $1 .UUCP >	resolve uucp names
383R$+ . $- ! $+		$@ $>96 $3 < @ $1 . $2 >		domain uucps
384R$+ ! $+		$@ $>96 $2 < @ $1 .UUCP >	uucp subdomains
385
386# if we have % signs, take the rightmost one
387R$* % $*		$1 @ $2				First make them all @s.
388R$* @ $* @ $*		$1 % $2 @ $3			Undo all but the last.
389R$* @ $*		$@ $>96 $1 < @ $2 >		Insert < > and finish
390
391# else we must be a local name
392
393
394################################################
395###  Ruleset 96 -- bottom half of ruleset 3  ###
396################################################
397
398#  At this point, everything should be in a "local_part<@domain>extra" format.
399S96
400
401# handle special cases for local names
402R$* < @ localhost > $*		$: $1 < @ $j . > $2		no domain at all
403R$* < @ localhost . $m > $*	$: $1 < @ $j . > $2		local domain
404R$* < @ localhost . UUCP > $*	$: $1 < @ $j . > $2		.UUCP domain
405R$* < @ [ $+ ] > $*		$: $1 < @@ [ $2 ] > $3		mark [a.b.c.d]
406R$* < @@ $=w > $*		$: $1 < @ $j . > $3		self-literal
407R$* < @@ $+ > $*		$@ $1 < @ $2 > $3		canon IP addr
408
409# find possible (old & new) versions of our name via short circuit hack
410# (this code should exist ONLY during the transition from .Berkeley.EDU
411#  names to .CS.Berkeley.EDU names -- probably not more than a few months)
412R$* < @ $=w .CS.Berkeley.EDU > $*	$: $1 < @ $j > $3
413R$* < @ $=w .Berkeley.EDU> $*		$: $1 < @ $j > $3
414
415# pass UUCP addresses straight through
416R$* < @ $+ . UUCP > $*		$@ $1 < @ $2 . UUCP . > $3
417
418# pass to name server to make hostname canonical
419R$* < @ $* $~P > $*		$: $1 < @ $[ $2 $3 $] > $4
420
421# local host aliases and pseudo-domains are always canonical
422R$* < @ $=w > $*		$: $1 < @ $2 . > $3
423R$* < @ $* $=P > $*		$: $1 < @ $2 $3 . > $4
424R$* < @ $* . . > $*		$1 < @ $2 . > $3
425
426# if this is the local hostname, make sure we treat is as canonical
427R$* < @ $j > $*			$: $1 < @ $j . > $2
428
429
430##################################################
431###  Ruleset 4 -- Final Output Post-rewriting  ###
432##################################################
433S4
434
435R$*<@>			$@ $1				handle <> and list:;
436
437# strip trailing dot off possibly canonical name
438R$* < @ $+ . > $*	$1 < @ $2 > $3
439
440# externalize local domain info
441R$* < $+ > $*		$1 $2 $3			defocus
442R@ $+ : @ $+ : $+	@ $1 , @ $2 : $3		<route-addr> canonical
443R@ $*			$@ @ $1				... and exit
444
445# UUCP must always be presented in old form
446R$+ @ $- . UUCP		$2!$1				u@h.UUCP => h!u
447
448# delete duplicate local names
449R$+ % $=w @ $=w		$1 @ $j				u%host@host => u@host
450
451
452
453##############################################################
454###   Ruleset 97 -- recanonicalize and call ruleset zero   ###
455###		   (used for recursive calls)		   ###
456##############################################################
457
458S97
459R$*			$: $>3 $1
460R$*			$@ $>0 $1
461
462
463######################################
464###   Ruleset 0 -- Parse Address   ###
465######################################
466
467S0
468
469R<@>			$#local $: <>			special case error msgs
470R$* : $* ;		$#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
471R<@ $+>			$#error $@ USAGE $: "user address required"
472R<$* : $* >		$#error $@ USAGE $: "colon illegal in host name part"
473
474# handle numeric address spec
475R$* < @ [ $+ ] > $*	$: $>98 $1 < @ [ $2 ] > $3	numeric internet spec
476R$* < @ [ $+ ] > $*	$#smtp $@ [$2] $: $1 < @ [$2] > $3	still numeric: send
477
478# now delete the local info -- note $=O to find characters that cause forwarding
479R$* < @ > $*		$@ $>97 $1		user@ => user
480R< @ $=w . > : $*	$@ $>97 $2		@here:... -> ...
481R$* $=O $* < @ $=w . >	$@ $>97 $1 $2 $3		...@here -> ...
482
483# handle local hacks
484R$*			$: $>98 $1
485
486# short circuit local delivery so forwarded email works
487R$+ < @ $=w . >		$: $1 < @ $2 . @ $H >		first try hub
488R$+ < $+ @ $+ >		$#local $: $1			yep ....
489R$+ < $+ @ >		$#local $: @ $1			nope, local address
490
491# resolve remotely connected UUCP links (if any)
492
493# resolve fake top level domains by forwarding to other hosts
494R$*<@$+.BITNET.>$*	$: $>95 < $B > $1 <@$2.BITNET.> $3	user@host.BITNET
495
496# forward non-local UUCP traffic to our UUCP relay
497R$*<@$*.UUCP.>$*		$: $>95 < $Y > $1 <@$2.UUCP.> $3	uucp mail
498
499
500# pass names that still have a host to a smarthost (if defined)
501R$* < @ $* > $*		$: $>95 < $S > $1 < @ $2 > $3	glue on smarthost name
502
503# deal with other remote names
504R$* < @$* > $*		$#smtp $@ $2 $: $1 < @ $2 > $3		user@host.domain
505
506# if this is quoted, strip the quotes and try again
507R$+			$: $(dequote $1 $)		strip quotes
508R$+ $=O $+		$@ $>97 $1 $2 $3			try again
509
510# handle locally delivered names
511R$=L			$#local $: @ $1			special local names
512R$+			$#local $: $1			regular local names
513
514###########################################################################
515###   Ruleset 5 -- special rewriting after aliases have been expanded   ###
516###		   (new sendmail only)					###
517###########################################################################
518
519S5
520
521# see if we have a relay or a hub
522R$+			$: < $R > $1			try relay
523R< > $+			$: < $H > $1			try hub
524R< > $+			$@ $1				nope, give up
525R< $- : $+ > $+		$: $>95 < $1 : $2 > $3 < @ $2 >
526R< $+ > $+		$@ $>95 < $1 > $2 < @ $1 >
527
528###################################################################
529###  Ruleset 95 -- canonify mailer:host syntax to triple	###
530###################################################################
531
532S95
533R< > $*			$@ $1				strip off null relay
534R< $- : $+ > $*		$# $1 $@ $2 $: $3		try qualified mailer
535R< $=w > $*		$@ $2				delete local host
536R< $+ > $*		$#relay $@ $1 $: $2		use unqualified mailer
537
538###################################################################
539###  Ruleset 98 -- local part of ruleset zero (can be null)	###
540###################################################################
541
542S98
543
544# addresses sent to foo@host.REDIRECT will give a 551 error code
545R$* < @ $+ .REDIRECT. >	$# error $@ NOUSER $: "551 User not local; please try " <$1@$2>
546
547# accept mail sent to the domain head
548R< @ $D . > : $*		$@ $>7 $1		@here:... -> ...
549R$* $=O $* < @ $D . >		$@ $>7 $1 $2 $3		...@here -> ...
550R$* < @ $D . >			$#local $: $1		user@here -> user
551#
552######################################################################
553######################################################################
554#####
555#####			MAILER DEFINITIONS
556#####
557######################################################################
558######################################################################
559
560
561##################################################
562###   Local and Program Mailer specification   ###
563##################################################
564
565#####  @(#)local.m4	8.6 (Berkeley) 10/24/93  #####
566
567Mlocal,		P=/usr/libexec/mail.local, F=lsDFMrmn, S=10, R=20/40,
568		A=mail -d $u
569Mprog,		P=/bin/sh, F=lsDFMeu, S=10, R=20/40, D=$z:/,
570		A=sh -c $u
571
572S10
573R<@>			$n			errors to mailer-daemon
574R$+			$: $>40 $1
575
576S20
577R$+ < @ $* >		$: $1			strip host part
578
579S40
580
581#####################################
582###   SMTP Mailer specification   ###
583#####################################
584
585#####  @(#)smtp.m4	8.15 (Berkeley) 2/14/94  #####
586
587Msmtp,		P=[IPC], F=mDFMuX, S=11/31, R=21, E=\r\n,
588		L=990, A=IPC $h
589Mesmtp,		P=[IPC], F=mDFMuXa, S=11/31, R=21, E=\r\n,
590		L=990, A=IPC $h
591Mrelay,		P=[IPC], F=mDFMuXa, S=11/31, R=61, E=\r\n,
592		L=2040, A=IPC $h
593
594#
595#  envelope sender and masquerading recipient rewriting
596#
597S11
598R$+			$: $>51 $1			sender/recipient common
599R$* :; <@>		$@ $1 :;			list:; special case
600R$*			$@ $>61 $1			qualify unqual'ed names
601
602
603#
604#  header recipient rewriting if not masquerading recipients
605#
606S21
607
608# do sender/recipient common rewriting
609R$+			$: $>51 $1
610
611# unqualified names (e.g., "eric") are qualified by local host
612R$* < @ $* > $*		$@ $1 < @ $2 > $3		already qualified
613R$+			$: $1 < @ $j >			add local domain
614
615
616#
617#  header sender and masquerading recipient rewriting
618#
619S31
620R$+			$: $>51 $1			sender/recipient common
621R$* :; <@>		$@ $1 :;			list:; special case
622
623# do special header rewriting
624R$* <@> $*		$@ $1 <@> $2			pass null host through
625R< @ $* > $*		$@ < @ $1 > $2			pass route-addr through
626R$=E < @ $=w . >	$@ $1 < @ $2 >			exposed user as is
627R$* < @ $=w . >		$: $1 < @ $2 @ $M >		masquerade as domain
628R$* < @ $+ @ >		$@ $1 < @ $2 >			in case $M undefined
629R$* < @ $+ @ $+ >	$@ $1 < @ $3 >			$M is defined -- use it
630R$*			$@ $>61 $1			qualify unqual'ed names
631
632
633#
634#  convert pseudo-domain addresses to real domain addresses
635#
636S51
637
638# pass <route-addr>s through
639R< @ $+ > $*		$@ < @ $1 > $2			resolve <route-addr>
640
641# output fake domains as user%fake@relay
642R$+ <@ $+ .BITNET. >	$: $1 % $2 .BITNET < @ $B >	user@host.BITNET
643R$+.BITNET <@ $+:$+ >	$: $1 .BITNET < @ $3 >		strip mailer: part
644
645# do UUCP heuristics; note that these are shared with UUCP mailers
646R$+ < @ $+ .UUCP. >	$: < $2 ! > $1			convert to UUCP form
647R$+ < @ $* > $*		$@ $1 < @ $2 > $3		not UUCP form
648
649# leave these in .UUCP form to avoid further tampering
650R< $&h ! > $- ! $+	$@ $2 < @ $1 .UUCP. >
651R< $&h ! > $-.$+ ! $+	$@ $3 < @ $1.$2 >
652R< $&h ! > $+		$@ $1 < @ $&h .UUCP. >
653R< $+ ! > $+		$: $1 ! $2 < @ $Y >
654R$+ < @ >		$: $1 < @ $j >			in case $Y undefined
655R$+ < @ $+ : $+ >	$: $1 < @ $3 >			strip mailer: part
656
657
658#
659#  common sender and masquerading recipient rewriting
660#
661S61
662
663R$* < @ $* > $*		$@ $1 < @ $2 > $3		already qualified
664R$=E			$@ $1 < @ $j>			show exposed names
665R$+			$: $1 < @ $M >			user w/o host
666R$+ <@>			$: $1 < @ $j >			in case $M undefined
667