LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-17-2008, 02:03 AM   #1
aravind1024004
Member
 
Registered: Mar 2008
Posts: 47

Rep: Reputation: 15
adding entries in ldap


hi,

i need add certain entries in ldap.
for eg: am adding mail.com.ldif file in ldap
which consists of

dn: uid=saurav,ou=solution,dc=linux,dc=com
cn: Manaager
sn: ganguly
uid: saurav
mail: saurav@linux.com
description: Indian Team
telephoneNumber: 012101012
userPassword: password
uidNumber: 1023
gidNumber: 10023
objectClass: person
objectClass: top
objectClass: inetOrgperson
objectClass: posixAccount


In this i had mentioned uid,cn,sn and mail address,password and objectclasses for these attributes.

I need to mention my mailbox location,so that when i send mail from client such as outlook, mail will go to mailserver look ldap directory get the user mailaddress and mailbox location and deliver the mail in that location.

For specifying the mailbox location what is the attribute name that i have to mention?
And tell me objectclass for that atribute.
 
Old 04-17-2008, 02:53 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You should use the objectClass that matches your mail-server. For example for my qmail installation I have:
Code:
...
objectClass: qmailUser
mailMessageStore: /var/qmail/maildirs/user
mailHost: smtp.example.com
mail: user@example.com
...
 
Old 04-17-2008, 03:05 AM   #3
aravind1024004
Member
 
Registered: Mar 2008
Posts: 47

Original Poster
Rep: Reputation: 15
hi,

so as you said, am using postfix mailserver so i have mention like this write,

...
objectClass: postfixUser
mailMessageStore: /var/postfix/maildirs/user
mailHost: smtp.linux.com
mail: user@linux.com
...

I had tried this to but still getting the same error,

[root@experts ~]# ldapadd -x -D "cn=Manager,dc=linux,dc=com" -W -f /etc/openldap/mail4.com.ldif
Enter LDAP Password:
adding new entry "uid=saurav,ou=solution,dc=linux,dc=com"
ldapadd: Undefined attribute type (17)
additional info: mailMessageStore: attribute type undefined

This is my mail4.com.ldif file

dn: uid=saurav,ou=solution,dc=linux,dc=com
cn: Manager
sn: ganguly
uid: saurav
mail: saurav@linux.com
mailbox: /var/spool/mail/saurav
description: Indian Team
telephoneNumber: 012101012
userPassword: password
uidNumber: 1023
homeDirectory: /var/spool/mail/saurav
gidNumber: 10023
objectClass: person
objectClass: top
objectClass: inetOrgperson
objectClass: posixAccount
objectClass: organizationalPerson
objectClass: postfixUser
 
Old 04-17-2008, 03:18 AM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
qmail provide their own schema for ldap

See http://ldapadmin.sourceforge.net/docs/introduction.html for postfix reference, or do a google for "postfix ldap schema"
 
Old 04-17-2008, 03:25 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
It's not that simple.
You should find the postfix schema file (for example postfix.schema), copy it under /etc/openldap/schema/ and add the entry for it in slapd.conf under the other schema entries, e.g:
Code:
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/postfix.schema
Then you should use the mail attributes provided by that schema for your users.

***EDIT***
Just saw billymayday's answer about postfix.schema. Follow the link provided and near the end you'll find a postfix.schema file.

Regards

Last edited by bathory; 04-17-2008 at 04:33 AM.
 
Old 04-17-2008, 04:24 AM   #6
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Please note the point of my post is that there doesn't seem to be a specif postfix schema
 
Old 04-17-2008, 05:06 AM   #7
aravind1024004
Member
 
Registered: Mar 2008
Posts: 47

Original Poster
Rep: Reputation: 15
hi,

In postfix there is a schema called misc.schema but it was not mentioned in slapd.conf file, but it was in schema directory.
In that misc.schema attributes like mailHost are available.

So i added this attribute in slapd.conf like

include /etc/openldap/schema/misc.schema

But still getting the same error.But mailHost attribute is exists in misc.schema file.

Here am integrating postfix with openldap.
In ldap ldif file i will add the user information like

mailaddress,password,mailbox location,mailserver domain etc

When i send mail from client it must want to get the information from ldap database and the mail must want to deliver to the mailbox location which i mentioned in ldap database.

I need to whether the users must want to exists in mailserver for creating mailbox.
In my setup i simply created the mailbox location without creating the user.

for eg: i didnt create a user called saurav in my mailserver,but i created a mailbox location for the user saurav in

/var/spool/mail/saurav and gave the write permission for this file.

When i send mail from my client it checks the ldap database,get the user information for saurav and delivering error that user unknown in local recipien table.

If i want to create the user in my mailserver then whats the use of ldap database here?
 
Old 04-17-2008, 05:22 AM   #8
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
You can only use attributes that are included in objectclasees, etc. You probably need to to a little basic research on ldap
 
Old 04-17-2008, 05:29 AM   #9
aravind1024004
Member
 
Registered: Mar 2008
Posts: 47

Original Poster
Rep: Reputation: 15
Ok what is the solution for that user account in mailserver,
whether for creating mailbox in mailserver user is required?
if yes then whats the use of LDAP?
plz be detail in your answer
 
Old 04-17-2008, 05:35 AM   #10
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
As I said above

Quote:
You probably need to to a little basic research on ldap
 
Old 04-17-2008, 09:38 AM   #11
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by aravind1024004 View Post
Ok what is the solution for that user account in mailserver,
whether for creating mailbox in mailserver user is required?
if yes then whats the use of LDAP?
plz be detail in your answer
The user must exist in your ldap database, in order to be able to receive mail. Whenever an e-mail arrives, postfix will search ldap database and if it finds that user it will deliver the mail to the specified mailbox, else it discards it.
To add a mail user in ldap, you must give him the appropriate attributes, that it turn depend on specific objectclasses that are defined in specific schema files.
 
  


Reply



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
Can't create LDAP entries with phpldapadmin dlublink Linux - Networking 6 12-12-2007 03:41 AM
LDAP > ldapsearch doesn't print the entries when bound as normal user cbonar Linux - Server 2 09-22-2007 01:19 PM
LDAP How to add entries durgap Linux - Networking 4 11-10-2006 04:55 AM
Adding entries to route table in C? kuronai Programming 2 04-04-2005 02:42 PM
Adding entries to an LDAP address book? [GOD]Anck Linux - Software 1 02-10-2005 09:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:10 AM.

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
Open Source Consulting | Domain Registration