man Cyrus::IMAP::Admin () - Cyrus administrative interface Perl module

NAME

Cyrus::IMAP::Admin - Cyrus administrative interface Perl module

SYNOPSIS

  use Cyrus::IMAP::Admin;

  my $client = Cyrus::IMAP::Admin->new('mailhost'[, $flags]);
  $rc = $client->create('user.auser'[, $partition]);
  $rc = $client->delete('user.auser');
  $rc = $client->deleteacl('user.buser', 'user1', 'user2');
  %acls = $client->listacl('user.buser');
  @mailboxes = $client->list('*');
  @mailboxes = $client->list('%', 'user.');
  @mailboxes = $client->subscribed('*');
  %quota = $client->quota($root);
  ($root, %quota) = $client->quotaroot($mailbox);
  $rc = $client->rename($old, $new[, $partition]);
  $rc = $client->setacl($mailbox, $user =E<gt> $acl[, ...]);
  $rc = $client->setquota($mailbox, $resource =E<gt> $quota[, ...]);
  $rc = $client->xfer($mailbox, $server[, $partition]);

DESCRIPTION

This module is a Perl interface to Cyrus administrative functions. It is used to implement Cyrus::IMAP::Admin::Shell (otherwise known as cyradm and also available for use in Perl administrative programs.

METHODS

Many of the methods have a cyradm-compatible name and a shorter name. The shorter name is shown in the synopsis when it exists; the cyradm-compatible name should be reasonably obvious.

In general, methods return undef or empty lists on error. In some cases a method may return an empty list without an error (i.e. CWlist of a nonexistent hierarchy), so it may be necessary to check the error state explicitly via the CWerror method. Instantiates a cyradm object. This is in fact an Cyrus::IMAP object with a few additional methods, so all Cyrus::IMAP methods are available if needed. (In particular, you will always want to use the CWauthenticate method.)

error
Return the last error that occurred, or undef if the last operation was successful. This is in some cases (such as CWlist) the only way to distinguish between a successful return of an empty list and an error return. Calling CWerror does not reset the error state, so it is legal to write:
    @folders = $cyradm->list($spec);
    print STDERR "Error: ", $cyradm->error if $cyradm->error;
Create a new mailbox on the specified or default partition.
deletemailbox($mailbox)
delete($mailbox)
Delete a mailbox. As with cyradm, you will probably need to add the c ACL for yourself to the mailbox with CWsetaclmailbox first. Delete one or more ACL from a mailbox.
listaclmailbox($mailbox)
listacl($mailbox)
Returns a hash of mailbox ACLs, with each key being a Cyrus user and the corresponding value being the ACL. List mailboxes matching the specified pattern, starting from the specified reference. The result is a list; each element is an array containing the mailbox name, attributes, and the separator. (This interface may change.) Like CWlistmailbox but only shows subscribed mailboxes.
listquota($root)
quota($root)
Returns a hash specifying the quota for the specified quota root. Use CWlistquotaroot to find the quota root for a mailbox.
listquotaroot($mailbox)
quotaroot($mailbox)
Returns a list, the first element is the quota root for the mailbox and remaining elements are a hash specifying its quota. Renames the specified mailbox, optionally moving it to a different partition. Set ACLs on a mailbox. The ACL may be one of the special strings CWnone, CWread (CWlrs), CWpost (CWlrsp), CWappend (CWlrsip), CWwrite (CWlrswipcd), CWdelete (CWlrd), or CWall (CWlrswipcda), or any combinations of the ACL codes:
l
Lookup (visible to LIST/LSUB/UNSEEN)
r
Read (SELECT, CHECK, FETCH, PARTIAL, SEARCH, COPY source)
s
Seen (STORE \SEEN)
w
Write flags other than \SEEN and \DELETED
i
Insert (APPEND, COPY destination)
p
Post (send mail to mailbox)
c
Create (subfolders)
d
Delete (STORE \DELETED, EXPUNGE)
a
Administer (SETACL) Set quotas on a mailbox. Note that Cyrus currently only defines one resource, CWSTORAGE. As defined in RFC 2087, the units are groups of 1024 octets (i.e. Kilobytes) Transfers (relocates) the specified mailbox to a different server.

AUTHOR

Brandon S. Allbery, allbery@ece.cmu.edu

SEE ALSO

Cyrus::IMAP Cyrus::IMAP::Shell perl(1), cyradm(1), imapd(8).