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