164315Sericdivert(-1)
264315Seric#
3*68840Seric# Copyright (c) 1983, 1995 Eric P. Allman
464315Seric# Copyright (c) 1988, 1993
564315Seric#	The Regents of the University of California.  All rights reserved.
664315Seric#
764315Seric# %sccs.include.redist.sh%
864315Seric#
964315Sericdivert(0)
1064315Seric
11*68840SericVERSIONID(`@(#)nullrelay.m4	8.8 (Berkeley) 04/21/95')
1264315Seric
1364315Seric#
1464315Seric#  This configuration applies only to relay-only hosts.  They send
1564315Seric#  all mail to a hub without consideration of the address syntax
1664315Seric#  or semantics, except for adding the hub qualification to the
1764315Seric#  addresses.
1864315Seric#
1964322Seric#	This is based on a prototype done by Bryan Costales of ICSI.
2064322Seric#
2164315Seric
2264315Seric######################################################################
2364315Seric######################################################################
2464315Seric#####
2564315Seric#####			REWRITING RULES
2664315Seric#####
2764315Seric######################################################################
2864315Seric######################################################################
2964315Seric
3064315Seric###########################################
3164315Seric###  Rulset 3 -- Name Canonicalization  ###
3264315Seric###########################################
3364315SericS3
3464315Seric
3564315Seric# handle null input and list syntax (translate to <@> special case)
3664315SericR$@			$@ <@>
3764315SericR$*:;$*			$@ $1 :; <@>
3864315Seric
3964315Seric# basic textual canonicalization -- note RFC733 heuristic here
4064315SericR$*<$*>$*<$*>$*		$2$3<$4>$5			strip multiple <> <>
4164315SericR$*<$*<$+>$*>$*		<$3>$5				2-level <> nesting
4264315SericR$*<>$*			$@ <@>				MAIL FROM:<> case
4364315SericR$*<$+>$*		$2				basic RFC821/822 parsing
4464315Seric
4564393Sericifdef(`_NO_CANONIFY_', `dnl',
4664393Seric`# eliminate local host if present
4764393SericR@ $=w $=: $+		$@ @ $M $2 $3			@thishost ...
4865961SericR@ $+			$@ @ $1				@somewhere ...
4964315Seric
5064393SericR$+ @ $=w		$@ $1 @ $M			...@thishost
5164315SericR$+ @ $+		$@ $1 @ $2			...@somewhere
5264315Seric
5364393SericR$=w ! $+		$@ $2 @ $M			thishost!...
5464393SericR$+ ! $+		$@ $1 ! $2 @ $M			somewhere ! ...
5564315Seric
5664393SericR$+ % $=w		$@ $1 @ $M			...%thishost
5764315SericR$+ % $+		$@ $1 @ $2			...%somewhere
5864315Seric
5964393SericR$+			$@ $1 @ $M			unadorned user')
6064315Seric
6164315Seric
6264315Seric######################################
6364315Seric###   Ruleset 0 -- Parse Address   ###
6464315Seric######################################
6564315Seric
6664315SericS0
6764315Seric
6864315SericR$*:;<@>		$#error $@ USAGE $: "list:; syntax illegal for recipient addresses"
6964315Seric
7064315Seric# pass everything else to a relay host
7164315SericR$*			$#_RELAY_ $@ $H $: $1
7264315Seric
7364315Seric#
7464315Seric######################################################################
7564315Seric######################################################################
7664315Seric#####
7764315Seric`#####			MAILER DEFINITIONS'
7864315Seric#####
7964315Seric######################################################################
8064315Seric######################################################################
8164315Sericundivert(7)dnl
82