This section describes the following utilities for managing and monitoring mailboxes: mboxutil, hashdir, readership.
List and remove orphaned and inactive mailboxes
Move mailboxes from one partition to another
Restore expunged messages that have not been purged
List personal mailbox subscriptions and unsubscribed mailboxes that no longer exist
You can also use the mboxutil command to view information about quotas. For more information, see 20.11.4 To Monitor Quota Limits.
Note that you should not kill the mboxutil process in the middle of execution. If it is killed with SIGKILL (kill -9), it may potentially require that every server get restarted and a recovery be done.
See mboxutil in Sun Java System Messaging Server 6.3 Administration Reference for detailed syntax and usage requirements.
To list all mailboxes for all users:
To list all mailboxes and also include path and ACL information:
mboxutil -l -x
To create the default mailbox named INBOX for the user daphne:
mboxutil -c user/daphne/INBOX
To delete a mail folder named projx for the user delilah:
mboxutil -d user/delilah/projx
To delete the default mailbox named INBOX and all mail folders for the user druscilla:
mboxutil -d user/druscilla/INBOX
To rename the mail folder memos to memos-april for the user desdemona:
mboxutil -r user/desdemona/memos user/desdemona/memos-april
To move the mail account for the user dimitria to a new partition:
mboxutil -r user/dimitria/INBOX user/dimitria/INBOX partition
where partition specifies the name of the new partition.
To move the mail folder named personal for the user dimitria to a new partition:
mboxutil -r user/dimitria/personal user/dimitria/personal partition
Command output follows:
mboxutil: Start checking for orphaned mailboxes user/annie/INBOX user/oliver/INBOX mboxutil: Found 2 orphaned mailbox(es) mboxutil: Done checking for orphaned mailboxes
Use the following command to create a file listing orphaned mailboxes that can be turned into a script file that deletes the orphaned mailboxes (example filename is orphans.cmd):
mboxutil -o -w orphans.cmd
The command output is as follows:
mboxutil: Start checking for orphaned mailboxes mboxutil: Found 2 orphaned mailbox(es) mboxutil: Done checking for orphaned mailboxes
Delete the orphan files with the following command:
mboxutil -d -f orphans.cmd
The mailboxes in the message store are stored in a hash structure for fast searching. Consequently, to find the directory that contains a particular user’s mailbox, use the hashdir utility.
This utility identifies the directory that contains the message store for a particular account. This utility reports the relative path to the message store, such as d1/a7/. The path is relative to the directory level just before the one based on the user ID. The utility sends the path information to the standard output.
For example, to find the relative path to the mailbox for user crowe:
The readership utility reports on how many users other than the mailbox owner have read messages in a shared IMAP folder.
An owner of a IMAP folder may grant permission for others to read mail in the folder. A folder that others are allowed to access is called a shared folder. Administrators can use the readership utility to see how many users other than the owner are accessing a shared folder.
This utility scans all mailboxes and produces one line of output per shared folder, reporting the number of readers followed by a space and the name of the mailbox.
Each reader is a distinct authentication identity that has selected the shared folder within the past specified number of days. Users are not counted as reading their own personal mailboxes. Personal mailboxes are not reported unless there is at least one reader other than the folder’s owner.
For example, the following command counts as a reader any identity that has selected the shared IMAP folder within the last 15 days:
readership -d 15