Sun Java System Messaging Server 6 2005Q4 Administration Reference


The mboxutil command lists, creates, deletes, renames, or moves mailboxes (folders). mboxutil can also be used to report quota information.

You must specify mailbox names in the following format:


userid is the user that owns the mailbox and mailbox is the name of the mailbox.

Requirements: Must be run locally on the Messaging Server; the stored utility must also be running.

Location: msg_svr_base/bin/msg/admin/bin


mboxutil -l [-p MUTF7 IMAP pattern | -P regular expression] [-x | -s]

mboxutil -c mailbox

mboxutil -d {mailbox | -p MUTF7 IMAP pattern | -P regular expression}

mboxutil -R mailbox

mboxutil -r {oldname newname | -f file } [partition]

mboxutil -e [-p MUTF7 IMAP pattern | -P regular expression ]

mboxutil {-c | -d } [-f file ]

mboxutil -o [-w file ] [-t num]


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.). Then, run msuserpurge to remove the mailboxes. Next, use the commadmin user purge command to purge the users that have been marked as deleted for a period longer than the specified number of days.

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, 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.


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 by 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.

-t num

Lists the mailboxes that have not been accessed in a specified number of days (num). The -t option must be used with the -o option, which identifies orphaned mailboxes.

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.

-u user

Obsolete. Used to list user information. Use imquotacheck -u user

-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.


To list all mailboxes for all users:

mboxutil -l

To list all mailboxes and also include path and acl information:

mboxutil -l -x

To list all mailboxes displaying only the mailbox names:

mboxutil -l -s

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 Desdemona’s mail folder from memos to memos-april:

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 \

To list orphaned mailboxes and mailboxes that have not been accessed in 60 days:

mboxutil -o -w orphanfile -t 60

The preceding example writes the list of orphaned and inactive mailboxes to a file named orphanfile.

To delete orphaned and inactive mailboxes:

mboxutil -d -f orphanfile

where orphanfile is a file that has stored a list of orphaned and inactive mailboxes identified with the -o option.