1995-12-02 17:30:23 +00:00
|
|
|
|
divert(-1)
|
|
|
|
|
#
|
1998-08-03 05:56:20 +00:00
|
|
|
|
# Copyright (c) 1998 Sendmail, Inc. All rights reserved.
|
|
|
|
|
# Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
|
1995-12-02 17:30:23 +00:00
|
|
|
|
# Copyright (c) 1988, 1993
|
|
|
|
|
# The Regents of the University of California. All rights reserved.
|
|
|
|
|
#
|
1998-08-03 05:56:20 +00:00
|
|
|
|
# By using this file, you agree to the terms and conditions set
|
|
|
|
|
# forth in the LICENSE file which can be found at the top level of
|
|
|
|
|
# the sendmail distribution.
|
1995-12-02 17:30:23 +00:00
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
divert(0)
|
|
|
|
|
|
1999-01-12 12:26:57 +00:00
|
|
|
|
VERSIONID(`@(#)nullrelay.m4 8.19 (Berkeley) 5/19/1998')
|
1995-12-02 17:30:23 +00:00
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# This configuration applies only to relay-only hosts. They send
|
|
|
|
|
# all mail to a hub without consideration of the address syntax
|
|
|
|
|
# or semantics, except for adding the hub qualification to the
|
|
|
|
|
# addresses.
|
|
|
|
|
#
|
|
|
|
|
# This is based on a prototype done by Bryan Costales of ICSI.
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
|
######################################################################
|
|
|
|
|
#####
|
|
|
|
|
##### REWRITING RULES
|
|
|
|
|
#####
|
|
|
|
|
######################################################################
|
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
|
|
###########################################
|
|
|
|
|
### Rulset 3 -- Name Canonicalization ###
|
|
|
|
|
###########################################
|
|
|
|
|
S3
|
|
|
|
|
|
|
|
|
|
# handle null input
|
|
|
|
|
R$@ $@ <@>
|
|
|
|
|
|
|
|
|
|
# strip group: syntax (not inside angle brackets!) and trailing semicolon
|
|
|
|
|
R$* $: $1 <@> mark addresses
|
|
|
|
|
R$* < $* > $* <@> $: $1 < $2 > $3 unmark <addr>
|
|
|
|
|
R$* :: $* <@> $: $1 :: $2 unmark node::addr
|
|
|
|
|
R:`include': $* <@> $: :`include': $1 unmark :`include':...
|
|
|
|
|
R$* : $* <@> $: $2 strip colon if marked
|
|
|
|
|
R$* <@> $: $1 unmark
|
1997-06-27 14:53:01 +00:00
|
|
|
|
R$* ; $1 strip trailing semi
|
|
|
|
|
R$* < $* ; > $1 < $2 > bogus bracketed semi
|
1995-12-02 17:30:23 +00:00
|
|
|
|
|
|
|
|
|
# null input now results from list:; syntax
|
|
|
|
|
R$@ $@ :; <@>
|
|
|
|
|
|
|
|
|
|
# basic textual canonicalization -- note RFC733 heuristic here
|
1996-10-24 04:51:14 +00:00
|
|
|
|
R$* $: < $1 > housekeeping <>
|
|
|
|
|
R$+ < $* > < $2 > strip excess on left
|
|
|
|
|
R< $* > $+ < $1 > strip excess on right
|
|
|
|
|
R<> $@ < @ > MAIL FROM:<> case
|
|
|
|
|
R< $+ > $: $1 remove housekeeping <>
|
1995-12-02 17:30:23 +00:00
|
|
|
|
|
|
|
|
|
ifdef(`_NO_CANONIFY_', `dnl',
|
|
|
|
|
`# eliminate local host if present
|
|
|
|
|
R@ $=w $=: $+ $@ @ $M $2 $3 @thishost ...
|
|
|
|
|
R@ $+ $@ @ $1 @somewhere ...
|
|
|
|
|
|
1996-10-24 04:51:14 +00:00
|
|
|
|
R$=E @ $=w $@ $1 @ $2 leave exposed
|
1995-12-02 17:30:23 +00:00
|
|
|
|
R$+ @ $=w $@ $1 @ $M ...@thishost
|
|
|
|
|
R$+ @ $+ $@ $1 @ $2 ...@somewhere
|
|
|
|
|
|
1996-10-24 04:51:14 +00:00
|
|
|
|
R$=w ! $=E $@ $2 @ $1 leave exposed
|
1995-12-02 17:30:23 +00:00
|
|
|
|
R$=w ! $+ $@ $2 @ $M thishost!...
|
|
|
|
|
R$+ ! $+ $@ $1 ! $2 @ $M somewhere ! ...
|
|
|
|
|
|
1996-10-24 04:51:14 +00:00
|
|
|
|
R$=E % $=w $@ $1 @ $2 leave exposed
|
1995-12-02 17:30:23 +00:00
|
|
|
|
R$+ % $=w $@ $1 @ $M ...%thishost
|
|
|
|
|
R$+ % $+ $@ $1 @ $2 ...%somewhere
|
|
|
|
|
|
1996-10-24 04:51:14 +00:00
|
|
|
|
R$=E $@ $1 @ $j leave exposed
|
1995-12-02 17:30:23 +00:00
|
|
|
|
R$+ $@ $1 @ $M unadorned user')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######################################
|
|
|
|
|
### Ruleset 0 -- Parse Address ###
|
|
|
|
|
######################################
|
|
|
|
|
|
|
|
|
|
S0
|
|
|
|
|
|
1998-08-03 05:56:20 +00:00
|
|
|
|
R$*:;<@> $#error $@ USAGE $: "List:; syntax illegal for recipient addresses"
|
1995-12-02 17:30:23 +00:00
|
|
|
|
|
|
|
|
|
# pass everything else to a relay host
|
|
|
|
|
R$* $#_RELAY_ $@ $H $: $1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
##################################################
|
|
|
|
|
### Ruleset 4 -- Final Output Post-rewriting ###
|
|
|
|
|
##################################################
|
|
|
|
|
S4
|
|
|
|
|
|
|
|
|
|
R$* <@> $@ handle <> and list:;
|
|
|
|
|
|
|
|
|
|
# strip trailing dot off before passing to nullclient relay
|
|
|
|
|
R$* @ $+ . $1 @ $2
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
######################################################################
|
|
|
|
|
######################################################################
|
|
|
|
|
#####
|
|
|
|
|
`##### MAILER DEFINITIONS'
|
|
|
|
|
#####
|
|
|
|
|
######################################################################
|
|
|
|
|
######################################################################
|
|
|
|
|
undivert(7)dnl
|