Populating the Directory with User Aliases Data and Distribution Lists --Sample Session

The following example is a continuation from the user data population example shown in "Populating the Directory with User Data--Sample Session" on page 319. It also assumes that you have extracted the user mail-aliases information from NIS+ and are now attempting to populate the directory with user aliases data for Alpha Corporation, Inc. as shown below. The user mail-alias being created is called testsubject and it will have two people as its members, John Doe and Gail Evert. The owner of the alias is designated as admin. The distribution list mail-alias is called testsubject-list, and it has owner owner-testsubject-list and automated request alias testsubject-list-request. The owner is user jdoe and the distribution list has two members, gevert and jdoe.

 
testsubject: gevert,jdoe
 
owner-testsubject: admin
 

 
testsubject-list: jdoe,gevert
 
testsubject-list-request: jdoe
 
owner-testsubject-list: jdoe
 

 

To create directory entries for these user aliases, complete the following steps:

  1. Log in as root.

 
$ su
 
Password: <Enter your root password>
 
#
 


Note - Since you have to populate the directory with user data before you populate it with user aliases data, and since the process of extracting user, user aliases, and distribution list data is the same, you have already completed steps Step 3 to Step 5 as part of Populating the Directory with User Data--Sample Session." This section does not repeat these steps.
  2. Copy the imldifsync.conf file to groups.conf to keep the user population data distinct from the user aliases population data:

 
# cp imldifsync.conf groups.conf
 

  3. Edit the groups.conf file, change the add-val line as shown below and change the mode token from users to groups.

 
add-val = { "associatedDomain: <same value as mail-domain> }
 
mode = groups
 

  mail-domain value should be lower down in the same file.
  4. Change directories to the location shown and convert the user aliases list data to LDIF format.
  Use the imldifsync command to generate formatted user aliases data files (LDIF files).

 
# /opt/SUNWmail/sbin/imldifsync -c groups.conf > /tmp/user_aliases.ldif
 

  You will see the following results on the screen:

 
==================Statistics========================
 

 
Added DNs: 2
 
Modified DNs: 0
 
Delete DNs:   0
 

 
====================================================
 


Note - By default, the mail folder will be set to the Sun Message Store.

The file user_aliases.ldif contains the following:

CODE  EXAMPLE  10-1 Contents of the user_aliases.ldif File for User Aliases (1 of 2)
 

 
 
dn: cn="testsubject",ou=Groups,o=Alpha,c=US
 
 
changetype: add
 
 
cn: testsubject
 
 
rfc822MailMember: gevert@testserver.Alpha.COM
 
 
rfc822MailMember: jdoe@testserver.Alpha.COM
 
 
mailDeliveryOption: mailbox
 
 
rfc822Owner: admin@testserver.Alpha.COM
 
 
rfc822Owner: root@testserver.Alpha.COM
 
 
ownerDeliveryOption: mailbox
 
 
dataSource: imldifsync 1.0
 
 
objectClass: top
 
 
objectClass: rfc822MailGroup
 
 
objectClass: emailGroup
objectClass: groupOfNames
associateddoman: <the value you added to the .conf file>
 
- 
 
 
dn: cn="testsubject-list",ou=Groups,o=Alpha,c=US
 
 
changetype: add
 
 
cn: testsubject-list
 
 
rfc822MailMember: jdoe@testserver.Alpha.COM
 
 
rfc822MailMember: gevert@testserver.Alpha.COM
 
 
mailDeliveryOption: mailbox
 
 
rfc822Owner: jdoe@testserver.Alpha.COM
 
 
rfc822Owner: root@testserver.Alpha.COM
 
 
ownerDeliveryOption: mailbox
 
 
rfc822RequestsTo: jdoe@testserver.Alpha.COM
 
 
requestsToDeliveryOption: mailbox
 
 
dataSource: imldifsync 1.0
 
 
objectClass: top
 
 
objectClass: rfc822MailGroup
 
 
objectClass: emailGroup
 

  5. Change directories to the location shown and populate the directory with the user aliases LDIF formatted data.
  Use the ldapmodify command to add the new entries to the directory:

 
# cd /opt/SUNWconn/bin
 
# ldapmodify -D "cn=admin,o=Alpha,c=us" -w secret -f /tmp/user_aliases.ldif
 

  You will see the following results on the screen:

 
adding new entry cn="testsubject",ou=Groups,o=Alpha,c=US
 
adding new entry cn="testsubject-list",ou=Groups,o=Alpha,c=US
 

  6. Verify that the entries are present in the directory, using the ldapsearch command.

CODE  EXAMPLE  C-3 Results of the ldapsearch Command for User Aliases Data
 

 
 
# ldapsearch -L -b "o=Alpha,c=us" "cn=*" cn
 
 
dn: CN=testsubject,OU=Groups,O=Alpha,C=US
 
 
cn: testsubject
 
 
# ldapsearch -L -b "o=Alpha,c=us" "cn=*" cn
 
 
dn: CN=testsubject-list,OU=Groups,O=Alpha,C=US
 
 
cn: testsubject-list
 




Copyright © 1999 Sun Microsystems, Inc. All Rights Reserved.