summaryrefslogtreecommitdiff
path: root/usr.sbin/sendmail/cf/mailer
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/sendmail/cf/mailer')
-rw-r--r--usr.sbin/sendmail/cf/mailer/fax.m46
-rw-r--r--usr.sbin/sendmail/cf/mailer/local.m416
-rw-r--r--usr.sbin/sendmail/cf/mailer/pop.m453
-rw-r--r--usr.sbin/sendmail/cf/mailer/smtp.m498
-rw-r--r--usr.sbin/sendmail/cf/mailer/usenet.m48
-rw-r--r--usr.sbin/sendmail/cf/mailer/uucp.m490
6 files changed, 213 insertions, 58 deletions
diff --git a/usr.sbin/sendmail/cf/mailer/fax.m4 b/usr.sbin/sendmail/cf/mailer/fax.m4
index 3d9068db981d3..0c98a3bde1967 100644
--- a/usr.sbin/sendmail/cf/mailer/fax.m4
+++ b/usr.sbin/sendmail/cf/mailer/fax.m4
@@ -37,12 +37,14 @@ PUSHDIVERT(-1)
ifdef(`FAX_MAILER_PATH',,
`define(`FAX_MAILER_PATH', /usr/local/lib/fax/mailfax)')
+ifdef(`FAX_MAILER_MAX',,
+ `define(`FAX_MAILER_MAX', 100000)')
POPDIVERT
####################################
### FAX Mailer specification ###
####################################
-VERSIONID(`@(#)fax.m4 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)fax.m4 8.2 (Berkeley) 1/24/94')
-Mfax, P=FAX_MAILER_PATH, F=DFMhu, S=14, R=24, M=100000,
+Mfax, P=FAX_MAILER_PATH, F=DFMhu, S=14, R=24, M=FAX_MAILER_MAX,
A=mailfax $u $h $f
diff --git a/usr.sbin/sendmail/cf/mailer/local.m4 b/usr.sbin/sendmail/cf/mailer/local.m4
index 8c968512660d8..24a820413cb17 100644
--- a/usr.sbin/sendmail/cf/mailer/local.m4
+++ b/usr.sbin/sendmail/cf/mailer/local.m4
@@ -32,8 +32,8 @@ PUSHDIVERT(-1)
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `rn')')
-ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /usr/libexec/mail.local)')
+ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `rmn')')
+ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /bin/mail)')
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail -d $u')')
ifdef(`LOCAL_SHELL_FLAGS',, `define(`LOCAL_SHELL_FLAGS', `eu')')
ifdef(`LOCAL_SHELL_PATH',, `define(`LOCAL_SHELL_PATH', /bin/sh)')
@@ -44,15 +44,21 @@ POPDIVERT
### Local and Program Mailer specification ###
##################################################
-VERSIONID(`@(#)local.m4 8.3 (Berkeley) 7/13/93')
+VERSIONID(`@(#)local.m4 8.6 (Berkeley) 10/24/93')
-Mlocal, P=LOCAL_MAILER_PATH, F=CONCAT(`lsDFMm', LOCAL_MAILER_FLAGS), S=10, R=20,
+Mlocal, P=LOCAL_MAILER_PATH, F=CONCAT(`lsDFM', LOCAL_MAILER_FLAGS), S=10, R=20/40,
A=LOCAL_MAILER_ARGS
-Mprog, P=LOCAL_SHELL_PATH, F=CONCAT(`lsDFM', LOCAL_SHELL_FLAGS), S=10, R=20, D=$z:/,
+Mprog, P=LOCAL_SHELL_PATH, F=CONCAT(`lsDFM', LOCAL_SHELL_FLAGS), S=10, R=20/40, D=$z:/,
A=LOCAL_SHELL_ARGS
S10
R<@> $n errors to mailer-daemon
+R$+ $: $>40 $1
+
+S20
+R$+ < @ $* > $: $1 strip host part
+
+S40
ifdef(`_ALWAYS_ADD_DOMAIN_',
`R$* < @ $* > $* $@ $1 < @ $2 > $3 already fully qualified
R$* $: $1 @ $M add local qualification
diff --git a/usr.sbin/sendmail/cf/mailer/pop.m4 b/usr.sbin/sendmail/cf/mailer/pop.m4
new file mode 100644
index 0000000000000..92bcff9e79071
--- /dev/null
+++ b/usr.sbin/sendmail/cf/mailer/pop.m4
@@ -0,0 +1,53 @@
+PUSHDIVERT(-1)
+#
+# Copyright (c) 1983 Eric P. Allman
+# Copyright (c) 1988, 1993
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+ifdef(`POP_MAILER_PATH',, `define(`POP_MAILER_PATH', /usr/lib/mh/spop)')
+ifdef(`POP_MAILER_FLAGS',, `define(`POP_MAILER_FLAGS', `eu')')
+ifdef(`POP_MAILER_ARGS',, `define(`POP_MAILER_ARGS', `pop $u')')
+
+POPDIVERT
+
+####################################
+### POP Mailer specification ###
+####################################
+
+VERSIONID(`@(#)pop.m4 8.2 (Berkeley) 2/19/94')
+
+Mpop, P=POP_MAILER_PATH, F=CONCAT(`lsDFM', POP_MAILER_FLAGS), S=10, R=20/40,
+ A=POP_MAILER_ARGS
+
+LOCAL_CONFIG
+# POP mailer is a pseudo-domain
+CPPOP
diff --git a/usr.sbin/sendmail/cf/mailer/smtp.m4 b/usr.sbin/sendmail/cf/mailer/smtp.m4
index 9119451e3f1c8..45efbd68a81f5 100644
--- a/usr.sbin/sendmail/cf/mailer/smtp.m4
+++ b/usr.sbin/sendmail/cf/mailer/smtp.m4
@@ -40,57 +40,87 @@ POPDIVERT
### SMTP Mailer specification ###
#####################################
-VERSIONID(`@(#)smtp.m4 8.3 (Berkeley) 7/11/93')
+VERSIONID(`@(#)smtp.m4 8.15 (Berkeley) 2/14/94')
-Msmtp, P=[IPC], F=CONCAT(mDFMueXC, SMTP_MAILER_FLAGS), S=11, R=ifdef(`_ALL_MASQUERADE_', `11', `21'), E=\r\n,
- ifdef(`_OLD_SENDMAIL_',, `L=990, ')A=IPC $h
-Mesmtp, P=[IPC], F=CONCAT(mDFMueXCa, SMTP_MAILER_FLAGS), S=11, R=ifdef(`_ALL_MASQUERADE_', `11', `21'), E=\r\n,
- ifdef(`_OLD_SENDMAIL_',, `L=990, ')A=IPC $h
-Mrelay, P=[IPC], F=CONCAT(mDFMueXCa, SMTP_MAILER_FLAGS), S=11, R=19, E=\r\n,
+Msmtp, P=[IPC], F=CONCAT(mDFMuX, SMTP_MAILER_FLAGS), S=11/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), E=\r\n,
+ ifdef(`_OLD_SENDMAIL_',, `L=990, ')ifdef(`SMTP_MAILER_MAX', `M=SMTP_MAILER_MAX, ')A=IPC $h
+Mesmtp, P=[IPC], F=CONCAT(mDFMuXa, SMTP_MAILER_FLAGS), S=11/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), E=\r\n,
+ ifdef(`_OLD_SENDMAIL_',, `L=990, ')ifdef(`SMTP_MAILER_MAX', `M=SMTP_MAILER_MAX, ')A=IPC $h
+Mrelay, P=[IPC], F=CONCAT(mDFMuXa, SMTP_MAILER_FLAGS), S=11/31, R=61, E=\r\n,
ifdef(`_OLD_SENDMAIL_',, `L=2040, ')A=IPC $h
+#
+# envelope sender and masquerading recipient rewriting
+#
S11
+R$+ $: $>51 $1 sender/recipient common
+R$* :; <@> $@ $1 :; list:; special case
+R$* $@ $>61 $1 qualify unqual'ed names
-# do sender/recipient common rewriting
-R$+ $: $>19 $1
-
-# if already @ qualified, we are done
-R$* < @ $* > $* $@ $1 < @ $2 > $3 already qualified
-
-# do not qualify list:; syntax
-R$* :; <@> $@ $1 :;
-
-# unqualified names (e.g., "eric") "come from" $M
-R$=E $@ $1 < @ $j> show exposed names
-R$+ $: $1 < @ $M > user w/o host
-R$+ <@> $: $1 < @ $j > in case $M undefined
-ifdef(`_ALL_MASQUERADE_', `dnl',
-`S21
+#
+# header recipient rewriting if not masquerading recipients
+#
+S21
# do sender/recipient common rewriting
-R$+ $: $>19 $1
+R$+ $: $>51 $1
-# if already @ qualified, we are done
+# unqualified names (e.g., "eric") are qualified by local host
R$* < @ $* > $* $@ $1 < @ $2 > $3 already qualified
+R$+ $: $1 < @ $j > add local domain
-# do not qualify list:; syntax
-R$* :; <@> $@ $1 :;
-# unqualified names (e.g., "eric") are qualified by local host
-R$+ $: $1 < @ $j >')
+#
+# header sender and masquerading recipient rewriting
+#
+S31
+R$+ $: $>51 $1 sender/recipient common
+R$* :; <@> $@ $1 :; list:; special case
-S19
+# do special header rewriting
+R$* <@> $* $@ $1 <@> $2 pass null host through
+R< @ $* > $* $@ < @ $1 > $2 pass route-addr through
+R$=E < @ $=w . > $@ $1 < @ $2 > exposed user as is
+R$* < @ $=w . > $: $1 < @ $2 @ $M > masquerade as domain
+R$* < @ $+ @ > $@ $1 < @ $2 > in case $M undefined
+R$* < @ $+ @ $+ > $@ $1 < @ $3 > $M is defined -- use it
+R$* $@ $>61 $1 qualify unqual'ed names
+
+
+#
+# convert pseudo-domain addresses to real domain addresses
+#
+S51
# pass <route-addr>s through
R< @ $+ > $* $@ < @ $1 > $2 resolve <route-addr>
# output fake domains as user%fake@relay
ifdef(`BITNET_RELAY',
-`R$+ <@ $+ . BITNET > $: $1 % $2 .BITNET < @ $B > user@host.BITNET',
+`R$+ <@ $+ .BITNET. > $: $1 % $2 .BITNET < @ $B > user@host.BITNET
+R$+.BITNET <@ $+:$+ > $: $1 .BITNET < @ $3 > strip mailer: part',
`dnl')
-ifdef(`CSNET_RELAY',
-`R$+ <@ $+ . CSNET > $: $1 % $2 .CSNET < @ $C > user@host.CSNET',
- `dnl')
-ifdef(`_NO_UUCP_', `dnl',
-`R$+ <@ $+ . UUCP > $: $2 ! $1 < @ $j > user@host.UUCP')
+ifdef(`_NO_UUCP_', `dnl', `
+# do UUCP heuristics; note that these are shared with UUCP mailers
+R$+ < @ $+ .UUCP. > $: < $2 ! > $1 convert to UUCP form
+R$+ < @ $* > $* $@ $1 < @ $2 > $3 not UUCP form
+
+# leave these in .UUCP form to avoid further tampering
+R< $&h ! > $- ! $+ $@ $2 < @ $1 .UUCP. >
+R< $&h ! > $-.$+ ! $+ $@ $3 < @ $1.$2 >
+R< $&h ! > $+ $@ $1 < @ $&h .UUCP. >
+R< $+ ! > $+ $: $1 ! $2 < @ $Y >
+R$+ < @ > $: $1 < @ $j > in case $Y undefined
+R$+ < @ $+ : $+ > $: $1 < @ $3 > strip mailer: part')
+
+
+#
+# common sender and masquerading recipient rewriting
+#
+S61
+
+R$* < @ $* > $* $@ $1 < @ $2 > $3 already qualified
+R$=E $@ $1 < @ $j> show exposed names
+R$+ $: $1 < @ $M > user w/o host
+R$+ <@> $: $1 < @ $j > in case $M undefined
diff --git a/usr.sbin/sendmail/cf/mailer/usenet.m4 b/usr.sbin/sendmail/cf/mailer/usenet.m4
index 4a2fddaae114c..fe6ee3071f8da 100644
--- a/usr.sbin/sendmail/cf/mailer/usenet.m4
+++ b/usr.sbin/sendmail/cf/mailer/usenet.m4
@@ -35,13 +35,13 @@ PUSHDIVERT(-1)
ifdef(`USENET_MAILER_PATH',, `define(`USENET_MAILER_PATH', /usr/lib/news/inews)')
ifdef(`USENET_MAILER_FLAGS',, `define(`USENET_MAILER_FLAGS', `rlsDFMmn')')
-ifdef(`USENET_MAILER_ARGS',, `define(`USENET_MAILER_ARGS', `-m -h -n')')
+ifdef(`USENET_MAILER_ARGS',, `define(`USENET_MAILER_ARGS', `inews -m -h -n')')
POPDIVERT
####################################
### USENET Mailer specification ###
####################################
-VERSIONID(`@(#)usenet.m4 8.1 (Berkeley) 6/7/93')
+VERSIONID(`@(#)usenet.m4 8.3 (Berkeley) 1/24/94')
-Musenet, P=USENET_MAILER_PATH, F=USENET_MAILER_FLAGS, S=10, R=20,
- A=inews USENET_MAILER_ARGS $u
+Musenet, P=USENET_MAILER_PATH, F=USENET_MAILER_FLAGS, S=10, R=20,ifdef(`USENET_MAILER_MAX', ` M=USENET_MAILER_MAX,')
+ A=USENET_MAILER_ARGS $u
diff --git a/usr.sbin/sendmail/cf/mailer/uucp.m4 b/usr.sbin/sendmail/cf/mailer/uucp.m4
index f97e3dcc315b3..517839f1613e8 100644
--- a/usr.sbin/sendmail/cf/mailer/uucp.m4
+++ b/usr.sbin/sendmail/cf/mailer/uucp.m4
@@ -34,7 +34,7 @@ PUSHDIVERT(-1)
#
ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')
-ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -z -a$f -gC $h!rmail ($u)')')
+ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$f -gC $h!rmail ($u)')')
ifdef(`UUCP_MAILER_FLAGS',, `define(`UUCP_MAILER_FLAGS', `')')
ifdef(`UUCP_MAX_SIZE',, `define(`UUCP_MAX_SIZE', 100000)')
POPDIVERT
@@ -42,23 +42,38 @@ POPDIVERT
### UUCP Mailer specification ###
#####################################
-VERSIONID(`@(#)uucp.m4 8.4 (Berkeley) 7/13/93')
+VERSIONID(`@(#)uucp.m4 8.15 (Berkeley) 2/16/94')
-# old UUCP mailer
+#
+# There are innumerable variations on the UUCP mailer. It really
+# is rather absurd.
+#
+
+# old UUCP mailer (two names)
Muucp, P=UUCP_MAILER_PATH, F=CONCAT(DFMhuU, UUCP_MAILER_FLAGS), S=12, R=22, M=UUCP_MAX_SIZE,
A=UUCP_MAILER_ARGS
+Muucp-old, P=UUCP_MAILER_PATH, F=CONCAT(DFMhuU, UUCP_MAILER_FLAGS), S=12, R=22, M=UUCP_MAX_SIZE,
+ A=UUCP_MAILER_ARGS
-# smart UUCP mailer (handles multiple addresses)
+# smart UUCP mailer (handles multiple addresses) (two names)
Msuucp, P=UUCP_MAILER_PATH, F=CONCAT(mDFMhuU, UUCP_MAILER_FLAGS), S=12, R=22, M=UUCP_MAX_SIZE,
A=UUCP_MAILER_ARGS
+Muucp-new, P=UUCP_MAILER_PATH, F=CONCAT(mDFMhuU, UUCP_MAILER_FLAGS), S=12, R=22, M=UUCP_MAX_SIZE,
+ A=UUCP_MAILER_ARGS
ifdef(`_MAILER_smtp_',
`# domain-ized UUCP mailer
-Muucp-dom, P=UUCP_MAILER_PATH, F=CONCAT(mDFMhu, UUCP_MAILER_FLAGS), S=11, R=21, M=UUCP_MAX_SIZE,
+Muucp-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,
+ A=UUCP_MAILER_ARGS
+
+# domain-ized UUCP mailer with UUCP-style sender envelope
+Muucp-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,
A=UUCP_MAILER_ARGS')
-# sender rewriting
+#
+# envelope and header sender rewriting
+#
S12
# handle error address as a special case
@@ -68,26 +83,75 @@ R<@> $n errors to mailer-daemon
R$* :; <@> $@ $1 :;
R$* < @ $* . > $1 < @ $2 > strip trailing dots
-R$* < @ $j > $1 strip local name
+R$* < @ $=w > $1 strip local name
+R<@ $- . UUCP > : $+ $1 ! $2 convert to UUCP format
+R<@ $+ > : $+ $1 ! $2 convert to UUCP format
R$* < @ $- . UUCP > $2 ! $1 convert to UUCP format
R$* < @ $+ > $2 ! $1 convert to UUCP format
+R$&h ! $+ ! $+ $@ $1 ! $2 $h!...!user => ...!user
+R$&h ! $+ $@ $&h ! $1 $h!user => $h!user
R$+ $: $U ! $1 prepend our name
+R! $+ $: $k ! $1 in case $U undefined
-# recipient rewriting
+#
+# envelope and header recipient rewriting
+#
S22
# don't touch list:; syntax
-R$* :; <@> $@ $1 ;:
+R$* :; <@> $@ $1 :;
R$* < @ $* . > $1 < @ $2 > strip trailing dots
R$* < @ $j > $1 strip local name
+R<@ $- . UUCP > : $+ $1 ! $2 convert to UUCP format
+R<@ $+ > : $+ $1 ! $2 convert to UUCP format
R$* < @ $- . UUCP > $2 ! $1 convert to UUCP format
R$* < @ $+ > $2 ! $1 convert to UUCP format
+R$&h ! $+ ! $+ $@ $1 ! $2 $h!...!user => ...!user
+R$&h ! $+ $@ $&h ! $1 $h!user => $h!user
+R$+ $: $U ! $1 prepend our name
+R! $+ $: $k ! $1 in case $U undefined
+
+
+ifdef(`_MAILER_smtp_',
+`#
+# envelope sender rewriting for uucp-dom mailer
+#
+S52
+
+# handle error address as a special case
+R<@> $n errors to mailer-daemon
+
+# pass everything to standard SMTP mailer rewriting
+R$* $@ $>11 $1
+
+#
+# envelope sender rewriting for uucp-uudom mailer
+#
+S72
+
+# handle error address as a special case
+R<@> $n errors to mailer-daemon
+
+# do not qualify list:; syntax
+R$* :; <@> $@ $1 :;
+
+R$* < @ $* . > $1 < @ $2 > strip trailing dots
+R$* < @ $=w > $1 strip local name
+R<@ $- . UUCP > : $+ $1 ! $2 convert to UUCP format
+R<@ $+ > : $+ $1 ! $2 convert to UUCP format
+R$* < @ $- . UUCP > $2 ! $1 convert to UUCP format
+R$* < @ $+ > $@ $2 ! $1 convert to UUCP format
+
+R$&h ! $+ ! $+ $@ $1 ! $2 $h!...!user => ...!user
+R$&h ! $+ $@ $&h ! $1 $h!user => $h!user
+R$+ $: $M ! $1 prepend masquerade name
+R! $+ $: $j ! $1 in case $M undefined')
+
PUSHDIVERT(4)
# resolve locally connected UUCP links
-R< @ $=Y . UUCP > : $+ $#suucp $@ $1 $: $2 @host.UUCP: ...
-R< @ $=U . UUCP > : $+ $#uucp $@ $1 $: $2 @host.UUCP: ...
-R$+ < @ $=Y . UUCP > $#suucp $@ $2 $: $1 user@host.UUCP
-R$+ < @ $=U . UUCP > $#uucp $@ $2 $: $1 user@host.UUCP
+R$* < @ $=Z . UUCP. > $* $#uucp-uudom $@ $2 $: $1 < @ $2 .UUCP. > $3
+R$* < @ $=Y . UUCP. > $* $#uucp-new $@ $2 $: $1 < @ $2 .UUCP. > $3
+R$* < @ $=U . UUCP. > $* $#uucp-old $@ $2 $: $1 < @ $2 .UUCP. > $3
POPDIVERT