Mac OS X 10.4 Server: Using cyradm to delete a user‘s mailboxes from the mail store

Issue or symptom

If you delete an email user from Mac OS X 10.4 Server, the deleted user's mailboxes are not automatically removed from the mail store.


Products affected


Solution

Use these steps to remove the deleted user's mailboxes.

Note: These steps involve editing a cyrus configuration file. If you're not familiar with editing text configuration files, see this article before proceeding.

  1. Open the file (/etc/imapd.conf) and look for this line:
    admins: cyrusimap

  2. Consider which user that you would like to be able to function as the mail administrator. The local administrative account may be a good choice. Add that user's short name after cyrusimap separated by a comma and space. For example, if the administrator has a short name of "appleadmin", the result should look like this:

    admins: cyrusimap, appleadmin

  3. Save the file and restart the Mail service with Server Admin.

    Note: The administrator that was set up in the previous step must have IMAP mail enabled for them in Workgroup Manager. In addition, IMAP access must be enabled in Server Admin -> Mail -> Settings -> General. Verify that the account has IMAP mail enabled in Server Admin and, if not, enable it.

  4. Open Terminal on the server and enter the following command on a single line:

    /usr/bin/cyrus/admin/cyradm -u appleadmin localhost

  5. You'll be prompted for the account password. Enter it, then you'll see the cyradm interactive prompt:

    localhost>


    Note: If desired, type "?" (without quotes) to see a full command list and explanation of each command.

    Note: To see a list of all the user's mailboxes, use the lm *username* command.


  6. Use the sam command to create an ACL on the mailbox so that appleadmin has access to delete it.

  7. Use the dm command to delete the appropriate mailbox.

Example

After a user named "misteruser" has been deleted from Workgroup Manager:

  1. Complete steps 1-4 above.
  2. get a list of just misteruser's mailboxes with this command (at the localhost> prompt):
  3. lm *misteruser*

    This shows mailboxes such as this:

    Other Users/misteruser (\\HasChildren)
    Other Users/misteruser/Sent Messages (\\HasNoChildren)
    Other Users/misteruser/Drafts (\\HasNoChildren)            
    Other Users/misteruser/Sent Messages (\\HasNoChildren)
  4. Examine the current ACL on their top-level mailbox with lam:
    lam Other\\ Users/misteruser

    This shows output such as this:
    misteruser lrswipcda

  5. Create a full control ACL for the appleadmin user with this command:
    sam Other\\ Users/misteruser appleadmin lrswipcda
  6. Verify the new ACL has been created:
    lam Other\\ Users/misteruser

    This shows output such as this:

    misteruser lrswipcda
    appleadmin lrswipcda
  7. Delete misteruser's mailbox:
    dm Other\\ Users/misteruser
  8. Verify that it's deleted:
    lm *misteruser*
Published Date: Oct 10, 2016