bestmx_is_local.m4 revision 38032
1divert(-1)
2#
3# Copyright (c) 1998 Sendmail, Inc.  All rights reserved.
4# Copyright (c) 1983 Eric P. Allman.  All rights reserved.
5# Copyright (c) 1988, 1993
6#	The Regents of the University of California.  All rights reserved.
7#
8# By using this file, you agree to the terms and conditions set
9# forth in the LICENSE file which can be found at the top level of
10# the sendmail distribution.
11#
12#
13
14divert(0)
15VERSIONID(`@(#)bestmx_is_local.m4	8.12 (Berkeley) 5/19/98')
16divert(-1)
17
18LOCAL_CONFIG
19# turn on bestMX lookup table
20Kbestmx bestmx
21ifelse(_ARG_, `', `dnl',`
22# limit bestmx to these domains
23CB`'_ARG_')
24
25LOCAL_NET_CONFIG
26
27# If we are the best MX for a site, then we want to accept
28# its mail as local.  We assume we've already weeded out mail to
29# UUCP sites which are connected to us, which should also have
30# listed us as their best MX.
31#
32# Warning: this may generate a lot of extra DNS traffic -- a
33# lower cost method is to list all the expected best MX hosts
34# in $=w.  This should be fine (and easier to administer) for
35# low to medium traffic hosts.  If you use the limited bestmx
36# by passing in a set of possible domains it will improve things.
37
38ifelse(_ARG_, `', `dnl
39# unlimited bestmx
40R$* < @ $* > $*			$: $1 < @ $2 @@ $(bestmx $2 $) > $3',
41`dnl
42# limit bestmx to $=B
43R$* < @ $* $=B . > $*		$: $1 < @ $2 $3 . @@ $(bestmx $2 $3 . $) > $4')
44R$* $=O $* < @ $* @@ $=w . > $*	$@ $>97 $1 $2 $3
45R$* < @ $* @@ $=w . > $*	$#local $: $1
46R$* < @ $* @@ $* > $*		$: $1 < @ $2 > $4
47