External Ldap Integration

Best practice information from Scalix users relating to integration of Scalix with other products.

Moderator: ScalixSupport

davidz
Posts: 129
Joined: Wed Apr 19, 2006 11:46 am

External Ldap Integration

Postby davidz » Wed Apr 19, 2006 6:58 pm

I am planning on setting up Scalix with our current LDAP server. Upon investigation I've noticed that our current directory does not have the attribute "mail" for any of the users. Is it necessary to have this? Or can I map the users email address to something else like "uid"? Thanks for the information!

Valerion
Scalix Star
Scalix Star
Posts: 2730
Joined: Thu Feb 26, 2004 7:40 am
Location: Johannesburg, South Africa
Contact:

Postby Valerion » Thu Apr 20, 2006 3:03 am

You can map from any attribute, but you'll need to modify the mappings in the ldap sync config file manually.

ScalixSupport
Scalix
Scalix
Posts: 5503
Joined: Thu Mar 25, 2004 8:15 pm

Postby ScalixSupport » Thu Apr 20, 2006 5:21 am

What is the point in integrating if the users on the LDAP side have no email address?

What is the LDAP system ?

Cheers,

Sascha.

davidz
Posts: 129
Joined: Wed Apr 19, 2006 11:46 am

Postby davidz » Thu Apr 20, 2006 9:12 am

It's an OpenLDAP directory. And when it was setup it was only going to be used for our Domain Controller (Samba) logins. But now that we want to upgrade our email system we want to use the LDAP directory. I'd rather not mess with the default mappings so I can add the mail attribute to all the users. One last quesiton I have is should the mail value be the full email address with domain for just the username? Ex. foo@domain.com or just foo?

Valerion
Scalix Star
Scalix Star
Posts: 2730
Joined: Thu Feb 26, 2004 7:40 am
Location: Johannesburg, South Africa
Contact:

Postby Valerion » Thu Apr 20, 2006 10:16 am

davidz wrote:One last quesiton I have is should the mail value be the full email address with domain for just the username? Ex. foo@domain.com or just foo?

Ideally it should be

Code: Select all

"User Name" <foo@domain.com>
to have a friendly outgoing address. Of course, you can use a rewrite and/or script to synthesize the address.

"man omldaputil" will point you in the right direction here.

davidz
Posts: 129
Joined: Wed Apr 19, 2006 11:46 am

Postby davidz » Thu Apr 20, 2006 10:39 am

Thanks for the info. Any other stuff you think I should make sure I have in my LDAP directory to make the sync go smoothly?

rredman
Posts: 11
Joined: Mon Jul 10, 2006 8:34 pm

Integration of Existing LDAP

Postby rredman » Mon Jul 17, 2006 6:27 pm

We are currently migrating an existing POP3 e-mail system with LDAP to Scalix. The company does not want to mess with existing LDAP, but incorporate it with Scalix. This is probably documented somewhere in the manuals, but could you please give me some pointers on the best way to to this?

Cheers,

Rob

davidz
Posts: 129
Joined: Wed Apr 19, 2006 11:46 am

Postby davidz » Tue Jul 18, 2006 11:26 am

The question is if you want to use your current LDAP system as your administration point or if you just want to import your users. See link below:

http://www.scalix.com/community/viewtopic.php?t=2703&highlight=

vlaurenz
Posts: 123
Joined: Wed May 31, 2006 3:41 pm

Postby vlaurenz » Wed Sep 13, 2006 2:52 pm

Valerion wrote:
davidz wrote:One last quesiton I have is should the mail value be the full email address with domain for just the username? Ex. foo@domain.com or just foo?

Ideally it should be

Code: Select all

"User Name" <foo@domain.com>
to have a friendly outgoing address. Of course, you can use a rewrite and/or script to synthesize the address.

"man omldaputil" will point you in the right direction here.


I find the info in omldaputil cryptic at best. Does anyone have an example of a mapping config which will take

Code: Select all

foo@domain.com
and map it to something like

Code: Select all

"User Name" <foo@domain.com>
?

davidz
Posts: 129
Joined: Wed Apr 19, 2006 11:46 am

Postby davidz » Wed Sep 13, 2006 4:19 pm

In my situation I had no email addresses in my OpenLDAP directory so when I created them I just used:
"User Name" <foo@domain.com>
That way when I setup my omldapsync stuff I didn't have to worry about any sort of extra stuff needing to happen. So, I did not use any sort of script to "sythesize" the complete address. It sounded too complicated, when I could just type it in at the time I create a new user.

vlaurenz
Posts: 123
Joined: Wed May 31, 2006 3:41 pm

Postby vlaurenz » Wed Sep 13, 2006 4:20 pm

