xref: /titanic_52/usr/src/cmd/sendmail/cf/m4/cfhead.m4 (revision efd4c9b63ad77503c101fc6c2ed8ba96c9d52964)
1#
2# Copyright (c) 1998-2004, 2009 Sendmail, Inc. and its suppliers.
3#	All rights reserved.
4# Copyright (c) 1983, 1995 Eric P. Allman.  All rights reserved.
5# Copyright (c) 1988, 1993
6#	The Regents of the University of California.  All rights reserved.
7#
8# Copyright 1993, 1997-2006 Sun Microsystems, Inc.  All rights reserved.
9# Use is subject to license terms.
10#
11# By using this file, you agree to the terms and conditions set
12# forth in the LICENSE file which can be found at the top level of
13# the sendmail distribution.
14#
15#
16
17######################################################################
18######################################################################
19#####
20#####		SENDMAIL CONFIGURATION FILE
21#####
22ifdef(`SUN_HIDE_INTERNAL_DETAILS',,
23ifdef(`__win32__', `dnl', `dnl
24ifdef(`TEMPFILE', `dnl', `define(`TEMPFILE', maketemp(/tmp/cfXXXXXX))dnl
25syscmd(sh _CF_DIR_`'sh/makeinfo.sh _CF_DIR_ > TEMPFILE)dnl
26include(TEMPFILE)dnl
27syscmd(rm -f TEMPFILE)dnl')')
28#####
29)dnl
30######################################################################
31#####
32#####	DO NOT EDIT THIS FILE!  Only edit the source .mc file.
33#####
34######################################################################
35######################################################################
36
37divert(-1)
38
39changecom()
40undefine(`format')
41undefine(`hpux')
42ifdef(`pushdef', `',
43	`errprint(`You need a newer version of M4, at least as new as
44System V or GNU')
45	include(NoSuchFile)')
46define(`PUSHDIVERT', `pushdef(`__D__', divnum)divert($1)')
47define(`POPDIVERT', `divert(__D__)popdef(`__D__')')
48define(`OSTYPE',
49	`PUSHDIVERT(-1)
50	ifdef(`__OSTYPE__', `errprint(`duplicate OSTYPE'($1)
51)')
52	define(`__OSTYPE__', $1)
53	define(`_ARG_', $2)
54	include(_CF_DIR_`'ostype/$1.m4)POPDIVERT`'')
55## helpful functions
56define(`lower', `translit(`$1', `ABCDEFGHIJKLMNOPQRSTUVWXYZ', `abcdefghijklmnopqrstuvwxyz')')
57define(`strcasecmp', `ifelse(lower($1), lower($2), `1', `0')')
58## access to further arguments in FEATURE/HACK
59define(`_ACC_ARG_1_',`$1')
60define(`_ACC_ARG_2_',`$2')
61define(`_ACC_ARG_3_',`$3')
62define(`_ACC_ARG_4_',`$4')
63define(`_ACC_ARG_5_',`$5')
64define(`_ACC_ARG_6_',`$6')
65define(`_ACC_ARG_7_',`$7')
66define(`_ACC_ARG_8_',`$8')
67define(`_ACC_ARG_9_',`$9')
68define(`_ARG1_',`_ACC_ARG_1_(_ARGS_)')
69define(`_ARG2_',`_ACC_ARG_2_(_ARGS_)')
70define(`_ARG3_',`_ACC_ARG_3_(_ARGS_)')
71define(`_ARG4_',`_ACC_ARG_4_(_ARGS_)')
72define(`_ARG5_',`_ACC_ARG_5_(_ARGS_)')
73define(`_ARG6_',`_ACC_ARG_6_(_ARGS_)')
74define(`_ARG7_',`_ACC_ARG_7_(_ARGS_)')
75define(`_ARG8_',`_ACC_ARG_8_(_ARGS_)')
76define(`_ARG9_',`_ACC_ARG_9_(_ARGS_)')
77dnl define if not yet defined: if `$1' is not defined it will be `$2'
78define(`_DEFIFNOT',`ifdef(`$1',`',`define(`$1',`$2')')')
79dnl ----------------------------------------
80dnl add a char $2 to a string $1 if it is not there
81define(`_ADDCHAR_',`define(`_I_',`eval(index(`$1',`$2') >= 0)')`'ifelse(_I_,`1',`$1',`$1$2')')
82dnl ----
83dnl delete a char $2 from a string $1 if it is there
84define(`_DELCHAR_',`define(`_IDX_',`index(`$1',`$2')')`'define(`_I_',`eval(_IDX_ >= 0)')`'ifelse(_I_,`1',`substr(`$1',0,_IDX_)`'substr(`$1',eval(_IDX_+1))',`$1')')
85dnl ----
86dnl apply a macro to a whole string by recursion (one char at a time)
87dnl $1: macro
88dnl $2: first argument to macro
89dnl $3: list that is split up into characters
90define(`_AP_',`ifelse(`$3',`',`$2',`_AP_(`$1',$1(`$2',substr(`$3',0,1)),substr(`$3',1))')')
91dnl ----
92dnl MODIFY_MAILER_FLAGS: append tail of $2 to $1_MF_A/D_
93dnl A if head($2) = +
94dnl D if head($2) = -
95dnl $1_MF_ is set otherwise; set _A/D_ to `'
96define(`MODIFY_MAILER_FLAGS',`define(`_hd_',`substr(`$2',0,1)')define(`_tl_',`substr(`$2',1)')`'ifelse(_hd_,`+',`ifdef($1`'_MF_A_, `define($1`'_MF_A_,$1_MF_A_`'_tl_)', `define($1`'_MF_A_, _tl_)')',_hd_,`-',`ifdef($1`'_MF_D_, `define($1`'_MF_D_,$1_MF_D_`'_tl_)', `define($1`'_MF_D_,_tl_)')',`define($1`'_MF_,`$2')define($1`'_MF_A_,`')define($1`'_MF_D_,`')')')
97dnl ----
98dnl actually modify flags:
99dnl $1: flags (strings) to modify
100dnl $2: name of flags (just first part) to modify
101dnl WARNING: the order might be important: if someone adds and delete the
102dnl same characters, he does not deserve any better, does he?
103dnl this could be coded more efficiently... (do not apply the macro if _MF_A/D_ is undefined)
104define(`_MODMF_',`ifdef($2`'_MF_,`$2_MF_',`_AP_(`_ADDCHAR_',_AP_(`_DELCHAR_',$1,ifdef($2`'_MF_D_,`$2_MF_D_',`')),ifdef($2`'_MF_A_,`$2_MF_A_',`'))')')
105dnl usage:
106dnl MODIFY_MAILER_FLAGS(`LOCAL',`+FlaGs')dnl
107dnl in MAILER.m4: _MODMF_(LMF,`LOCAL')
108dnl ----------------------------------------
109define(`MAILER',
110`define(`_M_N_', `ifelse(`$2', `', `$1', `$2')')dnl
111ifdef(`_MAILER_DEFINED_', `', `define(`_MAILER_DEFINED_', `1')')dnl
112ifdef(_MAILER_`'_M_N_`'_,
113`errprint(`*** ERROR: MAILER('_M_N_`) already included
114')',
115`define(_MAILER_`'_M_N_`'_, `')define(`_ARG_', `$2')define(`_ARGS_', `shift($@)')PUSHDIVERT(7)include(_CF_DIR_`'mailer/$1.m4)POPDIVERT`'')')
116define(`DOMAIN', `PUSHDIVERT(-1)define(`_ARG_', `$2')include(_CF_DIR_`'domain/$1.m4)POPDIVERT`'')
117define(`FEATURE', `PUSHDIVERT(-1)ifdef(`_MAILER_DEFINED_',`errprint(`*** ERROR: FEATURE() should be before MAILER()
118')')define(`_ARG_', `$2')define(`_ARGS_', `shift($@)')include(_CF_DIR_`'feature/$1.m4)POPDIVERT`'')
119define(`HACK', `PUSHDIVERT(-1)define(`_ARG_', `$2')define(`_ARGS_', `shift($@)')include(_CF_DIR_`'hack/$1.m4)POPDIVERT`'')
120define(`_DPO_',`')
121define(`DAEMON_OPTIONS', `define(`_DPO_', defn(`_DPO_')
122O DaemonPortOptions=`$1')')
123define(`_CPO_',`')
124define(`CLIENT_OPTIONS', `define(`_CPO_', defn(`_CPO_')
125O ClientPortOptions=`$1')')
126define(`_MAIL_FILTERS_', `')
127define(`_MAIL_FILTERS_DEF', `')
128define(`MAIL_FILTER', `define(`_MAIL_FILTERS_', defn(`_MAIL_FILTERS_')
129X`'$1`, '`$2')
130define(`_MAIL_FILTERS_DEF', defn(`_MAIL_FILTERS_DEF')`X')')
131define(`INPUT_MAIL_FILTER', `MAIL_FILTER(`$1', `$2')
132ifelse(defn(`confINPUT_MAIL_FILTERS')X, `X',
133`define(`confINPUT_MAIL_FILTERS', $1)',
134`define(`confINPUT_MAIL_FILTERS', defn(`confINPUT_MAIL_FILTERS')`, '`$1')')')
135define(`_QUEUE_GROUP_', `')
136define(`QUEUE_GROUP', `define(`_QUEUE_GROUP_', defn(`_QUEUE_GROUP_')
137Q`'$1`, '`$2')')
138define(`CF_LEVEL', `10')dnl
139define(`VERSIONID', ``#####  $1  #####'')
140define(`LOCAL_RULE_0', `divert(3)')
141dnl for UUCP...
142define(`LOCAL_UUCP', `divert(4)')
143define(`LOCAL_RULE_1',
144`divert(9)dnl
145#######################################
146###  Ruleset 1 -- Sender Rewriting  ###
147#######################################
148
149Ssender=1
150')
151define(`LOCAL_RULE_2',
152`divert(9)dnl
153##########################################
154###  Ruleset 2 -- Recipient Rewriting  ###
155##########################################
156
157Srecipient=2
158')
159define(`LOCAL_RULESETS',
160`divert(9)
161
162')
163define(`LOCAL_SRV_FEATURES',
164`define(`_LOCAL_SRV_FEATURES_')
165ifdef(`_MAILER_DEFINED_',,`errprint(`*** WARNING: MAILER() should be before LOCAL_SRV_FEATURES
166')')
167divert(9)
168SLocal_srv_features')
169define(`LOCAL_TRY_TLS',
170`define(`_LOCAL_TRY_TLS_')
171ifdef(`_MAILER_DEFINED_',,`errprint(`*** WARNING: MAILER() should be before LOCAL_TRY_TLS
172')')
173divert(9)
174SLocal_try_tls')
175define(`LOCAL_TLS_RCPT',
176`define(`_LOCAL_TLS_RCPT_')
177ifdef(`_MAILER_DEFINED_',,`errprint(`*** WARNING: MAILER() should be before LOCAL_TLS_RCPT
178')')
179divert(9)
180SLocal_tls_rcpt')
181define(`LOCAL_TLS_CLIENT',
182`define(`_LOCAL_TLS_CLIENT_')
183ifdef(`_MAILER_DEFINED_',,`errprint(`*** WARNING: MAILER() should be before LOCAL_TLS_CLIENT
184')')
185divert(9)
186SLocal_tls_client')
187define(`LOCAL_TLS_SERVER',
188`define(`_LOCAL_TLS_SERVER_')
189ifdef(`_MAILER_DEFINED_',,`errprint(`*** WARNING: MAILER() should be before LOCAL_TLS_SERVER
190')')
191divert(9)
192SLocal_tls_server')
193define(`LOCAL_RULE_3', `divert(2)')
194define(`LOCAL_CONFIG', `divert(6)')
195define(`MAILER_DEFINITIONS', `divert(7)')
196define(`LOCAL_NET_CONFIG', `define(`_LOCAL_RULES_', 1)divert(1)')
197define(`UUCPSMTP', `R DOL(*) < @ $1 .UUCP > DOL(*)	DOL(1) < @ $2 > DOL(2)')
198define(`CONCAT', `$1$2$3$4$5$6$7')
199define(`DOL', ``$'$1')
200define(`SITECONFIG',
201`CONCAT(D, $3, $2)
202define(`_CLASS_$3_', `')dnl
203ifelse($3, U, C{w}$2 $2.UUCP, `dnl')
204define(`SITE', `ifelse(CONCAT($'2`, $3), SU,
205		CONCAT(CY, $'1`),
206		CONCAT(C, $3, $'1`))')
207sinclude(_CF_DIR_`'siteconfig/$1.m4)')
208define(`EXPOSED_USER', `PUSHDIVERT(5)C{E}$1
209POPDIVERT`'dnl`'')
210define(`EXPOSED_USER_FILE', `PUSHDIVERT(5)F{E}$1
211POPDIVERT`'dnl`'')
212define(`LOCAL_USER', `PUSHDIVERT(5)C{L}$1
213POPDIVERT`'dnl`'')
214define(`LOCAL_USER_FILE', `PUSHDIVERT(5)F{L}$1
215POPDIVERT`'dnl`'')
216define(`MASQUERADE_AS', `define(`MASQUERADE_NAME', $1)')
217define(`MASQUERADE_DOMAIN', `PUSHDIVERT(5)C{M}$1
218POPDIVERT`'dnl`'')
219define(`MASQUERADE_EXCEPTION', `PUSHDIVERT(5)C{N}$1
220POPDIVERT`'dnl`'')
221define(`MASQUERADE_DOMAIN_FILE', `PUSHDIVERT(5)F{M}$1
222POPDIVERT`'dnl`'')
223define(`MASQUERADE_EXCEPTION_FILE', `PUSHDIVERT(5)F{N}$1
224POPDIVERT`'dnl`'')
225define(`LOCAL_DOMAIN', `PUSHDIVERT(5)C{w}$1
226POPDIVERT`'dnl`'')
227define(`CANONIFY_DOMAIN', `PUSHDIVERT(5)C{Canonify}$1
228POPDIVERT`'dnl`'')
229define(`CANONIFY_DOMAIN_FILE', `PUSHDIVERT(5)F{Canonify}$1
230POPDIVERT`'dnl`'')
231define(`GENERICS_DOMAIN', `PUSHDIVERT(5)C{G}$1
232POPDIVERT`'dnl`'')
233define(`GENERICS_DOMAIN_FILE', `PUSHDIVERT(5)F{G}$1
234POPDIVERT`'dnl`'')
235define(`LDAPROUTE_DOMAIN', `PUSHDIVERT(5)C{LDAPRoute}$1
236POPDIVERT`'dnl`'')
237define(`LDAPROUTE_DOMAIN_FILE', `PUSHDIVERT(5)F{LDAPRoute}$1
238POPDIVERT`'dnl`'')
239define(`LDAPROUTE_EQUIVALENT', `PUSHDIVERT(5)C{LDAPRouteEquiv}$1
240POPDIVERT`'dnl`'')
241define(`LDAPROUTE_EQUIVALENT_FILE', `PUSHDIVERT(5)F{LDAPRouteEquiv}$1
242POPDIVERT`'dnl`'')
243define(`VIRTUSER_DOMAIN', `PUSHDIVERT(5)C{VirtHost}$1
244define(`_VIRTHOSTS_')
245POPDIVERT`'dnl`'')
246define(`VIRTUSER_DOMAIN_FILE', `PUSHDIVERT(5)F{VirtHost}$1
247define(`_VIRTHOSTS_')
248POPDIVERT`'dnl`'')
249define(`RELAY_DOMAIN', `PUSHDIVERT(5)C{R}$1
250POPDIVERT`'dnl`'')
251define(`RELAY_DOMAIN_FILE', `PUSHDIVERT(5)F{R}$1
252POPDIVERT`'dnl`'')
253define(`TRUST_AUTH_MECH', `_DEFIFNOT(`_USE_AUTH_',`1')PUSHDIVERT(5)C{TrustAuthMech}$1
254POPDIVERT`'dnl`'')
255define(`_OPTINS', `ifdef(`$1', `$2$1$3')')
256
257
258m4wrap(`include(_CF_DIR_`m4/proto.m4')')
259
260# default location for files
261ifdef(`MAIL_SETTINGS_DIR', , `define(`MAIL_SETTINGS_DIR', `/etc/mail/')')
262
263# set our default hashed database type
264define(`DATABASE_MAP_TYPE', `hash')
265
266# set up default values for options
267define(`ALIAS_FILE', `MAIL_SETTINGS_DIR`'aliases')
268define(`confMAILER_NAME', ``MAILER-DAEMON'')
269define(`confFROM_LINE', `From $g $d')
270define(`confOPERATORS', `.:%@!^/[]+')
271define(`confSMTP_LOGIN_MSG', `$j Sendmail $v/$Z; $b')
272define(`_REC_AUTH_', `$.$?{auth_type}(authenticated')
273define(`_REC_FULL_AUTH_', `$.$?{auth_type}(user=${auth_authen} $?{auth_author}author=${auth_author} $.mech=${auth_type}')
274define(`_REC_HDR_', `$?sfrom $s $.$?_($?s$|from $.$_)')
275define(`_REC_END_', `for $u; $|;
276	$.$b')
277define(`_REC_TLS_', `(version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify})$.$?u')
278define(`_REC_BY_', `$.by $j ($v/$Z)$?r with $r$. id $i$?{tls_version}')
279define(`confRECEIVED_HEADER', `_REC_HDR_
280	_REC_AUTH_$?{auth_ssf} bits=${auth_ssf}$.)
281	_REC_BY_
282	_REC_TLS_
283	_REC_END_')
284define(`confSEVEN_BIT_INPUT', `False')
285define(`confALIAS_WAIT', `10')
286define(`confMIN_FREE_BLOCKS', `100')
287define(`confBLANK_SUB', `.')
288define(`confCON_EXPENSIVE', `False')
289define(`confDELIVERY_MODE', `background')
290define(`confTEMP_FILE_MODE', `0600')
291define(`confMCI_CACHE_SIZE', `2')
292define(`confMCI_CACHE_TIMEOUT', `5m')
293define(`confUSE_ERRORS_TO', `False')
294define(`confLOG_LEVEL', `9')
295define(`confCHECK_ALIASES', `False')
296define(`confOLD_STYLE_HEADERS', `True')
297define(`confPRIVACY_FLAGS', `authwarnings')
298define(`confSAFE_QUEUE', `True')
299define(`confTO_QUEUERETURN', `5d')
300define(`confTO_QUEUEWARN', `4h')
301define(`confTIME_ZONE', `USE_SYSTEM')
302define(`confCW_FILE', `MAIL_SETTINGS_DIR`'local-host-names')
303define(`confMIME_FORMAT_ERRORS', `True')
304define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward')
305define(`confCR_FILE', `-o MAIL_SETTINGS_DIR`'relay-domains')
306define(`confMILTER_MACROS_CONNECT', ``j, _, {daemon_name}, {if_name}, {if_addr}'')
307define(`confMILTER_MACROS_HELO', ``{tls_version}, {cipher}, {cipher_bits}, {cert_subject}, {cert_issuer}'')
308define(`confMILTER_MACROS_ENVFROM', ``i, {auth_type}, {auth_authen}, {auth_ssf}, {auth_author}, {mail_mailer}, {mail_host}, {mail_addr}'')
309define(`confMILTER_MACROS_ENVRCPT', ``{rcpt_mailer}, {rcpt_host}, {rcpt_addr}'')
310define(`confMILTER_MACROS_EOM', `{msg_id}')
311
312
313divert(0)dnl
314VERSIONID(`$Id: cfhead.m4,v 8.120 2009/01/23 22:39:21 ca Exp $')
315