ldap_routing.m4 revision 94334
164562Sgshapirodivert(-1)
264562Sgshapiro#
394334Sgshapiro# Copyright (c) 1999-2002 Sendmail, Inc. and its suppliers.
464562Sgshapiro#	All rights reserved.
564562Sgshapiro#
664562Sgshapiro# By using this file, you agree to the terms and conditions set
764562Sgshapiro# forth in the LICENSE file which can be found at the top level of
864562Sgshapiro# the sendmail distribution.
964562Sgshapiro#
1064562Sgshapiro#
1164562Sgshapiro
1264562Sgshapirodivert(0)
1394334SgshapiroVERSIONID(`$Id: ldap_routing.m4,v 8.10 2002/03/27 22:17:43 ca Exp $')
1464562Sgshapirodivert(-1)
1564562Sgshapiro
1664562Sgshapiro# Check first two arguments.  If they aren't set, may need to warn in proto.m4
1764562Sgshapiroifelse(len(X`'_ARG1_), `1', `define(`_LDAP_ROUTING_WARN_', `yes')')
1864562Sgshapiroifelse(len(X`'_ARG2_), `1', `define(`_LDAP_ROUTING_WARN_', `yes')')
1964562Sgshapiro
2064562Sgshapiro# Check for third argument to indicate how to deal with non-existant
2164562Sgshapiro# LDAP records
2264562Sgshapiroifelse(len(X`'_ARG3_), `1', `define(`_LDAP_ROUTING_', `_PASS_THROUGH_')',
2364562Sgshapiro       _ARG3_, `passthru', `define(`_LDAP_ROUTING_', `_PASS_THROUGH_')',
2464562Sgshapiro       `define(`_LDAP_ROUTING_', `_MUST_EXIST_')')
2564562Sgshapiro
2690792Sgshapiro# Check for fouth argument to indicate how to deal with +detail info
2790792Sgshapiroifelse(len(X`'_ARG4_), `1', `',
2890792Sgshapiro       _ARG4_, `strip', `define(`_LDAP_ROUTE_DETAIL_', `_STRIP_')',
2990792Sgshapiro       _ARG4_, `preserve', `define(`_LDAP_ROUTE_DETAIL_', `_PRESERVE_')')
3090792Sgshapiro
3164562SgshapiroLOCAL_CONFIG
3264562Sgshapiro# LDAP routing maps
3364562SgshapiroKldapmh ifelse(len(X`'_ARG1_), `1',
3494334Sgshapiro	       `ldap -1 -T<TMPF> -v mailHost -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))',
3564562Sgshapiro	       `_ARG1_')
3664562Sgshapiro
3764562SgshapiroKldapmra ifelse(len(X`'_ARG2_), `1',
3894334Sgshapiro		`ldap -1 -T<TMPF> -v mailRoutingAddress -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))',
3964562Sgshapiro		`_ARG2_')
40