Sun Java System Messaging Server 6.3 Administration Reference


The options for this command are:




Obsolete. Used to list all user quota information. Use. imquotacheck

-c mailbox

Creates the specified mailbox. 

A mailbox must exist before creating a secondary mailbox. 

-d mailbox

Deletes the specified mailbox. 

To delete a user from the message store, use the following value for -d mailbox:


For example, to delete the user john from the message store, use -d user/john/INBOX. To delete the mm folder in the user john’s mailbox, use -d user/john/mm.

The recommended method to delete a user is to mark the user status as deleted in the LDAP directory (by using the Delegated Administrator utility commadmin user delete command or the Delegated Administrator console.). Next, remove resources from the user that have been marked as deleted for a period longer than a specified number of days by using the msuserpurge command for all mail services and csclean for all calendar services. Finally, use the commadmin domain purge command to permanently remove the users. .

For more information on removing users, see the following technical note: Deleting Messaging Server, Calendar Server, and Communications Express Users

If you use the Delegated Administrator utility as described in the preceding paragraph, you do not have to use the mboxutil -d command to delete a mailbox.

Note that -p and -P can be used in conjunction with one another.


Expunges all deleted messages in the message store. This option also can be used with the -p pattern or -P regexp options to expunge all deleted mailboxes with names that match pattern or regexp.

-f file

Specifies a file that stores mailbox names. The -f option can be used with the -c, -r, -S, or -d options.

The file contains a list of mailboxes on which the mboxutil command is executed. The following is an example of entries in a data file:



Lists all of the mailboxes on a server. 

mboxutil -l will correctly display characters associated with the system locale under which mboxutil is being executed. The -P regexp option will accept international characters.


Lists personal, non-existing mailbox subscriptions. The -n option is used with the -S option.


Checks for orphaned accounts. This option searches for inboxes in the current messaging server host which do not have corresponding entries in LDAP. For example, the -o option finds inboxes of owners who have been deleted from LDAP or moved to a different server host. For each orphaned account it finds, mboxutil writes the following command to the standard output:

mboxutil-d user/userid/INBOX unless -w is specified

-p pattern

When used with the -l option, lists only those mailboxes with names that match pattern.

Can also be used with the -d or -e option to delete or expunge mailboxes with names that match pattern.

You can use IMAP wildcards. This option expects a pattern in IMAP M-UTF-7 format. This is not the recommended way to search for non ascii mailboxes. To search for non ascii mailboxes, use the -P option. 

-P regexp

Lists, deletes, or expunges only those mailboxes with names that match the specified POSIX regular expression. This option expects the regexp in the local character encoding.

-q domain

Obsolete. Use imquotacheck -d domain

-r oldname newname [partition]

Renames the mailbox from oldname to newname. To move a folder from one partition to another, specify the new partition with the partition option.

This option can be used to rename a user. For example, mboxutil -r user/user1/INBOX user/user2/INBOX moves all mail and mailboxes from user1 to user2, and new messages will appear in the new INBOX. (If user2 already exists, this operation will fail.)

-R mailbox

Restores deleted messages that have not yet been purged. 

When a mailbox is expunged or expired, the uids of the deleted messages are stored in a store.exp file. The messages are physically removed by imexpire after the cleanup age has passed. When expunge or expire is issued by mistake, this option can be used to restore the deleted messages that have not been purged by imexpire into the original mailbox.


When used with the -l option, displays only the mailbox name. No other data is displayed.


Lists personal mailbox subscriptions. When used with the -n option, the -S option lists or unsubscribes non-existing mailbox subscriptions.

-t days

| hours

When used with the -o option, lists the mailboxes that have not been accessed in a specified number of days (days).

When used with the -R option, restores messages that were expunged in the last specified number of hours (hours). If the -R option is used without the -t option, all messages that were expunged or expired are restored, regardless of their age.

Thus, the -t option identifies inactive mailboxes (based on last-accessed date) together with orphaned mailboxes (mailboxes that do not have corresponding user entries in the LDAP directory).

To identify (list) the orphaned and inactive mailboxes, use mboxutil -o -w file -t num.

To mark these orphaned and inactive mailboxes for deletion, use mboxutil -d -f file, where file is the same file as the one passed to -w in the preceding command.

To use this feature, the config variable local.enablelastaccess must be enabled for at least the number of days specified with the -t option.


Unsubscribe personal non-existing mailbox subscriptions listed in the file specified with the -f file option.

-w file

Used with the -o option. Writes to a file the mailbox names generated by the -o option (which identifies orphaned accounts).


When used with the -l option, displays the path and access control for a mailbox.