davidz wrote:In my situation I had no email addresses in my OpenLDAP directory so when I created them I just used:
"User Name" <foo@domain.com>
That way when I setup my omldapsync stuff I didn't have to worry about any sort of extra stuff needing to happen. So, I did not use any sort of script to "sythesize" the complete address. It sounded too complicated, when I could just type it in at the time I create a new user.


Unfortunately that is not that case for me.

davidz
Posts: 129
Joined: Wed Apr 19, 2006 11:46 am

Postby davidz » Wed Sep 13, 2006 4:37 pm

Good luck then.

Valerion
Scalix Star
Scalix Star
Posts: 2730
Joined: Thu Feb 26, 2004 7:40 am
Location: Johannesburg, South Africa
Contact:

Postby Valerion » Thu Sep 14, 2006 3:48 am

I used the following for a client using eDirectory:

sync.cfg:

Code: Select all

mail|INTERNET-ADDR|*,1,512|!SCRIPT=email.map --ldifrec sourcefile


email.map (This is a modified version of a Scalix example file):

Code: Select all

#!/bin/sh

##########################################################################
# Template/Example script - protocols definition copied from OM Tech Guide
##########################################################################

#
# for latest protocols, see OM Tech Guide
#

##########################################################################
#             Scalix Server Router Subject Mapping Protocols             #
##########################################################################
#
# PROTOCOLS SYNTAX:
# The following table outlines the possible commands sent by Scalix Server
# and the expected replies sent by the Mapper. Note:
#   1) each command/reply must end with a new line (\n) character
#   2) the Mapper must NOT buffer its output, each reply must be flushed
#   3) the Mapper must reply to each command
#
# COMMAND           REPLY           REPLY COMMENTS
# ================= =============== ======================================
# <start>           220<SP><text>   Mapper must output this when starts up
# HELO<SP><text>    250<SP><text>   Mapper accepts Scalix Server session
# SUBJECT:<text>    251<SP><text>   Subject does not match requirement
# SUBJECT:<text>    252<SP><text>   Subject matches requirement
# QUIT<SP><text>    221<SP><text>   Mapper terminates session
# <others>          500<SP><text>   Unexpected command/syntax
##########################################################################

# handle "<start>"
# return ready status
rep="220 Email Address Mapper Ready"
echo "$rep"
displayname=`grep displayName sourcefile | cut -f 2 -d ":" | sed -e "s/^ //"`

# loop to process commands
Quit="FALSE"
while read cmd
do
    case "$cmd" in
    "HELO"*)
        # handle "HELO<SP><text>"
                # return ok status
        rep="250 Ok"
        ;;
    "SUBJECT:"*)
        # handle "SUBJECT:<text>"
                # subject matches requirement, strip off "SUBJECT:"
        input=`echo $cmd | sed -e "s/SUBJECT://"`
        email="\"$displayname\" <$input>"
        rep="252 $email"
        ;;
    "QUIT"*)
                # handle "QUIT<SP><text>"
        # return status, set flag to exit loop
        rep="221 Subject Mapper Close"; Quit="TRUE"
        ;;
    *)
        # handle "<others>"
                # return error status
        rep="500 Unrecognised Command or Syntax Error"
        ;;
    esac

    # must reply to each command
    echo "$rep"
    if [ "X$Quit" != "XTRUE" ]
    then
        continue
    else
        break
    fi
done

exit 0

###########################################################################
# End of script
###########################################################################

vlaurenz
Posts: 123
Joined: Wed May 31, 2006 3:41 pm

Postby vlaurenz » Fri Sep 15, 2006 11:15 am

Thanks for the reply Valerion. I'm a bit confused about that email.map file. Could you give me a brief explanation of what it does and how it does it?

Valerion
Scalix Star
Scalix Star
Posts: 2730
Joined: Thu Feb 26, 2004 7:40 am
Location: Johannesburg, South Africa
Contact:

Postby Valerion » Mon Sep 18, 2006 10:44 am

The email.map file must be in the same directory as the ldapsync config file. It uses the Subject Mapper from the Service Router.

The important lines are

Code: Select all

displayname=`grep displayName sourcefile | cut -f 2 -d ":" | sed -e "s/^ //"`

email="\"$displayname\" <$input>"

This takes the Display Name from LDAP, as well as the email address and formats it as

Code: Select all

Display Name <email>

and then returns the value. I needed to extract the value from the displayName, hence the cut and sed.

The rest of the script is just wrapping around it, to get the data from the Subject Mapper and to return various result values to it.

Credit here must go to Florian, he showed me the ropes in the beginning :)


Return to “Third Party Integration”



Who is online

Users browsing this forum: No registered users and 1 guest