1N/Adivert(-1)
1N/A#
1N/A# Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
1N/A# All rights reserved.
1N/A# Copyright (c) 1983 Eric P. Allman. All rights reserved.
1N/A# Copyright (c) 1988, 1993
1N/A# The Regents of the University of California. All rights reserved.
1N/A#
1N/A# By using this file, you agree to the terms and conditions set
1N/A# forth in the LICENSE file which can be found at the top level of
1N/A# the sendmail distribution.
1N/A#
1N/A#ident "%Z%%M% %I% %E% SMI"
1N/A#
1N/A
1N/Adivert(0)
1N/AVERSIONID(`$Id: bestmx_is_local.m4,v 8.26 2000/09/17 17:30:00 gshapiro Exp $')
1N/Adivert(-1)
1N/A
1N/Adefine(`_BESTMX_IS_LOCAL_', _ARG_)
1N/A
1N/ALOCAL_CONFIG
1N/A# turn on bestMX lookup table
1N/AKbestmx bestmx
1N/Aifelse(defn(`_ARG_'), `', `dnl',`
1N/A# limit bestmx to these domains
1N/ACB`'_ARG_')
1N/A
1N/ALOCAL_NET_CONFIG
1N/A
1N/A# If we are the best MX for a site, then we want to accept
1N/A# its mail as local. We assume we've already weeded out mail to
1N/A# UUCP sites which are connected to us, which should also have
1N/A# listed us as their best MX.
1N/A#
1N/A# Warning: this may generate a lot of extra DNS traffic -- a
1N/A# lower cost method is to list all the expected best MX hosts
1N/A# in $=w. This should be fine (and easier to administer) for
1N/A# low to medium traffic hosts. If you use the limited bestmx
1N/A# by passing in a set of possible domains it will improve things.
1N/A
1N/Aifelse(defn(`_ARG_'), `', `dnl
1N/A# unlimited bestmx
1N/AR$* < @ $* > $* $: $1 < @ $2 @@ $(bestmx $2 $) > $3',
1N/A`dnl
1N/A# limit bestmx to $=B
1N/AR$* < @ $* $=B . > $* $: $1 < @ $2 $3 . @@ $(bestmx $2 $3 . $) > $4')
1N/AR$* $=O $* < @ $* @@ $=w . > $* $@ $>Recurse $1 $2 $3
1N/AR< @ $* @@ $=w . > : $* $@ $>Recurse $3
1N/Adnl we cannot use _LOCAL_ here since it is defined too late
1N/AR$* < @ $* @@ $=w . > $* $@ $>CanonLocal < $1 >
1N/AR$* < @ $* @@ $* > $* $: $1 < @ $2 > $4