Common Tasks

This section shows examples of common tasks you’ll perform every day using cyradm: listing, creating, and deleting mailboxes; setting quotas; and setting ACLs.

Listing Mailboxes

The listmailbox (or lm) command returns a list of mailbox names that match the pattern given as an argument. The pattern can contain one of the wildcard characters asterisk (*) or percent (%). The * wildcard matches zero or more characters. The % wildcard is like the * wildcard, except that it only matches mailboxes at a single level in the mailbox hierarchy.

You can list all the users on the system by listing their top-level mailboxes (remember, a top-level mailbox is essentially the same as a username in the Cyrus namespace):

localhost>listmailbox user.%

To list all mailboxes one level below abt0003 ’s top-level mailbox, you would use the % wildcard character to restrict output to include only that level:

localhost>listmailbox user.abt0003.%
user.abt0003.drafts     user.abt0003.sent-mail

To list all users whose usernames begin with the letters abt, you would again use the % wildcard to restrict output to only top-level mailboxes:

localhost> listmailbox user.abt%
user.abt0003  user.abt0008

The next example shows how the * wildcard character returns mailboxes that match the pattern at all levels of the mailbox hierarchy:

localhost>listmailbox user.abt*
user.abt0003            user.abt0003.sent-mail  user.abt0008.drafts
user.abt0003.drafts     user.abt0008

Creating a Mailbox or Adding a User

The createmailbox ...

Get Managing IMAP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.