IMAP::Shell(3)
π NAME π
Cyrus::IMAP::Shell β it's literally the Perl glow-up of cyradm, no cap. That's the whole vibe. This page is IMAP::Shell(3) and bestie, we're about to read it together.
β¨ SYNOPSIS β¨
okay so here's how you summon it, the classic way:
$ cyradm [--user authid] [--authz authzid] [--[no]rc] [--systemrc file] [--userrc file] \
> [--port n] [--auth mechanism] [--server] server
but possibly, like, the cooler way:
$ perl -MCyrus::IMAP::Shell -e 'run("myscript")'
or even β and I'm gonna hold your hand when I say this β not recommended:
use Cyrus::IMAP::Admin::Shell;
run('myscriptname');
π DESCRIPTION π
So this module implements cyradm in Perl. It's a shell wrapped around Cyrus::IMAP::Admin. Commands show up in both Tcl-compatible forms and GNU-style long option forms β we contain multitudes, bestie.
The cyradm utility is a simple command line for doing all the common admin tasks on a Cyrus IMAP server, and it's written in Perl. It's giving "I do it all myself."
The cyradm utility can either be run from a client where it's been installed and connect to the server via IMAP, or it can be run locally via a shell on the server itself. Your choice, main character energy either way.
cyradm understands /bin/sh-style redirection: any command can have its standard or error output redirected, and all sh-style redirections are supported β except \<\>. It does not currently understand pipes or backgrounding. So no | shenanigans, no & shenanigans, sorry gorgeous.
If the Term::Readline::Perl or Term::Readline::GNU modules are available, cyradm will use it. Fancy line editing when it can get it. π
πΈ COMMAND-LINE ARGUMENTS πΈ
these are your flags, bestie, learn them, love them:
--u,--useruser β authenticate with the username you specified. Say who you are, periodt.--authzuser β authorize the connection as being that specified username.--norc,--rcβ (don't) load the configuration files.--norc= skip 'em,--rc= load 'em.--systemrcfile β use the system configuration file you specified.--userrcfile β use the user configuration file you specified.--portport β connect to the server specified, on the port specified.--authmechanism β use the mechanism specified to authenticate. One ofPLAIN,LOGIN, etc.--helpβ show a help message about these command-line options. It's giving helpful.--versionβ display the version of Cyrus IMAP that the currentcyradmcommand is a part of.--serverserver β the server address to connect to.
lowkey the move is: know your flags, respect your flags, and you'll never get stuck at the auth prompt wondering what went wrong π«Ά
β¨ COMMANDS β¨
π authenticate
authenticate ["--minssf" N] ["--maxssf" N] ["--mechanisms" list]
["--service" name] ["--tlskey" keyfile] ["--notls"] ["--cafile"
cacertfile] ["--capath" cacertdir] user
Okay bestie, this is how you authenticate to the server. You must already be connected, and Cyrus imapd will refuse to let you re-authenticate once you've authenticated once. So like, one shot, no take-backs. π
aliases: "auth", "login"
π chdir
chdir directory
Change directory. A pwd builtin is not provided, but the default command action will run pwd from a shell if invoked. So if you're nosy about where you are, just type pwd and the shell's got you. π
aliases: "cd"
π¬ createmailbox
createmailbox ["--partition" partition] ["--specialuse" specialuse]
mailbox
createmailbox ["--specialuse" specialuse] mailbox partition
Create a mailbox on the default or a specified partition. Both old-style and getopt-style usages are accepted (combining them will produce an error β don't be messy). Optionally assign a special use to the mailbox.
New mailboxes inherit the ACL permissions of their parent mailbox, except for top-level mailboxes such as the user's INBOX. Mailboxes that are the user's INBOX are assigned all to the corresponding user. So your inbox is literally all yours, periodt. π
Example Usage
localhost> :command:`cm user.john`
localhost> :command:`lm`
user.john (\HasNoChildren)
localhost> :command:`lam user.john`
john lrswipkxtecda
Note that in the above example, the"unixhierarchysep"setting inimapd.confis set to0. When using the UNIX hierarchy separator, the"/"(forward slash) character would be used as the hierarchy separator, and the example would look as follows:
Example Usage with "unixhierarchysep: 1"
localhost> :command:`cm user/john`
localhost> :command:`lm`
user/john (\HasNoChildren)
localhost> :command:`lam user/john`
john lrswipkxtecda
Note The above examples use the unqualified, shorthand user identifierjohnas the mailbox name. With the use of virtual domains, controlled through the"virtdomains"setting inimapd.conf(5).
aliases: "cm", "create"
ποΈ deleteaclmailbox
deleteaclmailbox mailbox id [...]
Remove ACLs from the specified mailbox. Bye-bye permissions, hope you didn't need them. π
aliases: "delteacl", "dam"
ποΈ deletemailbox
deletemailbox mailbox
Delete the specified mailbox. Poof, gone. β¨
Administrators do not have implicit delete rights on mailboxes. Use the "setaclmailbox" command to grant the "x" permission to your principal if you need to delete a mailbox you do not own. So like, you can't just waltz in and delete stuff, okay? Ask nicely with ACLs.
aliases: "delete", "dm"
π disconnect
disconnect
Disconnect from the current server. The prompt will revert to "cyradm>". This does not quit cyradm. So you're still in the driver's seat, just unplugged. π
aliases: "disc"
πͺ exit
exit [number]
Exit "cyradm", optionally with a specific exit status; the exit status of the last command will be used if one is not specified. So you can leave with drama or just slip out quietly. πͺπ¨
aliases: "quit"
β help
help [command]
Show help for "command" or all commands. The ? alias is giving main character energy. πββοΈ
aliases: "?"
π·οΈ getmetadata
getmetadata [mailbox]
Display mailbox/server metadata. It's like snooping but, like, authorized. π
aliases: "getmd"
βΉοΈ info
info [mailbox]
Display the mailbox/server annotations.
π listaclmailbox
listaclmailbox mailbox
List ACLs on the specified mailbox. See who can do what. Nosy but useful. π΅οΈββοΈ
aliases: "lam", "listacl"
π listmailbox
listmailbox ["--subscribed"] ["--specialuse"] [pattern [reference]]
List all, or all subscribed or special-use, mailboxes matching the specified pattern. The pattern may have embedded wildcards '*' or '%', which match anything or anything except the separator character, respectively. So * is the "anything goes" wildcard, and % is the "anything but the separator" wildcard. Slay. π
Mailboxes returned will be relative to the specified reference if one is specified. This allows a mailbox list to be limited to a particular hierarchy. Like zooming in on a specific folder tree. π³
In some cases when the '%' wildcard is used to end a pattern, it may match an entry which is not a mailbox but which contains other mailboxes. In this case, the entry will be parenthesized to indicate that it is a root for other mailboxes, as opposed to a mailbox itself. So if you see parentheses, it's a parent, not a mailbox. π
aliases: "list", "lm"
π listquota
listquota root
List quotas on specified root. If the specified mailbox path does not have a quota assigned, an error will be raised; see "listquotaroot" for a way to find the quota root for a mailbox. So if you get an error, don't panic, just use listquotaroot. π§ββοΈ
aliases: "lq"
π listquotaroot
listquotaroot mailbox
Show quota roots and quotas for mailbox. Quota detective, at your service. π
aliases: "lqm", "lqr"
βοΈ mboxconfig
mboxconfig ["--private"] mailbox attribute value
Set mailbox metadata, optionally set the private instead of the shared version of the metadata. A value of "none" will remove the attribute. So none is the delete button, basically. ποΈ
The currently supported attributes are:
"comment"description β Sets a comment or description associated with the mailbox."expire"days β Sets the number of days after which messages will be expired from the mailbox."news2mail"address β Sets an email address to which messages injected into the server via NNTP will be sent."pop3showafter"time β Sets a time (in RFC3501 format, for example"6-Jan-2011 11:45:32 +1100") which specifies a cutoff date such that POP3 fetching of the folder does not see messages whose internaldate is before or equal to the date."sharedseen"true|false β Enables the use of a shared\Seenflag on messages rather than a per-user\Seenflag. The's'right in the mailbox ACL still controls whether a user can set the shared\Seenflag."sieve"scriptname β Indicates the name of the global sieve script that should be run when a message is delivered to the shared mailbox (not used for personal mailboxes)."squat"true|false β Indicates that the mailbox should have a squat index created for it.
aliases: "mboxcfg"
π¨ reconstruct
reconstruct ["-r"] mailbox
Reconstruct the specified mailbox, optionally recursing and reconstructing child mailboxes if the "-r" flag is given. Like a glow-up for your mailbox. π
For more information see reconstruct(8).
βοΈ renamemailbox
renamemailbox ["--partition" partition] oldname newname
renamemailbox oldname newname [partition]
Rename the specified mailbox, optionally moving it to a different partition. Both old-style and getopt-style usages are accepted; combining them will produce an error. So pick a lane, bestie. π£οΈ
aliases: "rename", "renm"
π₯οΈ server
server
server [--noauthenticate] [server]
With no arguments, show the current server. With an argument, connect to that server. It will prompt for automatic login unless the "--noauthenticate" option is specified. (This may change; in particular, either automatic authentication will be removed or all "authenticate" options will be added.) So stay tuned, I guess. π‘
When connected to a server, cyradm's prompt changes from "cyradm>" to "servername>", where servername is the fully qualified domain name of the connected server. So your prompt is literally telling you where you are. Iconic. π
aliases: "connect", "servername"
π setaclmailbox
setaclmailbox mailbox id rights [id rights ...]
Set ACLs on a mailbox. The ACL may be one of the special strings "none", "read" ("lrs"), "post" ("lrsp"), "append" ("lrsip"), "write" ("lrswipkxte"), "delete" ("lrxte"), or "all" ("lrswipkxte"), or any combinations of the ACL codes:
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)
aliases: "setacl", "sam"
π setinfo
setinfo attribute value
Set server metadata. A value of "none" will remove the attribute. The currently supported attributes are:
"motd"message β Sets a"message of the day". The message gets displayed as an ALERT upon connection."comment"note β Sets a comment or description associated with the server."admin"address β Sets the administrator email address for the server."shutdown"message β Sets a shutdown message. The message gets displayed as an ALERT and all users are disconnected from the server (subsequent logins are disallowed)."expire"days β Sets the number of days after which messages will be expired from the server (unless overridden by a mailbox annotation)."squat"true|false β Indicates that all mailboxes should have squat indexes created for them (unless overridden by a mailbox annotation).
π·οΈ setmetadata
setmetadata [--private] mailbox [annotation] value
Set metadata on mailbox, where annotation is one of [comment|expire|news2mail|pop3showafter|sharedseen|sieve|specialuse|squat|/<explicit annotation>].
Note that value with a leading backslash must be escaped with an additional backslash. For example:
setmetadata --private Spam specialuse "\\Junk"
Note, too, that "private" annotations are private to the user currently authenticated as, not necessarily the owner of the mailbox. To set annotations for another user you must authorize as that user.
In addition to the use of optional flag --private, one may use a more explicit syntax, prefixing the annotation with /shared/ or /private/ as in this example:
setmetadata Spam /private/specialuse "\\Junk"
aliases: "setmd"
π setquota
setquota root resource value [resource value ...]
Set a quota on the specified root, which may or may not be an actual mailbox. The resources understood by Cyrus are "STORAGE", "MESSAGE", "X-NUM-FOLDERS" and "X-ANNOTATION-STORAGE". The storage units are, as defined in RFC 2087, groups of 1024 octets (i.e. Kilobytes). The value may be the special string "none" which will remove the quota. So none is the "never mind" button. π
ββοΈ
aliases: "sq"
π subscribe
subscribe mailbox
Subscribe to the given mailbox. Join the club. π
π unsubscribe
unsubscribe mailbox
Unsubscribe to the given mailbox. Leave the club. No hard feelings. βοΈ
π version
version
Display the version info of the current server. Know your server's era. πββοΈ
aliases: "ver"
π xfermailbox
xfermailbox ["--partition" partition] mailbox server
xfermailbox mailbox server [partition]
Transfer (relocate) the specified mailbox to a different server. Both old-style and getopt-style usages are accepted; combining them will produce an error. So don't mix and match, okay? πβ¨
aliases: "xfer"
π NOTES π
ok so before you go off and start typing, bestie, there's some lore you gotta know π«Ά
- GNU-style long options? they have to be given in their entirety. no shortcuts, no abbreviations, no half-sending the vibe.
<hotpink>spell it all the way out.</hotpink> - Tcl-style options can be abbreviated. but likeβ¦ π
- Tcl-style options are provided as a compatibility feature. They will probably go away in the future. so don't get too attached, they're giving guest-star energy, not main-character.
- You can stack multiple commands on one line, separated by
;characters. periodt. - All commands set an exit status, which at present is not useful. like it's there, it's doing its little thing, we're not using it for anything. π
- Unknown commands are passed to a subshell for execution. so if you type nonsense, the shell gets handed the nonsense. iconic delegation honestly.
- The Tcl version of cyradm is used for scripting as well as interactively. While this is possible to a limited extent by use of the
"run"method, scripting would normally be done with"Cyrus::IMAP::Admin", which is far more flexible than either interactive"cyradm"or the Tcl scripting mechanism for Cyrus. so like β yes you can script with it a bit, but there's a whole better tool for that and it's not even close π - cyradm understands
/bin/sh-style redirection: any command can have its standard or error output redirected, with all sh-style redirections (except"<>") supported. It does not currently understand pipes or backgrounding. so<cyan>redirect away, but no|and no&` β that's just not in the building yet π - If the
"Term::Readline::Perl"or"Term::Readline::GNU"modules are available, cyradm will use it. fancy line-editing if you've got the goods β¨ - An alias facility is implemented internally, but no access is currently provided to it. This will change, if only to allow some of the predefined aliases to be removed if they conflict with useful shell commands. so it's there, it's real, you just can't touch it yet. someday π₯²
π AUTHOR π
Brandon S. Allbery, allbery@ece.cmu.edu
give them their flowers, fr fr πΈ
π SEE ALSO π
Cyrus::IMAP::AdminTerm::ReadLinesh(1)perl(1)imapd(8)imapd.conf(5)reconstruct(8)
go read those too, iykyk π¦
and that's the whole page, bestie!! π this one came from perl v5.42.3 and it's dated 2026-09-11 β so go forth, cyradm responsibly, and remember: every option, every caveat, every deprecated little Tcl ghost is still in here exactly where it belongs. slay πβ¨
π¦ where this page comes from
- 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