3 # Copyright (c) 1998-2002, 2004, 2006 Sendmail, Inc. and its suppliers.
6 # By using this file, you agree to the terms and conditions set
7 # forth in the LICENSE file which can be found at the top level of
8 # the sendmail distribution.
13 VERSIONID(`$Id: access_db.m4,v 8.27 2006/07/06 21:10:10 ca Exp $')
16 define(`_ACCESS_TABLE_', `')
17 define(`_TAG_DELIM_', `:')dnl should be in OperatorChars
18 ifelse(lower(_ARG2_),`skip',`define(`_ACCESS_SKIP_', `1')')
19 ifelse(lower(_ARG2_),`lookupdotdomain',`define(`_LOOKUPDOTDOMAIN_', `1')')
20 ifelse(lower(_ARG2_),`relaytofulladdress',`define(`_RELAY_FULL_ADDR_', `1')')
21 ifelse(lower(_ARG3_),`skip',`define(`_ACCESS_SKIP_', `1')')
22 ifelse(lower(_ARG3_),`lookupdotdomain',`define(`_LOOKUPDOTDOMAIN_', `1')')
23 ifelse(lower(_ARG3_),`relaytofulladdress',`define(`_RELAY_FULL_ADDR_', `1')')
24 ifelse(lower(_ARG4_),`skip',`define(`_ACCESS_SKIP_', `1')')
25 ifelse(lower(_ARG4_),`lookupdotdomain',`define(`_LOOKUPDOTDOMAIN_', `1')')
26 ifelse(lower(_ARG4_),`relaytofulladdress',`define(`_RELAY_FULL_ADDR_', `1')')
27 define(`_ATMPF_', `<TMPF>')dnl
28 dnl check whether arg contains -T`'_ATMPF_
29 dnl unless it is a sequence map
30 ifelse(defn(`_ARG_'), `', `',
31 defn(`_ARG_'), `LDAP', `',
32 `ifelse(index(_ARG_, `sequence '), `0', `',
33 `ifelse(index(_ARG_, _ATMPF_), `-1',
34 `errprint(`*** WARNING: missing -T'_ATMPF_` in argument of FEATURE(`access_db',' defn(`_ARG_')`)
36 define(`_ABP_', index(_ARG_, ` '))
37 define(`_NARG_', `substr(_ARG_, 0, _ABP_) -T'_ATMPF_` substr(_ARG_, _ABP_)')
41 ifdef(`_GREET_PAUSE_',
42 `errprint(`*** WARNING: FEATURE(`greet_pause') before FEATURE(`access_db')
43 greet_pause will not use access_db!')')
46 # Access list database (for spam stomping)
47 Kaccess ifelse(defn(`_ARG_'), `', DATABASE_MAP_TYPE -T`'_ATMPF_ MAIL_SETTINGS_DIR`access',
48 defn(`_ARG_'), `LDAP', `ldap -T`'_ATMPF_ -1 -v sendmailMTAMapValue,sendmailMTAMapSearch:FILTER:sendmailMTAMapObject,sendmailMTAMapURL:URL:sendmailMTAMapObject -k (&(objectClass=sendmailMTAMapObject)(|(sendmailMTACluster=${sendmailMTACluster})(sendmailMTAHost=$j))(sendmailMTAMapName=access)(sendmailMTAKey=%0))',
49 defn(`_NARG_'), `', `_ARG_', `_NARG_')