access_db.m4 revision 94334
138032Speterdivert(-1)
238032Speter#
394334Sgshapiro# Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers.
464562Sgshapiro#	All rights reserved.
538032Speter#
638032Speter# By using this file, you agree to the terms and conditions set
738032Speter# forth in the LICENSE file which can be found at the top level of
838032Speter# the sendmail distribution.
938032Speter#
1038032Speter#
1138032Speter
1238032Speterdivert(0)
1394334SgshapiroVERSIONID(`$Id: access_db.m4,v 8.24 2002/03/06 21:50:25 ca Exp $')
1438032Speterdivert(-1)
1538032Speter
1664562Sgshapirodefine(`_ACCESS_TABLE_', `')
1764562Sgshapirodefine(`_TAG_DELIM_', `:')dnl should be in OperatorChars
1890792Sgshapiroifelse(lower(_ARG2_),`skip',`define(`_ACCESS_SKIP_', `1')')
1990792Sgshapiroifelse(lower(_ARG2_),`lookupdotdomain',`define(`_LOOKUPDOTDOMAIN_', `1')')
2090792Sgshapiroifelse(lower(_ARG3_),`skip',`define(`_ACCESS_SKIP_', `1')')
2190792Sgshapiroifelse(lower(_ARG3_),`lookupdotdomain',`define(`_LOOKUPDOTDOMAIN_', `1')')
2290792Sgshapirodefine(`_ATMPF_', `<TMPF>')dnl
2390792Sgshapirodnl check whether arg contains -T`'_ATMPF_
2494334Sgshapirodnl unless it is a sequence map
2590792Sgshapiroifelse(defn(`_ARG_'), `', `',
2694334Sgshapiro  defn(`_ARG_'), `LDAP', `',
2794334Sgshapiro  `ifelse(index(_ARG_, `sequence '), `0', `',
2894334Sgshapiro    `ifelse(index(_ARG_, _ATMPF_), `-1',
2994334Sgshapiro      `errprint(`*** WARNING: missing -T'_ATMPF_` in argument of FEATURE(`access_db',' defn(`_ARG_')`)
3090792Sgshapiro')
3194334Sgshapiro      define(`_ABP_', index(_ARG_, ` '))
3294334Sgshapiro      define(`_NARG_', `substr(_ARG_, 0, _ABP_) -T'_ATMPF_` substr(_ARG_, _ABP_)')
3394334Sgshapiro      ')
3494334Sgshapiro    ')
3594334Sgshapiro  ')
3664562Sgshapiro
3764562SgshapiroLOCAL_CONFIG
3864562Sgshapiro# Access list database (for spam stomping)
3990792SgshapiroKaccess ifelse(defn(`_ARG_'), `', DATABASE_MAP_TYPE -T`'_ATMPF_ MAIL_SETTINGS_DIR`access',
4090792Sgshapiro	       defn(`_ARG_'), `LDAP', `ldap -T`'_ATMPF_ -1 -v sendmailMTAMapValue -k (&(objectClass=sendmailMTAMapObject)(|(sendmailMTACluster=${sendmailMTACluster})(sendmailMTAHost=$j))(sendmailMTAMapName=access)(sendmailMTAKey=%0))',
4190792Sgshapiro	       defn(`_NARG_'), `', `_ARG_', `_NARG_')
42