bestmx_is_local.m4 revision 43730
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.14 (Berkeley) 1/25/1999') 16divert(-1) 17 18define(_BESTMX_IS_LOCAL_, _ARG_) 19 20LOCAL_CONFIG 21# turn on bestMX lookup table 22Kbestmx bestmx 23ifelse(_ARG_, `', `dnl',` 24# limit bestmx to these domains 25CB`'_ARG_') 26 27LOCAL_NET_CONFIG 28 29# If we are the best MX for a site, then we want to accept 30# its mail as local. We assume we've already weeded out mail to 31# UUCP sites which are connected to us, which should also have 32# listed us as their best MX. 33# 34# Warning: this may generate a lot of extra DNS traffic -- a 35# lower cost method is to list all the expected best MX hosts 36# in $=w. This should be fine (and easier to administer) for 37# low to medium traffic hosts. If you use the limited bestmx 38# by passing in a set of possible domains it will improve things. 39 40ifelse(_ARG_, `', `dnl 41# unlimited bestmx 42R$* < @ $* > $* $: $1 < @ $2 @@ $(bestmx $2 $) > $3', 43`dnl 44# limit bestmx to $=B 45R$* < @ $* $=B . > $* $: $1 < @ $2 $3 . @@ $(bestmx $2 $3 . $) > $4') 46R$* $=O $* < @ $* @@ $=w . > $* $@ $>97 $1 $2 $3 47R< @ $* @@ $=w . > : $* $@ $>97 $3 48R$* < @ $* @@ $=w . > $* $#local $: $1 49R$* < @ $* @@ $* > $* $: $1 < @ $2 > $4 50