bestmx_is_local.m4 revision 38032
138032Speterdivert(-1)
238032Speter#
338032Speter# Copyright (c) 1998 Sendmail, Inc.  All rights reserved.
438032Speter# Copyright (c) 1983 Eric P. Allman.  All rights reserved.
538032Speter# Copyright (c) 1988, 1993
638032Speter#	The Regents of the University of California.  All rights reserved.
738032Speter#
838032Speter# By using this file, you agree to the terms and conditions set
938032Speter# forth in the LICENSE file which can be found at the top level of
1038032Speter# the sendmail distribution.
1138032Speter#
1238032Speter#
1338032Speter
1438032Speterdivert(0)
1538032SpeterVERSIONID(`@(#)bestmx_is_local.m4	8.12 (Berkeley) 5/19/98')
1638032Speterdivert(-1)
1738032Speter
1838032SpeterLOCAL_CONFIG
1938032Speter# turn on bestMX lookup table
2038032SpeterKbestmx bestmx
2138032Speterifelse(_ARG_, `', `dnl',`
2238032Speter# limit bestmx to these domains
2338032SpeterCB`'_ARG_')
2438032Speter
2538032SpeterLOCAL_NET_CONFIG
2638032Speter
2738032Speter# If we are the best MX for a site, then we want to accept
2838032Speter# its mail as local.  We assume we've already weeded out mail to
2938032Speter# UUCP sites which are connected to us, which should also have
3038032Speter# listed us as their best MX.
3138032Speter#
3238032Speter# Warning: this may generate a lot of extra DNS traffic -- a
3338032Speter# lower cost method is to list all the expected best MX hosts
3438032Speter# in $=w.  This should be fine (and easier to administer) for
3538032Speter# low to medium traffic hosts.  If you use the limited bestmx
3638032Speter# by passing in a set of possible domains it will improve things.
3738032Speter
3838032Speterifelse(_ARG_, `', `dnl
3938032Speter# unlimited bestmx
4038032SpeterR$* < @ $* > $*			$: $1 < @ $2 @@ $(bestmx $2 $) > $3',
4138032Speter`dnl
4238032Speter# limit bestmx to $=B
4338032SpeterR$* < @ $* $=B . > $*		$: $1 < @ $2 $3 . @@ $(bestmx $2 $3 . $) > $4')
4438032SpeterR$* $=O $* < @ $* @@ $=w . > $*	$@ $>97 $1 $2 $3
4538032SpeterR$* < @ $* @@ $=w . > $*	$#local $: $1
4638032SpeterR$* < @ $* @@ $* > $*		$: $1 < @ $2 > $4
47