IMAP::Admin(3)
๐ IMAP::Admin โ the Cyrus admin page ๐
hiii bestie, you've landed on IMAP::Admin(3), straight out of the User Contributed Perl Documentation corner of the manual. grab a snack, this one's actually useful ๐
โจ NAME โจ
Cyrus::IMAP::Admin โ the Cyrus administrative interface Perl module. yeah. that's the whole name. iconic, honestly ๐
๐ฆ SYNOPSIS ๐ฆ
okay so here's the whole vibe in code, no cap:
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's what powers Cyrus::IMAP::Admin::Shell โ you probably know her as cyradm โ and you can also use it in your own Perl administrative programs. she's versatile like that ๐
๐ METHODS ๐
A bunch of these methods come in two flavors: a cyradm-compatible name and a shorter name. Whenever a short name exists, that's the one shown in the synopsis; the cyradm-compatible one should be pretty obvious once you see it.
heads up bestie: in general, methods returnundefor empty lists when something goes wrong. but plot twist โ sometimes a method returns an empty list with no error at all (likeliston a hierarchy that doesn't exist), so if you really need to know, you gotta check the error state yourself with theerrormethod. don't get caught lacking ๐
๐ซ new($server[, $flags])
Instantiates a cyradm object. fun fact: this is literally a Cyrus::IMAP object with a few extra methods bolted on, so every single Cyrus::IMAP method is available to you if you need it. (and in particular? you will always want to use the authenticate method. always. periodt.)
๐ซ error
Returns the last error that happened, or undef if the last operation was a slay. This is, in some cases (like list), the only way to tell the difference between "successfully returned an empty list" and "something exploded."
Calling error does not reset the error state, so writing this is completely legal:
@folders = $cyradm->list($spec);
print STDERR "Error: ", $cyradm->error if $cyradm->error;
๐ซ createmailbox / create
createmailbox($mailbox[[, $partition], \%opts])create($mailbox[, $partition])
Creates a brand new mailbox on the specified partition, or the default one if you don't say. โจ
๐ซ deletemailbox / delete
deletemailbox($mailbox)delete($mailbox)
Deletes a mailbox. and bestie, listen โ same as with cyradm, you'll probably need to give yourself the c ACL on that mailbox first using setaclmailbox. yes really. do it first. ๐
๐ซ deleteaclmailbox / deleteacl
deleteaclmailbox($mailbox, $user[, ...])deleteacl($mailbox, $user[, ...])
Deletes one or more ACLs from a mailbox. bye felicia ๐
๐ซ listaclmailbox / listacl
listaclmailbox($mailbox)listacl($mailbox)
Returns a hash of mailbox ACLs โ each key is a Cyrus user, and each value is the ACL that user has. cute little key-value moment ๐
๐ซ listmailbox / list
listmailbox($pattern[[, $reference], \%opts])list($pattern[[, $reference], \%opts])
Lists mailboxes that match the given pattern, starting from the given reference. The result is a list; every element is an array holding the mailbox name, its attributes, and the separator. (this interface may change, so don't get too attached ๐ญ)
๐ซ listsubscribed / subscribed
listsubscribed($pattern[, $reference])subscribed($pattern[, $reference])
Exactly like listmailbox, except it only shows the mailboxes you're actually subscribed to. no lurkers allowed ๐ซถ
๐ซ listquota / quota
listquota($root)quota($root)
Returns a hash with the quota for the quota root you specified. psst โ use listquotaroot to find the quota root for a mailbox if you don't know it.
๐ซ listquotaroot / quotaroot
listquotaroot($mailbox)quotaroot($mailbox)
Returns a list: first element is the quota root for the mailbox, and the rest of the elements are a hash describing its quota. main character first, details after ๐
๐ซ renamemailbox / rename
renamemailbox($from, $to[, $partition])rename($from, $to[, $partition])
Renames the given mailbox, and optionally moves it to a whole different partition while she's at it. glow-up + relocation ๐ฆ
๐ซ setaclmailbox / setacl
setaclmailbox($mailbox, $user => $acl[, ...])setacl($mailbox, $user => $acl[, ...])
Sets ACLs on a mailbox. The ACL can be one of these special strings โ none, read (lrs), post (lrsp), append (lrsip), write (lrswipkxte), delete (lrxte), or all (lrswipkxte) โ or literally any combination of the ACL codes below:
lโ Lookup (mailbox is visible to LIST/LSUB, SUBSCRIBE mailbox)rโ Read (SELECT/EXAMINE the mailbox, perform STATUS)sโ Seen (set/clear\SEENflag via STORE, also set\SEENflag during APPEND/COPY/FETCH BODY[...])wโ Write flags other than\SEENand\DELETEDiโ Insert (APPEND, COPY destination)pโ Post (send mail to mailbox)kโ Create mailbox (CREATE new sub-mailboxes, parent for new mailbox in RENAME)xโ Delete mailbox (DELETE mailbox, old mailbox name in RENAME)tโ Delete messages (set/clear\DELETEDflag via STORE, also set\DELETEDflag during APPEND/COPY)eโ Perform EXPUNGE and expunge as part of CLOSEaโ Administer (SETACL/DELETEACL/GETACL/LISTRIGHTS)
๐ซ setquota($mailbox, $resource, $quota[, ...])
Sets quotas on a mailbox. quick note: Cyrus currently only defines one resource, STORAGE. and as defined in RFC 2087, the units are groups of 1024 octets (i.e. Kilobytes). math girlies rise ๐งฎโจ
๐ซ xfermailbox / xfer
xfermailbox($mailbox, $server[, $partition])xfer($mailbox, $server[, $partition])
Transfers (relocates) the given mailbox over to a different server. she's moving out, no forwarding address ๐
๐ AUTHOR ๐
Brandon S. Allbery, allbery@ece.cmu.edu โ thank you for your service king ๐ซก
๐ SEE ALSO ๐
Cyrus::IMAP Cyrus::IMAP::Shell perl(1), cyradm(1), imapd(8).
and that's the whole page bestie!! this was perl v5.42.3, dated 2026-09-11, and you just read the IMAP::Admin(3) manual. go forth and administer some mailboxes, you absolute icon ๐โจ๐๐ฆ
๐ฆ where this page comes from
- fedora 43: perl-Cyrus 3.10.4-1.fc43 ยท BSD-Attribution-HPND-disclaimer
- fedora 44: perl-Cyrus 3.12.4-1.fc44 ยท BSD-Attribution-HPND-disclaimer
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms