Peter Freitag put together a pretty nice CFC that handles validation
against AD - Might be able to gleen from that how to tap into AD for
validation and pruning the users pf's in Exchange (all that info is in
AD right ?) .   I would imagine that you *do* want to validate before
they even go near your Exchange server


<cfcomponent displayname="LDAPAuthenticator" hint="LDAP authentication,
can be used for validation against Windows 2000/2003 Active Directory">


       <!--- Directory Domain --->
       <cfset domain = "archatech.net">


       <!--- LDAP server address --->
       <cfset ldapServer = "172.16.48.10">
       <cfset ldapBaseDN = "dc=domain, dc=com">
       <cfset ldapUidAttr = "sAMAccountName">
       <cfset ldapRoleAttr = "memberOf">
       <cfset ldapRoleNameAttr = "name">


       <!--- Map ldap user attribute names to expected session variable
names --->
       <cfset ldapmap = StructNew()>
       <cfset ldapmap.displayName = "displayName">
       <cfset ldapmap.firstName = "givenName">
       <cfset ldapmap.lastName = "sn">
       <cfset ldapmap.city = "1">
       <cfset ldapmap.state = "st">
       <cfset ldapmap.country = "c">
       <cfset ldapmap.email = "mail">
       <cfset ldapmap.phone = "telephonenumber">


       <cffunction name="authenticate" returntype="boolean"
output="false">
              <cfargument name="username" type="string" required="true">
              <cfargument name="password" type="password"
required="true">
                <cftry>


                     <cfset filter="(#ldapUidAttr#=#username#)">
                     <cfset attributes="">


                     <cfloop list="#StructKeyList(ldapmap)#"
index="prop">
                       <cfset ldapattr = StructFind(ldapmap, prop)>
                       <cfset attributes = ListAppend(attributes,
ldapattr)>
                     </cfloop>


                     <!--- attempt to authenticate the user and download
his/her profile --->
                     <cfldap server="#ldapServer#"
                            username="[EMAIL PROTECTED]"
                            password="#arguments.password#"
                            action="">                             start="#ldapBaseDN#"
                            filter="#filter#"
                            attributes="#attributes#"
                            name="results">


                     <!--- set the user properties --->
                     <cfloop list="#StructKeyList(ldapmap)#"
index="prop">
                       <cfset ldapattr = StructFind(ldapmap, prop)>
                       <cfset ldapval = StructFind(results, ldapattr)>
                       <cfset tmp = SetVariable("user.#prop#", ldapval)>
                     </cfloop>

                     <!--- get the user's roles --->
                     <cfldap server="#ldapServer#"
                            username="[EMAIL PROTECTED]"
                            password="#arguments.password#"
                            action="">                             start="#ldapBaseDN#"
                            filter="#filter#"
                            attributes="#ldapRoleAttr#"
                            name="groups">

                      <cfset roles = ArrayNew(1)>
                      <cfset i = 1>
                      <cfset grouplist = StructFind(groups,
ldapRoleAttr)>
                      <cfset grouplist = Replace(grouplist,",
",chr(253),"all")>


                      <cfloop list="#grouplist#" index="group"
delimiters="#chr(253)#">
                        <!--- get the role detail --->


                        <cfldap server="#ldapServer#"
                               username="[EMAIL PROTECTED]"
                               password="#arguments.password#"
                               action="">                                start="#group#"
                               filter="(objectClass=*)"
                               attributes="#ldapRoleNameAttr#"
                               name="thisGroup">


                        <cfset roleName = StructFind(thisGroup,
ldapRoleNameAttr)>
                        <cfset roles[i] = roleName>


                        <cfset i = i + 1>


                      </cfloop>


                        <cfset rolelist = ArrrayToList(roles)>


                        <cfset user.userID = arguments.username>
                        <cfset user.roles = rolelist>


                     <cfreturn true>
                  <cfcatch type="any">
                     <cfreturn false>
                  </cfcatch>
                </cftry>
       </cffunction>

       <cffunction name="setDomain" output="false" returntype="void">
              <cfargument name="domain" type="string" required="true">
              <cfset domain = arguments.domain>
       </cffunction>


       <cffunction name="setServer" output="false" returntype="void">
              <cfargument name="server" type="string" required="true">
              <cfset ldapServer = arguments.server>
       </cffunction>


       <cffunction name="setBaseDN" output="false" returntype="void">
              <cfargument name="baseDN" type="string" required="true">
              <cfset ldapBaseDN = arguments.baseDN>
       </cffunction>


</cfcomponent>

HTH
Ramene Anthony
________________________________

From: Ramene Anthony [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 19, 2004 4:57 PM
To: CF-Talk
Subject: RE: tapping an exchange public folder and extracting messages


Jochem

You can even access Exchange via LDAP if memory serve's me.  This site
-- http://www.cfcomet.com/  might help out.  If not, well then, you'll
be up for a while!

Best Regards
Ramene Anthony

________________________________

From: Ramene Anthony [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 19, 2004 4:54 PM
To: CF-Talk
Subject: RE: tapping an exchange public folder and extracting messages

You can access Exchange via COM/MAPI calls.  It'd be a hack at best via
MX - but it can certainly be done.   I would also, imagine its not very
well documented.

There's a resource that comes to mind.. I'll try to get it to you guys
in a bit

Best Regards
Ramene Anthony

________________________________

From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 19, 2004 4:42 PM
To: CF-Talk
Subject: Re: tapping an exchange public folder and extracting messages

Smith, Matthew P -CONT(CSC) wrote:

> I have a few public folders on an exchange server that I am trying to
pull into a db and create a front end to access, allowing viewing and
searching and the like.  I know outlook allows this kind of
functionality, but we need to move it to a web interface.  I also want
to allow them to continue adding post and such, but with my new
interface.
>  
> Are there any tools that allow tapping into an Exchange folder,
pulling the items, and parsing them as required?

Can't you get to the public folders with IMAP?

Jochem

--
I don't get it
immigrants don't work
and steal our jobs
     - Loesje
________________________________
________________________________
________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to