xref: /titanic_50/usr/src/cmd/sendmail/cf/feature/access_db.m4 (revision 142c9f13e148d687426ed2d4e8bd93717eeaebbc)
1divert(-1)
2#
3# Copyright (c) 1998-2002, 2004 Sendmail, Inc. and its suppliers.
4#	All rights reserved.
5#
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.
9#
10# ident	"%Z%%M%	%I%	%E% SMI"
11#
12
13divert(0)
14VERSIONID(`$Id: access_db.m4,v 8.26 2004/06/24 18:10:02 ca Exp $')
15divert(-1)
16
17define(`_ACCESS_TABLE_', `')
18define(`_TAG_DELIM_', `:')dnl should be in OperatorChars
19ifelse(lower(_ARG2_),`skip',`define(`_ACCESS_SKIP_', `1')')
20ifelse(lower(_ARG2_),`lookupdotdomain',`define(`_LOOKUPDOTDOMAIN_', `1')')
21ifelse(lower(_ARG3_),`skip',`define(`_ACCESS_SKIP_', `1')')
22ifelse(lower(_ARG3_),`lookupdotdomain',`define(`_LOOKUPDOTDOMAIN_', `1')')
23define(`_ATMPF_', `<TMPF>')dnl
24dnl check whether arg contains -T`'_ATMPF_
25dnl unless it is a sequence map
26ifelse(defn(`_ARG_'), `', `',
27  defn(`_ARG_'), `LDAP', `',
28  `ifelse(index(_ARG_, `sequence '), `0', `',
29    `ifelse(index(_ARG_, _ATMPF_), `-1',
30      `errprint(`*** WARNING: missing -T'_ATMPF_` in argument of FEATURE(`access_db',' defn(`_ARG_')`)
31')
32      define(`_ABP_', index(_ARG_, ` '))
33      define(`_NARG_', `substr(_ARG_, 0, _ABP_) -T'_ATMPF_` substr(_ARG_, _ABP_)')
34      ')
35    ')
36  ')
37ifdef(`_GREET_PAUSE_',
38	`errprint(`*** WARNING: FEATURE(`greet_pause') before FEATURE(`access_db')
39	greet_pause will not use access_db!')')
40
41LOCAL_CONFIG
42# Access list database (for spam stomping)
43Kaccess ifelse(defn(`_ARG_'), `', DATABASE_MAP_TYPE -T`'_ATMPF_ MAIL_SETTINGS_DIR`access',
44	       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))',
45	       defn(`_NARG_'), `', `_ARG_', `_NARG_')
46