xref: /onnv-gate/usr/src/cmd/sendmail/cf/mailer/local.m4 (revision 0:68f95e015346)
1*0Sstevel@tonic-gatePUSHDIVERT(-1)
2*0Sstevel@tonic-gate#
3*0Sstevel@tonic-gate# Copyright (c) 1998-2000, 2004 Sendmail, Inc. and its suppliers.
4*0Sstevel@tonic-gate#	All rights reserved.
5*0Sstevel@tonic-gate# Copyright (c) 1983 Eric P. Allman.  All rights reserved.
6*0Sstevel@tonic-gate# Copyright (c) 1988, 1993
7*0Sstevel@tonic-gate#	The Regents of the University of California.  All rights reserved.
8*0Sstevel@tonic-gate#
9*0Sstevel@tonic-gate# By using this file, you agree to the terms and conditions set
10*0Sstevel@tonic-gate# forth in the LICENSE file which can be found at the top level of
11*0Sstevel@tonic-gate# the sendmail distribution.
12*0Sstevel@tonic-gate#
13*0Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
14*0Sstevel@tonic-gate#
15*0Sstevel@tonic-gate_DEFIFNOT(`_DEF_LOCAL_MAILER_FLAGS', `lsDFMAw5:/|@q')
16*0Sstevel@tonic-gate_DEFIFNOT(`LOCAL_MAILER_FLAGS', `Prmn9')
17*0Sstevel@tonic-gateifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /bin/mail)')
18*0Sstevel@tonic-gateifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail -d $u')')
19*0Sstevel@tonic-gateifdef(`LOCAL_MAILER_DSN_DIAGNOSTIC_CODE',, `define(`LOCAL_MAILER_DSN_DIAGNOSTIC_CODE', `X-Unix')')
20*0Sstevel@tonic-gate_DEFIFNOT(`_DEF_LOCAL_SHELL_FLAGS', `lsDFMoq')
21*0Sstevel@tonic-gate_DEFIFNOT(`LOCAL_SHELL_FLAGS', `eu9')
22*0Sstevel@tonic-gateifdef(`LOCAL_SHELL_PATH',, `define(`LOCAL_SHELL_PATH', /bin/sh)')
23*0Sstevel@tonic-gateifdef(`LOCAL_SHELL_ARGS',, `define(`LOCAL_SHELL_ARGS', `sh -c $u')')
24*0Sstevel@tonic-gateifdef(`LOCAL_SHELL_DIR',, `define(`LOCAL_SHELL_DIR', `$z:/')')
25*0Sstevel@tonic-gatedefine(`LOCAL_RWR', `ifdef(`_LOCAL_LMTP_',
26*0Sstevel@tonic-gate`S=EnvFromSMTP/HdrFromL, R=EnvToL/HdrToL',
27*0Sstevel@tonic-gate`S=EnvFromL/HdrFromL, R=EnvToL/HdrToL')')
28*0Sstevel@tonic-gatedefine(`_LOCAL_QGRP', `ifelse(defn(`LOCAL_MAILER_QGRP'),`',`', ` Q=LOCAL_MAILER_QGRP,')')dnl
29*0Sstevel@tonic-gatedefine(`_PROG_QGRP', `ifelse(defn(`LOCAL_PROG_QGRP'),`',`', ` Q=LOCAL_PROG_QGRP,')')dnl
30*0Sstevel@tonic-gatePOPDIVERT
31*0Sstevel@tonic-gate
32*0Sstevel@tonic-gate##################################################
33*0Sstevel@tonic-gate###   Local and Program Mailer specification   ###
34*0Sstevel@tonic-gate##################################################
35*0Sstevel@tonic-gate
36*0Sstevel@tonic-gateVERSIONID(`$Id: local.m4,v 8.59 2004/11/23 00:37:25 ca Exp $')
37*0Sstevel@tonic-gate
38*0Sstevel@tonic-gate#
39*0Sstevel@tonic-gate#  Envelope sender rewriting
40*0Sstevel@tonic-gate#
41*0Sstevel@tonic-gateSEnvFromL
42*0Sstevel@tonic-gateR<@>			$n			errors to mailer-daemon
43*0Sstevel@tonic-gateR@ <@ $*>		$n			temporarily bypass Sun bogosity
44*0Sstevel@tonic-gateR$+			$: $>AddDomain $1	add local domain if needed
45*0Sstevel@tonic-gateifdef(`_LOCAL_NO_MASQUERADE_', `dnl', `dnl
46*0Sstevel@tonic-gateR$*			$: $>MasqEnv $1		do masquerading')
47*0Sstevel@tonic-gate
48*0Sstevel@tonic-gate#
49*0Sstevel@tonic-gate#  Envelope recipient rewriting
50*0Sstevel@tonic-gate#
51*0Sstevel@tonic-gateSEnvToL
52*0Sstevel@tonic-gateR$+ < @ $* >		$: $1			strip host part
53*0Sstevel@tonic-gateifdef(`confUSERDB_SPEC', `dnl', `dnl
54*0Sstevel@tonic-gateR$+ + $*		$: < $&{addr_type} > $1 + $2	mark with addr type
55*0Sstevel@tonic-gateR<e s> $+ + $*		$: $1			remove +detail for sender
56*0Sstevel@tonic-gateR< $* > $+		$: $2			else remove mark')
57*0Sstevel@tonic-gate
58*0Sstevel@tonic-gate#
59*0Sstevel@tonic-gate#  Header sender rewriting
60*0Sstevel@tonic-gate#
61*0Sstevel@tonic-gateSHdrFromL
62*0Sstevel@tonic-gateR<@>			$n			errors to mailer-daemon
63*0Sstevel@tonic-gateR@ <@ $*>		$n			temporarily bypass Sun bogosity
64*0Sstevel@tonic-gateR$+			$: $>AddDomain $1	add local domain if needed
65*0Sstevel@tonic-gateifdef(`_LOCAL_NO_MASQUERADE_', `dnl', `dnl
66*0Sstevel@tonic-gateR$*			$: $>MasqHdr $1		do masquerading')
67*0Sstevel@tonic-gate
68*0Sstevel@tonic-gate#
69*0Sstevel@tonic-gate#  Header recipient rewriting
70*0Sstevel@tonic-gate#
71*0Sstevel@tonic-gateSHdrToL
72*0Sstevel@tonic-gateR$+			$: $>AddDomain $1	add local domain if needed
73*0Sstevel@tonic-gateifdef(`_ALL_MASQUERADE_', `dnl
74*0Sstevel@tonic-gateifdef(`_LOCAL_NO_MASQUERADE_', `dnl', `dnl
75*0Sstevel@tonic-gateR$*			$: $>MasqHdr $1		do all-masquerading')',
76*0Sstevel@tonic-gate`R$* < @ *LOCAL* > $*	$: $1 < @ $j . > $2')
77*0Sstevel@tonic-gate
78*0Sstevel@tonic-gate#
79*0Sstevel@tonic-gate#  Common code to add local domain name (only if always-add-domain)
80*0Sstevel@tonic-gate#
81*0Sstevel@tonic-gateSAddDomain
82*0Sstevel@tonic-gateifdef(`_ALWAYS_ADD_DOMAIN_', `dnl
83*0Sstevel@tonic-gateR$* < @ $* > $* 	$@ $1 < @ $2 > $3	already fully qualified
84*0Sstevel@tonic-gateifelse(len(X`'_ALWAYS_ADD_DOMAIN_),`1',`
85*0Sstevel@tonic-gateR$+			$@ $1 < @ *LOCAL* >	add local qualification',
86*0Sstevel@tonic-gate`R$+			$@ $1 < @ _ALWAYS_ADD_DOMAIN_ >	add qualification')',
87*0Sstevel@tonic-gate`dnl')
88*0Sstevel@tonic-gate
89*0Sstevel@tonic-gateMlocal,		P=LOCAL_MAILER_PATH, F=_MODMF_(CONCAT(_DEF_LOCAL_MAILER_FLAGS, LOCAL_MAILER_FLAGS), `LOCAL'), LOCAL_RWR,_OPTINS(`LOCAL_MAILER_EOL', ` E=', `, ')
90*0Sstevel@tonic-gate		_OPTINS(`LOCAL_MAILER_MAX', `M=', `, ')_OPTINS(`LOCAL_MAILER_MAXMSGS', `m=', `, ')_OPTINS(`LOCAL_MAILER_MAXRCPTS', `r=', `, ')_OPTINS(`LOCAL_MAILER_CHARSET', `C=', `, ')T=DNS/RFC822/LOCAL_MAILER_DSN_DIAGNOSTIC_CODE,_LOCAL_QGRP
91*0Sstevel@tonic-gate		A=LOCAL_MAILER_ARGS
92*0Sstevel@tonic-gateMprog,		P=LOCAL_SHELL_PATH, F=_MODMF_(CONCAT(_DEF_LOCAL_SHELL_FLAGS, LOCAL_SHELL_FLAGS), `SHELL'), S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, D=LOCAL_SHELL_DIR,
93*0Sstevel@tonic-gate		_OPTINS(`LOCAL_MAILER_MAX', `M=', `, ')T=X-Unix/X-Unix/X-Unix,_PROG_QGRP
94*0Sstevel@tonic-gate		A=LOCAL_SHELL_ARGS
95