138032SpeterPUSHDIVERT(-1) 238032Speter# 3141858Sgshapiro# Copyright (c) 1998-2000, 2004 Sendmail, Inc. and its suppliers. 464562Sgshapiro# All rights reserved. 538032Speter# Copyright (c) 1983 Eric P. Allman. All rights reserved. 638032Speter# Copyright (c) 1988, 1993 738032Speter# The Regents of the University of California. All rights reserved. 838032Speter# 938032Speter# By using this file, you agree to the terms and conditions set 1038032Speter# forth in the LICENSE file which can be found at the top level of 1138032Speter# the sendmail distribution. 1238032Speter# 1338032Speter# 1464562Sgshapiro_DEFIFNOT(`_DEF_LOCAL_MAILER_FLAGS', `lsDFMAw5:/|@q') 1564562Sgshapiro_DEFIFNOT(`LOCAL_MAILER_FLAGS', `Prmn9') 1638032Speterifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /bin/mail)') 1738032Speterifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail -d $u')') 1864562Sgshapiroifdef(`LOCAL_MAILER_DSN_DIAGNOSTIC_CODE',, `define(`LOCAL_MAILER_DSN_DIAGNOSTIC_CODE', `X-Unix')') 1964562Sgshapiro_DEFIFNOT(`_DEF_LOCAL_SHELL_FLAGS', `lsDFMoq') 2064562Sgshapiro_DEFIFNOT(`LOCAL_SHELL_FLAGS', `eu9') 2138032Speterifdef(`LOCAL_SHELL_PATH',, `define(`LOCAL_SHELL_PATH', /bin/sh)') 2238032Speterifdef(`LOCAL_SHELL_ARGS',, `define(`LOCAL_SHELL_ARGS', `sh -c $u')') 2338032Speterifdef(`LOCAL_SHELL_DIR',, `define(`LOCAL_SHELL_DIR', `$z:/')') 2490792Sgshapirodefine(`LOCAL_RWR', `ifdef(`_LOCAL_LMTP_', 2590792Sgshapiro`S=EnvFromSMTP/HdrFromL, R=EnvToL/HdrToL', 2690792Sgshapiro`S=EnvFromL/HdrFromL, R=EnvToL/HdrToL')') 2790792Sgshapirodefine(`_LOCAL_QGRP', `ifelse(defn(`LOCAL_MAILER_QGRP'),`',`', ` Q=LOCAL_MAILER_QGRP,')')dnl 2890792Sgshapirodefine(`_PROG_QGRP', `ifelse(defn(`LOCAL_PROG_QGRP'),`',`', ` Q=LOCAL_PROG_QGRP,')')dnl 2938032SpeterPOPDIVERT 3038032Speter 3138032Speter################################################## 3238032Speter### Local and Program Mailer specification ### 3338032Speter################################################## 3438032Speter 35141858SgshapiroVERSIONID(`$Id: local.m4,v 8.59 2004/11/23 00:37:25 ca Exp $') 3638032Speter 3738032Speter# 3838032Speter# Envelope sender rewriting 3938032Speter# 4090792SgshapiroSEnvFromL 4138032SpeterR<@> $n errors to mailer-daemon 4238032SpeterR@ <@ $*> $n temporarily bypass Sun bogosity 4364562SgshapiroR$+ $: $>AddDomain $1 add local domain if needed 4490792Sgshapiroifdef(`_LOCAL_NO_MASQUERADE_', `dnl', `dnl 4590792SgshapiroR$* $: $>MasqEnv $1 do masquerading') 4638032Speter 4738032Speter# 4838032Speter# Envelope recipient rewriting 4938032Speter# 5090792SgshapiroSEnvToL 5138032SpeterR$+ < @ $* > $: $1 strip host part 5290792Sgshapiroifdef(`confUSERDB_SPEC', `dnl', `dnl 5364562SgshapiroR$+ + $* $: < $&{addr_type} > $1 + $2 mark with addr type 5464562SgshapiroR<e s> $+ + $* $: $1 remove +detail for sender 5590792SgshapiroR< $* > $+ $: $2 else remove mark') 5638032Speter 5738032Speter# 5838032Speter# Header sender rewriting 5938032Speter# 6090792SgshapiroSHdrFromL 6138032SpeterR<@> $n errors to mailer-daemon 6238032SpeterR@ <@ $*> $n temporarily bypass Sun bogosity 6364562SgshapiroR$+ $: $>AddDomain $1 add local domain if needed 6490792Sgshapiroifdef(`_LOCAL_NO_MASQUERADE_', `dnl', `dnl 6590792SgshapiroR$* $: $>MasqHdr $1 do masquerading') 6638032Speter 6738032Speter# 6838032Speter# Header recipient rewriting 6938032Speter# 7090792SgshapiroSHdrToL 7164562SgshapiroR$+ $: $>AddDomain $1 add local domain if needed 7290792Sgshapiroifdef(`_ALL_MASQUERADE_', `dnl 7390792Sgshapiroifdef(`_LOCAL_NO_MASQUERADE_', `dnl', `dnl 7490792SgshapiroR$* $: $>MasqHdr $1 do all-masquerading')', 7564562Sgshapiro`R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2') 7638032Speter 7738032Speter# 7838032Speter# Common code to add local domain name (only if always-add-domain) 7938032Speter# 8090792SgshapiroSAddDomain 8138032Speterifdef(`_ALWAYS_ADD_DOMAIN_', `dnl 8264562SgshapiroR$* < @ $* > $* $@ $1 < @ $2 > $3 already fully qualified 8390792Sgshapiroifelse(len(X`'_ALWAYS_ADD_DOMAIN_),`1',` 8464562SgshapiroR$+ $@ $1 < @ *LOCAL* > add local qualification', 8590792Sgshapiro`R$+ $@ $1 < @ _ALWAYS_ADD_DOMAIN_ > add qualification')', 8638032Speter`dnl') 8764562Sgshapiro 8890792SgshapiroMlocal, P=LOCAL_MAILER_PATH, F=_MODMF_(CONCAT(_DEF_LOCAL_MAILER_FLAGS, LOCAL_MAILER_FLAGS), `LOCAL'), LOCAL_RWR,_OPTINS(`LOCAL_MAILER_EOL', ` E=', `, ') 8990792Sgshapiro _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 9064562Sgshapiro A=LOCAL_MAILER_ARGS 91141858SgshapiroMprog, 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, 9290792Sgshapiro _OPTINS(`LOCAL_MAILER_MAX', `M=', `, ')T=X-Unix/X-Unix/X-Unix,_PROG_QGRP 9364562Sgshapiro A=LOCAL_SHELL_ARGS 94