xref: /titanic_41/usr/src/cmd/sendmail/cf/mailer/uucp.m4 (revision bdb9230ac765cb7af3fc1f4119caf2c5720dceb3)
1PUSHDIVERT(-1)
2#
3# Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
4#	All rights reserved.
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.
8#
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.
12#
13#ident	"%Z%%M%	%I%	%E% SMI"
14#
15
16ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')
17ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g -gC $h!rmail ($u)')')
18_DEFIFNOT(`UUCP_MAILER_FLAGS', `')
19ifdef(`UUCP_MAILER_MAX',,
20	`define(`UUCP_MAILER_MAX',
21		`ifdef(`UUCP_MAX_SIZE', `UUCP_MAX_SIZE', 100000)')')
22define(`_UUCP_QGRP', `ifelse(defn(`UUCP_MAILER_QGRP'),`',`', ` Q=UUCP_MAILER_QGRP,')')dnl
23POPDIVERT
24#####################################
25###   UUCP Mailer specification   ###
26#####################################
27
28VERSIONID(`$Id: uucp.m4,v 8.44 2001/08/24 19:49:08 ca Exp $')
29
30#
31#  envelope and header sender rewriting
32#
33SFromU
34
35# handle error address as a special case
36R<@>				$n			errors to mailer-daemon
37
38# list:; syntax should disappear
39R:; <@>				$@
40
41R$* < @ $* . > $*		$1 < @ $2 > $3		strip trailing dots
42R$* < @ $=w >			$1			strip local name
43R<@ $- . UUCP > : $+		$1 ! $2			convert to UUCP format
44R<@ $+ > : $+			$1 ! $2			convert to UUCP format
45R$* < @ $- . UUCP >		$2 ! $1			convert to UUCP format
46R$* < @ $+ >			$2 ! $1			convert to UUCP format
47R$&h ! $+ ! $+			$@ $1 ! $2		$h!...!user => ...!user
48R$&h ! $+			$@ $&h ! $1		$h!user => $h!user
49R$+				$: $U ! $1		prepend our name
50R! $+				$: $k ! $1		in case $U undefined
51
52#
53#  envelope recipient rewriting
54#
55SEnvToU
56
57# list:; should disappear
58R:; <@>				$@
59
60R$* < @ $* . > $*		$1 < @ $2 > $3		strip trailing dots
61R$* < @ $=w >			$1			strip local name
62R<@ $- . UUCP > : $+		$1 ! $2			convert to UUCP format
63R<@ $+ > : $+			$1 ! $2			convert to UUCP format
64R$* < @ $- . UUCP >		$2 ! $1			convert to UUCP format
65R$* < @ $+ >			$2 ! $1			convert to UUCP format
66
67#
68#  header recipient rewriting
69#
70SHdrToU
71
72# list:; syntax should disappear
73R:; <@>				$@
74
75R$* < @ $* . > $*		$1 < @ $2 > $3		strip trailing dots
76R$* < @ $=w >			$1			strip local name
77R<@ $- . UUCP > : $+		$1 ! $2			convert to UUCP format
78R<@ $+ > : $+			$1 ! $2			convert to UUCP format
79R$* < @ $- . UUCP >		$2 ! $1			convert to UUCP format
80R$* < @ $+ >			$2 ! $1			convert to UUCP format
81R$&h ! $+ ! $+			$@ $1 ! $2		$h!...!user => ...!user
82R$&h ! $+			$@ $&h ! $1		$h!user => $h!user
83R$+				$: $U ! $1		prepend our name
84R! $+				$: $k ! $1		in case $U undefined
85
86
87ifdef(`_MAILER_smtp_',
88`#
89#  envelope sender rewriting for uucp-dom mailer
90#
91SEnvFromUD
92
93# handle error address as a special case
94R<@>				$n			errors to mailer-daemon
95
96# pass everything to standard SMTP mailer rewriting
97R$*				$@ $>EnvFromSMTP $1
98
99#
100#  envelope sender rewriting for uucp-uudom mailer
101#
102SEnvFromUUD
103
104# handle error address as a special case
105R<@>				$n			errors to mailer-daemon
106
107# do standard SMTP mailer rewriting
108R$*				$: $>EnvFromSMTP $1
109
110R$* < @ $* . > $*		$1 < @ $2 > $3		strip trailing dots
111R<@ $- . UUCP > : $+		$@ $1 ! $2		convert to UUCP format
112R<@ $+ > : $+			$@ $1 ! $2		convert to UUCP format
113R$* < @ $- . UUCP >		$@ $2 ! $1		convert to UUCP format
114R$* < @ $+ >			$@ $2 ! $1		convert to UUCP format',
115`errprint(`*** MAILER(`smtp') must appear before MAILER(`uucp')
116    if uucp-dom should be included.')
117')
118
119PUSHDIVERT(4)
120# resolve locally connected UUCP links
121R$* < @ $=Z . UUCP. > $*	$#uucp-uudom $@ $2 $: $1 < @ $2 .UUCP. > $3
122R$* < @ $=Y . UUCP. > $*	$#uucp-new $@ $2 $: $1 < @ $2 .UUCP. > $3
123R$* < @ $=U . UUCP. > $*	$#uucp-old $@ $2 $: $1 < @ $2 .UUCP. > $3
124POPDIVERT
125
126#
127#  There are innumerable variations on the UUCP mailer.  It really
128#  is rather absurd.
129#
130
131# old UUCP mailer (two names)
132Muucp,		P=UUCP_MAILER_PATH, F=_MODMF_(CONCAT(`DFMhuUd', UUCP_MAILER_FLAGS), `UUCP'), S=FromU, R=EnvToU/HdrToU,
133		M=UUCP_MAILER_MAX, _OPTINS(`UUCP_MAILER_CHARSET', `C=', `, ')T=X-UUCP/X-UUCP/X-Unix,_UUCP_QGRP
134		A=UUCP_MAILER_ARGS
135Muucp-old,	P=UUCP_MAILER_PATH, F=_MODMF_(CONCAT(`DFMhuUd', UUCP_MAILER_FLAGS), `UUCP'), S=FromU, R=EnvToU/HdrToU,
136		M=UUCP_MAILER_MAX, _OPTINS(`UUCP_MAILER_CHARSET', `C=', `, ')T=X-UUCP/X-UUCP/X-Unix,_UUCP_QGRP
137		A=UUCP_MAILER_ARGS
138
139# smart UUCP mailer (handles multiple addresses) (two names)
140Msuucp,		P=UUCP_MAILER_PATH, F=_MODMF_(CONCAT(`mDFMhuUd', UUCP_MAILER_FLAGS), `UUCP'), S=FromU, R=EnvToU/HdrToU,
141		M=UUCP_MAILER_MAX, _OPTINS(`UUCP_MAILER_CHARSET', `C=', `, ')T=X-UUCP/X-UUCP/X-Unix,_UUCP_QGRP
142		A=UUCP_MAILER_ARGS
143Muucp-new,	P=UUCP_MAILER_PATH, F=_MODMF_(CONCAT(`mDFMhuUd', UUCP_MAILER_FLAGS), `UUCP'), S=FromU, R=EnvToU/HdrToU,
144		M=UUCP_MAILER_MAX, _OPTINS(`UUCP_MAILER_CHARSET', `C=', `, ')T=X-UUCP/X-UUCP/X-Unix,_UUCP_QGRP
145		A=UUCP_MAILER_ARGS
146
147ifdef(`_MAILER_smtp_',
148`# domain-ized UUCP mailer
149Muucp-dom,	P=UUCP_MAILER_PATH, F=_MODMF_(CONCAT(`mDFMhud', UUCP_MAILER_FLAGS), `UUCP'), S=EnvFromUD/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `EnvToSMTP/HdrFromSMTP', `EnvToSMTP'),
150		M=UUCP_MAILER_MAX, _OPTINS(`UUCP_MAILER_CHARSET', `C=', `, ')T=X-UUCP/X-UUCP/X-Unix,_UUCP_QGRP
151		A=UUCP_MAILER_ARGS
152
153# domain-ized UUCP mailer with UUCP-style sender envelope
154Muucp-uudom,	P=UUCP_MAILER_PATH, F=_MODMF_(CONCAT(`mDFMhud', UUCP_MAILER_FLAGS), `UUCP'), S=EnvFromUUD/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `EnvToSMTP/HdrFromSMTP', `EnvToSMTP'),
155		M=UUCP_MAILER_MAX, _OPTINS(`UUCP_MAILER_CHARSET', `C=', `, ')T=X-UUCP/X-UUCP/X-Unix,_UUCP_QGRP
156		A=UUCP_MAILER_ARGS')
157
158
159