xref: /onnv-gate/usr/src/cmd/sendmail/cf/feature/ldap_routing.m4 (revision 0:68f95e015346)
1*0Sstevel@tonic-gatedivert(-1)
2*0Sstevel@tonic-gate#
3*0Sstevel@tonic-gate# Copyright (c) 1999-2002, 2004 Sendmail, Inc. and its suppliers.
4*0Sstevel@tonic-gate#	All rights reserved.
5*0Sstevel@tonic-gate#
6*0Sstevel@tonic-gate# By using this file, you agree to the terms and conditions set
7*0Sstevel@tonic-gate# forth in the LICENSE file which can be found at the top level of
8*0Sstevel@tonic-gate# the sendmail distribution.
9*0Sstevel@tonic-gate#
10*0Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
11*0Sstevel@tonic-gate#
12*0Sstevel@tonic-gate
13*0Sstevel@tonic-gatedivert(0)
14*0Sstevel@tonic-gateVERSIONID(`$Id: ldap_routing.m4,v 8.14 2004/02/18 02:45:11 gshapiro Exp $')
15*0Sstevel@tonic-gatedivert(-1)
16*0Sstevel@tonic-gate
17*0Sstevel@tonic-gate# Check first two arguments.  If they aren't set, may need to warn in proto.m4
18*0Sstevel@tonic-gateifelse(len(X`'_ARG1_), `1', `define(`_LDAP_ROUTING_WARN_', `yes')')
19*0Sstevel@tonic-gateifelse(len(X`'_ARG2_), `1', `define(`_LDAP_ROUTING_WARN_', `yes')')
20*0Sstevel@tonic-gateifelse(len(X`'_ARG5_), `1', `', `define(`_LDAP_ROUTE_NODOMAIN_', `yes')')
21*0Sstevel@tonic-gate
22*0Sstevel@tonic-gate# Check for third argument to indicate how to deal with non-existant
23*0Sstevel@tonic-gate# LDAP records
24*0Sstevel@tonic-gateifelse(len(X`'_ARG3_), `1', `define(`_LDAP_ROUTING_', `_PASS_THROUGH_')',
25*0Sstevel@tonic-gate       _ARG3_, `passthru', `define(`_LDAP_ROUTING_', `_PASS_THROUGH_')',
26*0Sstevel@tonic-gate       _ARG3_, `sendertoo', `define(`_LDAP_ROUTING_', `_MUST_EXIST_')define(`_LDAP_SENDER_MUST_EXIST_')',
27*0Sstevel@tonic-gate       `define(`_LDAP_ROUTING_', `_MUST_EXIST_')')
28*0Sstevel@tonic-gate
29*0Sstevel@tonic-gate# Check for fourth argument to indicate how to deal with +detail info
30*0Sstevel@tonic-gateifelse(len(X`'_ARG4_), `1', `',
31*0Sstevel@tonic-gate       _ARG4_, `strip', `define(`_LDAP_ROUTE_DETAIL_', `_STRIP_')',
32*0Sstevel@tonic-gate       _ARG4_, `preserve', `define(`_LDAP_ROUTE_DETAIL_', `_PRESERVE_')')
33*0Sstevel@tonic-gate
34*0Sstevel@tonic-gate# Check for sixth argument to indicate how to deal with tempfails
35*0Sstevel@tonic-gateifelse(len(X`'_ARG6_), `1', `define(`_LDAP_ROUTE_MAPTEMP_', `_QUEUE_')',
36*0Sstevel@tonic-gate       _ARG6_, `tempfail', `define(`_LDAP_ROUTE_MAPTEMP_', `_TEMPFAIL_')',
37*0Sstevel@tonic-gate       _ARG6_, `queue', `define(`_LDAP_ROUTE_MAPTEMP_', `_QUEUE_')')
38*0Sstevel@tonic-gate
39*0Sstevel@tonic-gateLOCAL_CONFIG
40*0Sstevel@tonic-gate# LDAP routing maps
41*0Sstevel@tonic-gateKldapmh ifelse(len(X`'_ARG1_), `1',
42*0Sstevel@tonic-gate	       `ldap -1 -T<TMPF> -v mailHost -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))',
43*0Sstevel@tonic-gate	       `_ARG1_')
44*0Sstevel@tonic-gate
45*0Sstevel@tonic-gateKldapmra ifelse(len(X`'_ARG2_), `1',
46*0Sstevel@tonic-gate		`ldap -1 -T<TMPF> -v mailRoutingAddress -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))',
47*0Sstevel@tonic-gate		`_ARG2_')
48