3 # Copyright (c) 1998-2000, 2004 Sendmail, Inc. and its suppliers.
5 # Copyright (c) 1983 Eric P. Allman. All rights reserved.
6 # Copyright (c) 1988, 1993
7 # The Regents of the University of California. All rights reserved.
9 # By using this file, you agree to the terms and conditions set
10 # forth in the LICENSE file which can be found at the top level of
11 # the sendmail distribution.
13 # ident "%Z%%M% %I% %E% SMI"
15 _DEFIFNOT(`_DEF_LOCAL_MAILER_FLAGS', `lsDFMAw5:/|@q')
16 _DEFIFNOT(`LOCAL_MAILER_FLAGS', `Prmn9')
17 ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /bin/mail)')
18 ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail -d $u')')
19 ifdef(`LOCAL_MAILER_DSN_DIAGNOSTIC_CODE',, `define(`LOCAL_MAILER_DSN_DIAGNOSTIC_CODE', `X-Unix')')
20 _DEFIFNOT(`_DEF_LOCAL_SHELL_FLAGS', `lsDFMoq')
21 _DEFIFNOT(`LOCAL_SHELL_FLAGS', `eu9')
22 ifdef(`LOCAL_SHELL_PATH',, `define(`LOCAL_SHELL_PATH', /bin/sh)')
23 ifdef(`LOCAL_SHELL_ARGS',, `define(`LOCAL_SHELL_ARGS', `sh -c $u')')
24 ifdef(`LOCAL_SHELL_DIR',, `define(`LOCAL_SHELL_DIR', `$z:/')')
25 define(`LOCAL_RWR', `ifdef(`_LOCAL_LMTP_',
26 `S=EnvFromSMTP/HdrFromL, R=EnvToL/HdrToL',
27 `S=EnvFromL/HdrFromL, R=EnvToL/HdrToL')')
28 define(`_LOCAL_QGRP', `ifelse(defn(`LOCAL_MAILER_QGRP'),`',`', ` Q=LOCAL_MAILER_QGRP,')')dnl
29 define(`_PROG_QGRP', `ifelse(defn(`LOCAL_PROG_QGRP'),`',`', ` Q=LOCAL_PROG_QGRP,')')dnl
32 ##################################################
33 ### Local and Program Mailer specification ###
34 ##################################################
36 VERSIONID(`$Id: local.m4,v 8.59 2004/11/23 00:37:25 ca Exp $')
39 # Envelope sender rewriting
42 R<@> $n errors to mailer-daemon
43 R@ <@ $*> $n temporarily bypass Sun bogosity
44 R$+ $: $>AddDomain $1 add local domain if needed
45 ifdef(`_LOCAL_NO_MASQUERADE_', `dnl', `dnl
46 R$* $: $>MasqEnv $1 do masquerading')
49 # Envelope recipient rewriting
52 R$+ < @ $* > $: $1 strip host part
53 ifdef(`confUSERDB_SPEC', `dnl', `dnl
54 R$+ + $* $: < $&{addr_type} > $1 + $2 mark with addr type
55 R<e s> $+ + $* $: $1 remove +detail for sender
56 R< $* > $+ $: $2 else remove mark')
59 # Header sender rewriting
62 R<@> $n errors to mailer-daemon
63 R@ <@ $*> $n temporarily bypass Sun bogosity
64 R$+ $: $>AddDomain $1 add local domain if needed
65 ifdef(`_LOCAL_NO_MASQUERADE_', `dnl', `dnl
66 R$* $: $>MasqHdr $1 do masquerading')
69 # Header recipient rewriting
72 R$+ $: $>AddDomain $1 add local domain if needed
73 ifdef(`_ALL_MASQUERADE_', `dnl
74 ifdef(`_LOCAL_NO_MASQUERADE_', `dnl', `dnl
75 R$* $: $>MasqHdr $1 do all-masquerading')',
76 `R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2')
79 # Common code to add local domain name (only if always-add-domain)
82 ifdef(`_ALWAYS_ADD_DOMAIN_', `dnl
83 R$* < @ $* > $* $@ $1 < @ $2 > $3 already fully qualified
84 ifelse(len(X`'_ALWAYS_ADD_DOMAIN_),`1',`
85 R$+ $@ $1 < @ *LOCAL* > add local qualification',
86 `R$+ $@ $1 < @ _ALWAYS_ADD_DOMAIN_ > add qualification')',
89 Mlocal, P=LOCAL_MAILER_PATH, F=_MODMF_(CONCAT(_DEF_LOCAL_MAILER_FLAGS, LOCAL_MAILER_FLAGS), `LOCAL'), LOCAL_RWR,_OPTINS(`LOCAL_MAILER_EOL', ` E=', `, ')
90 _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
92 Mprog, 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 _OPTINS(`LOCAL_MAILER_MAX', `M=', `, ')T=X-Unix/X-Unix/X-Unix,_PROG_QGRP