This commit was manufactured by cvs2svn to create tag 'FreeBSD-release/1.1'.
[unix-history] / usr.sbin / sendmail / cf / mailer / uucp.m4
CommitLineData
6f14531a
RG
1PUSHDIVERT(-1)
2#
3# Copyright (c) 1983 Eric P. Allman
4# Copyright (c) 1988, 1993
5# The Regents of the University of California. All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions
9# are met:
10# 1. Redistributions of source code must retain the above copyright
11# notice, this list of conditions and the following disclaimer.
12# 2. Redistributions in binary form must reproduce the above copyright
13# notice, this list of conditions and the following disclaimer in the
14# documentation and/or other materials provided with the distribution.
15# 3. All advertising materials mentioning features or use of this software
16# must display the following acknowledgement:
17# This product includes software developed by the University of
18# California, Berkeley and its contributors.
19# 4. Neither the name of the University nor the names of its contributors
20# may be used to endorse or promote products derived from this software
21# without specific prior written permission.
22#
23# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33# SUCH DAMAGE.
34#
35
36ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')
c2714ef5 37ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$f -gC $h!rmail ($u)')')
6f14531a 38ifdef(`UUCP_MAILER_FLAGS',, `define(`UUCP_MAILER_FLAGS', `')')
3a363396 39ifdef(`UUCP_MAX_SIZE',, `define(`UUCP_MAX_SIZE', 100000)')
6f14531a
RG
40POPDIVERT
41#####################################
42### UUCP Mailer specification ###
43#####################################
44
c2714ef5 45VERSIONID(`@(#)uucp.m4 8.15 (Berkeley) 2/16/94')
6f14531a 46
042b8fbf
AM
47#
48# There are innumerable variations on the UUCP mailer. It really
49# is rather absurd.
50#
51
52# old UUCP mailer (two names)
3a363396
NW
53Muucp, P=UUCP_MAILER_PATH, F=CONCAT(DFMhuU, UUCP_MAILER_FLAGS), S=12, R=22, M=UUCP_MAX_SIZE,
54 A=UUCP_MAILER_ARGS
042b8fbf
AM
55Muucp-old, P=UUCP_MAILER_PATH, F=CONCAT(DFMhuU, UUCP_MAILER_FLAGS), S=12, R=22, M=UUCP_MAX_SIZE,
56 A=UUCP_MAILER_ARGS
3a363396 57
042b8fbf 58# smart UUCP mailer (handles multiple addresses) (two names)
3a363396
NW
59Msuucp, P=UUCP_MAILER_PATH, F=CONCAT(mDFMhuU, UUCP_MAILER_FLAGS), S=12, R=22, M=UUCP_MAX_SIZE,
60 A=UUCP_MAILER_ARGS
042b8fbf
AM
61Muucp-new, P=UUCP_MAILER_PATH, F=CONCAT(mDFMhuU, UUCP_MAILER_FLAGS), S=12, R=22, M=UUCP_MAX_SIZE,
62 A=UUCP_MAILER_ARGS
3a363396
NW
63
64ifdef(`_MAILER_smtp_',
65`# domain-ized UUCP mailer
69fc843f 66Muucp-dom, P=UUCP_MAILER_PATH, F=CONCAT(mDFMhu, UUCP_MAILER_FLAGS), S=52/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), M=UUCP_MAX_SIZE,
042b8fbf
AM
67 A=UUCP_MAILER_ARGS
68
69# domain-ized UUCP mailer with UUCP-style sender envelope
70Muucp-uudom, P=UUCP_MAILER_PATH, F=CONCAT(mDFMhu, UUCP_MAILER_FLAGS), S=72/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), M=UUCP_MAX_SIZE,
3a363396 71 A=UUCP_MAILER_ARGS')
6f14531a 72
6f14531a 73
69fc843f
AM
74#
75# envelope and header sender rewriting
76#
6f14531a
RG
77S12
78
79# handle error address as a special case
80R<@> $n errors to mailer-daemon
81
3a363396 82# do not qualify list:; syntax
6f14531a
RG
83R$* :; <@> $@ $1 :;
84
85R$* < @ $* . > $1 < @ $2 > strip trailing dots
042b8fbf
AM
86R$* < @ $=w > $1 strip local name
87R<@ $- . UUCP > : $+ $1 ! $2 convert to UUCP format
88R<@ $+ > : $+ $1 ! $2 convert to UUCP format
6f14531a
RG
89R$* < @ $- . UUCP > $2 ! $1 convert to UUCP format
90R$* < @ $+ > $2 ! $1 convert to UUCP format
042b8fbf
AM
91R$&h ! $+ ! $+ $@ $1 ! $2 $h!...!user => ...!user
92R$&h ! $+ $@ $&h ! $1 $h!user => $h!user
3a363396 93R$+ $: $U ! $1 prepend our name
042b8fbf 94R! $+ $: $k ! $1 in case $U undefined
6f14531a 95
69fc843f
AM
96#
97# envelope and header recipient rewriting
98#
6f14531a
RG
99S22
100
101# don't touch list:; syntax
042b8fbf 102R$* :; <@> $@ $1 :;
6f14531a
RG
103
104R$* < @ $* . > $1 < @ $2 > strip trailing dots
105R$* < @ $j > $1 strip local name
042b8fbf
AM
106R<@ $- . UUCP > : $+ $1 ! $2 convert to UUCP format
107R<@ $+ > : $+ $1 ! $2 convert to UUCP format
6f14531a
RG
108R$* < @ $- . UUCP > $2 ! $1 convert to UUCP format
109R$* < @ $+ > $2 ! $1 convert to UUCP format
042b8fbf
AM
110R$&h ! $+ ! $+ $@ $1 ! $2 $h!...!user => ...!user
111R$&h ! $+ $@ $&h ! $1 $h!user => $h!user
112R$+ $: $U ! $1 prepend our name
113R! $+ $: $k ! $1 in case $U undefined
6f14531a 114
69fc843f 115
042b8fbf
AM
116ifdef(`_MAILER_smtp_',
117`#
69fc843f
AM
118# envelope sender rewriting for uucp-dom mailer
119#
120S52
121
122# handle error address as a special case
123R<@> $n errors to mailer-daemon
124
125# pass everything to standard SMTP mailer rewriting
126R$* $@ $>11 $1
127
042b8fbf
AM
128#
129# envelope sender rewriting for uucp-uudom mailer
130#
131S72
132
133# handle error address as a special case
134R<@> $n errors to mailer-daemon
135
136# do not qualify list:; syntax
137R$* :; <@> $@ $1 :;
138
139R$* < @ $* . > $1 < @ $2 > strip trailing dots
140R$* < @ $=w > $1 strip local name
141R<@ $- . UUCP > : $+ $1 ! $2 convert to UUCP format
142R<@ $+ > : $+ $1 ! $2 convert to UUCP format
143R$* < @ $- . UUCP > $2 ! $1 convert to UUCP format
144R$* < @ $+ > $@ $2 ! $1 convert to UUCP format
145
146R$&h ! $+ ! $+ $@ $1 ! $2 $h!...!user => ...!user
147R$&h ! $+ $@ $&h ! $1 $h!user => $h!user
148R$+ $: $M ! $1 prepend masquerade name
149R! $+ $: $j ! $1 in case $M undefined')
150
69fc843f 151
6f14531a
RG
152PUSHDIVERT(4)
153# resolve locally connected UUCP links
c2714ef5 154R$* < @ $=Z . UUCP. > $* $#uucp-uudom $@ $2 $: $1 < @ $2 .UUCP. > $3
042b8fbf
AM
155R$* < @ $=Y . UUCP. > $* $#uucp-new $@ $2 $: $1 < @ $2 .UUCP. > $3
156R$* < @ $=U . UUCP. > $* $#uucp-old $@ $2 $: $1 < @ $2 .UUCP. > $3
6f14531a 157POPDIVERT