3 # Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
5 # Copyright (c) 1983 Eric P. Allman. All rights reserved.
6 # Copyright (c) 1988, 1993
7 # The Regents of the University of California. All rights reserved.
9 # By using this file, you agree to the terms and conditions set
10 # forth in the LICENSE file which can be found at the top level of
11 # the sendmail distribution.
13 #ident "%Z%%M% %I% %E% SMI"
17 VERSIONID(`$Id: bestmx_is_local.m4,v 8.26 2000/09/17 17:30:00 gshapiro Exp $')
20 define(`_BESTMX_IS_LOCAL_', _ARG_)
23 # turn on bestMX lookup table
25 ifelse(defn(`_ARG_'), `', `dnl',`
26 # limit bestmx to these domains
31 # If we are the best MX for a site, then we want to accept
32 # its mail as local. We assume we've already weeded out mail to
33 # UUCP sites which are connected to us, which should also have
34 # listed us as their best MX.
36 # Warning: this may generate a lot of extra DNS traffic -- a
37 # lower cost method is to list all the expected best MX hosts
38 # in $=w. This should be fine (and easier to administer) for
39 # low to medium traffic hosts. If you use the limited bestmx
40 # by passing in a set of possible domains it will improve things.
42 ifelse(defn(`_ARG_'), `', `dnl
44 R$* < @ $* > $* $: $1 < @ $2 @@ $(bestmx $2 $) > $3',
47 R$* < @ $* $=B . > $* $: $1 < @ $2 $3 . @@ $(bestmx $2 $3 . $) > $4')
48 R$* $=O $* < @ $* @@ $=w . > $* $@ $>Recurse $1 $2 $3
49 R< @ $* @@ $=w . > : $* $@ $>Recurse $3
50 dnl we cannot use _LOCAL_ here since it is defined too late
51 R$* < @ $* @@ $=w . > $* $@ $>CanonLocal < $1 >
52 R$* < @ $* @@ $* > $* $: $1 < @ $2 > $4