LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-15-2009, 08:02 AM   #1
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,145
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
Thumbs up LDAP Address Book:Multiple email entry for single contact


Hi,

I want to achieve the following:

i.e i want to add 2 or more email ids for single contact in ldap address book,as given below:

when i add two email ids,while composing email it shows only one email id i.e the one which is entered first...


dn: cn=Test Person,ou=addressbook,dc=patrick-nagel,dc=net
objectClass: inetOrgPerson
objectClass: top
givenName: Test
sn: Person
cn: Test Person
mail: test.person@server1.tld
mail: test.person@server2.tld
 
Old 09-15-2009, 08:30 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

What is the actual problem you face?

1) Not able to enter more than 1 email address into one contact?
This should work, the email field is not limited to one entry per contact in ldap.

2) Not able to get all/one specific e-mail address from a contact?
A normal search should give you all the email addresses it finds (for one or more contacts, depending on the search.)

The program/script doing the ldapsearch should be aware that more then one entry can be found and act accordingly.

Hope this points you in the right direction.
 
Old 09-15-2009, 11:41 PM   #3
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,145
Blog Entries: 4

Original Poster
Rep: Reputation: 147Reputation: 147
Thumbs up

Hi

I really appreciate you help.My problem is i enter two email ids for a single contact and it shows only one.

i.e if i enter
email1
email2

it shows only email1 not the email2
 
Old 09-16-2009, 03:26 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

You need to give more information in order for us to help.

a) How and were do you try to enter an email address (ldapadd / ldapsearch / script / GUI)?
b) "Enter" as in search for or as in add the email address to the database?
c) Any error messages (on screen/ldap or general logs)?

Please be more elaborate about the problem you are facing.
 
Old 09-16-2009, 11:42 PM   #5
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,145
Blog Entries: 4

Original Poster
Rep: Reputation: 147Reputation: 147
Thumbs up

I have the file with following contents:

/etc/openldap/newcontact.ldif

dn: cn=Test Person,ou=addressbook,dc=patrick-nagel,dc=net
objectClass: inetOrgPerson
objectClass: top
givenName: Test
sn: Person
cn: Test Person
mail: test.person@server1.tld
mail: test.person@server2.tld



when i run run this command:


ldapadd -x -D "cn=Manager,dc=patrick-nagel,dc=net" -W -f /etc/openldap/newcontact.ldif


when i run the above command the newcontact is added properly without any errors but the second email is not added (mail: test.person@server2.tld)
 
Old 09-17-2009, 04:18 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

The example given does work on my side (both email's are inserted):

Code:
ldapadd -x -h localhost -p 1389 -D "cn=XYZ,dc=test,dc=nl" -W -f ldap.entry
Enter LDAP Password: 
adding new entry "cn=Test Person,ou=users,dc=test,dc=nl"
And the prove of insertion:

Code:
ldapsearch -x -h 127.0.0.1 -p 1389 -D "cn=XYZ,dc=test,dc=nl" -W -b "dc=test,dc=nl" -s sub cn="Test Person"
Enter LDAP Password: 
# extended LDIF
#
# LDAPv3
# base <dc=test,dc=nl> with scope subtree
# filter: cn=Test Person
# requesting: ALL
#

# Test Person, users, test.nl
dn: cn=Test Person,ou=users,dc=test,dc=nl
objectClass: inetOrgPerson
objectClass: top
givenName: Test
sn: Person
cn: Test Person
mail: test.person@server1.tld
mail: test.person@server2.tld

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1
A few more questions for you:

- Are you running openldap or another ldap flavor?

- Is there an extra blank line at the end of the ldif file?

- What happens if you move the sn and or cn entry to the bottom and try to add it:
mail: test.person@server1.tld
mail: test.person@server2.tld
sn: Person
cn: Test Person


- Add the -v option to your ldapadd command: Any strange messages?
Something like this should show up:
Code:
ldapadd -v -x -h localhost -p 1389 -D "cn=XYZ,dc=test,dc=nl" -W -f ldap.entry 
ldap_initialize( ldap://localhost:1389 )
Enter LDAP Password: 
add objectClass:
        inetOrgPerson
        top
add givenName:
        Test
add sn:
        Person3
add cn:
        Test3Person
add mail:
        test3.person@server1.tld
        test3.person@server2.tld
adding new entry "cn=Test3Person,ou=users,dc=test,dc=nl"
modify complete
Hope this gets you going again.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ldap synchronization with squirrelmail address book haariseshu Linux - Newbie 0 05-27-2008 06:29 AM
import address book in ldap prashantbhushan Linux - Networking 0 01-24-2007 05:51 AM
address book / contact manager pixellany Linux - Software 2 01-01-2006 06:31 PM
Adding entries to an LDAP address book? [GOD]Anck Linux - Software 1 02-10-2005 09:03 AM
ldap address book - Home use fariz83 Linux - Software 0 03-27-2004 08:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration