ldap_routing.m4 revision 64562
1divert(-1)
2#
3# Copyright (c) 1999-2000 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#
11
12divert(0)
13VERSIONID(`$Id: ldap_routing.m4,v 8.5.4.1 2000/07/15 18:05:05 gshapiro Exp $')
14divert(-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
26LOCAL_CONFIG
27# LDAP routing maps
28Kldapmh ifelse(len(X`'_ARG1_), `1',
29	       `ldap -1 -v mailHost -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))',
30	       `_ARG1_')
31
32Kldapmra ifelse(len(X`'_ARG2_), `1',
33		`ldap -1 -v mailRoutingAddress -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))',
34		`_ARG2_')
35