Wednesday, July 15, 2009

How to purge a user from Sun Messaging Server

When a user is deleted from Sun Messaging Server via the Delegated Administrator, the user still exists in the Directory Server. 

Before user is deleted via DA



bash-3.00# ldapsearch -D "cn=Directory Manager" -w password -b o=ap.openmail.sg,o=isp uid=test*
dn: uid=test_user1,ou=People,o=ap.openmail.sg,o=isp
uid: test_user1
mailUserStatus: active
mailHost: openmail.openmail.sg
inetUserStatus: Active

After user is deleted via DA



bash-3.00# ldapsearch -D "cn=Directory Manager" -w password -b o=ap.openmail.sg,o=isp uid=test*
dn: uid=test_user1,ou=People,o=ap.openmail.sg,o=isp
uid: test_user1
mailUserStatus: active
inetUserStatus: deleted

This is where Sun Messaging Server differ from the other email products. A delete action does not actually remove/purge a user's mailbox, nor does it remove the user from the Directory Server. It merely set the inetUserStatus flag to "deleted".

In order to purge a user, 2 more steps are required:

  1. After a service has been marked as deleted, a utility that removes mail resource (msuserpurge) must be run before the service can be purged from the directory. 
  2. Permanently remove the user, by invoking the following command: commadmin domain purge 
So, here we go:

bash-3.00# /opt/sun/comms/messaging/lib/msuserpurge -d ap.openmail.sg -g 0

bash-3.00# ldapsearch -D "cn=Directory Manager" -w password -b o=ap.openmail.sg,o=isp uid=test*
dn: uid=test_user1,ou=People,o=ap.openmail.sg,o=isp
uid: test_user1
inetUserStatus: deleted
mailUserStatus: removed

bash-3.00# /opt/sun/comms/da/bin/commadmin domain purge -D admin -n openmail.sg -w password -d ap.openmail.sg -g 0
OK

bash-3.00# ldapsearch -D "cn=Directory Manager" -w password -b o=ap.openmail.sg,o=isp uid=test*
bash-3.00# 


No comments:

Post a Comment