ldap_routing.m4 revision 90792
12482SN/Adivert(-1)
22482SN/A#
32482SN/A# Copyright (c) 1999-2001 Sendmail, Inc. and its suppliers.
43591Sjlahoda#	All rights reserved.
53591Sjlahoda#
63591Sjlahoda# By using this file, you agree to the terms and conditions set
72482SN/A# forth in the LICENSE file which can be found at the top level of
82482SN/A# the sendmail distribution.
92482SN/A#
103591Sjlahoda#
112482SN/A
122482SN/Adivert(0)
132482SN/AVERSIONID(`$Id: ldap_routing.m4,v 8.8 2001/06/27 21:46:31 gshapiro Exp $')
142482SN/Adivert(-1)
15
16# Check first two arguments.  If they aren't set, may need to warn in proto.m4
17ifelse(len(X`'_ARG1_), `1', `define(`_LDAP_ROUTING_WARN_', `yes')')
18ifelse(len(X`'_ARG2_), `1', `define(`_LDAP_ROUTING_WARN_', `yes')')
19
20# Check for third argument to indicate how to deal with non-existant
21# LDAP records
22ifelse(len(X`'_ARG3_), `1', `define(`_LDAP_ROUTING_', `_PASS_THROUGH_')',
23       _ARG3_, `passthru', `define(`_LDAP_ROUTING_', `_PASS_THROUGH_')',
24       `define(`_LDAP_ROUTING_', `_MUST_EXIST_')')
25
26# Check for fouth argument to indicate how to deal with +detail info
27ifelse(len(X`'_ARG4_), `1', `',
28       _ARG4_, `strip', `define(`_LDAP_ROUTE_DETAIL_', `_STRIP_')',
29       _ARG4_, `preserve', `define(`_LDAP_ROUTE_DETAIL_', `_PRESERVE_')')
30
31LOCAL_CONFIG
32# LDAP routing maps
33Kldapmh ifelse(len(X`'_ARG1_), `1',
34	       `ldap -1 -v mailHost -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))',
35	       `_ARG1_')
36
37Kldapmra ifelse(len(X`'_ARG2_), `1',
38		`ldap -1 -v mailRoutingAddress -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))',
39		`_ARG2_')
40