IMAP::Shell(3)
π IMAP::Shell(3) π
okay bestie, welcome to IMAP::Shell(3), straight outta the User Contributed Perl Documentation corner of the internet π«Ά this one is giving βPerl girlie who absolutely runs the mail serverβ and honestly? iconic.
πΈ NAME πΈ
Cyrus::IMAP::Shell β Perl version of cyradm β¨
π¦ SYNOPSIS π¦
like, the main-character invocation is:
$ cyradm [--user authid] [--authz authzid] [--[no]rc] [--systemrc file] [--userrc file] \
> [--port n] [--auth mechanism] [--server] server
but possibly:
$ perl -MCyrus::IMAP::Shell -e 'run("myscript")'
or even (not recommended):
use Cyrus::IMAP::Admin::Shell;
run('myscriptname');
bestie, that last one is literally marked not recommended in the original, so maybe donβt make it your whole personality π
π DESCRIPTION π
This module implements cyradm in Perl. Itβs a shell around Cyrus::IMAP::Admin. Commands are provided in both Tcl-compatible forms and GNU-style long option forms. slay π
The cyradm utility is a simple command line for performing common administrative tasks on a Cyrus IMAP server, written in Perl.
The cyradm utility can either be executed from a client where it has been installed and connect to the server via IMAP, or it can be executed locally via a shell on the server. both valid, both kinda main character energy β¨
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. no pipes, no backgrounding, no cap π
If the Term::Readline::Perl or Term::Readline::GNU modules are available, cyradm will use it. cute.
π COMMAND-LINE ARGUMENTS π
--u,--useruser β authenticate with the specified username π--authzuser β authorize the connection as being the specified username π«Ά--norc,--rcβ (do not) load the configuration files. yes bestie, itβs the βdo not / doβ duo πΈ--systemrcfile β use the system configuration file specified.--userrcfile β use the user configuration file specified.--portport β connect to the server specified on the port specified. port vibe check β--authmechanism β use the mechanism specified to authenticate. One ofPLAIN,LOGIN, etc.--helpβ show a help message about these command-line options. bestie behavior honestly π«Ά--versionβ display the version of Cyrus IMAP the currentcyradmcommand is a part of.--serverserver β the server address to connect to. go connect, icon π
π COMMANDS π
πΈ authenticate πΈ
authenticate ["--minssf" N] ["--maxssf" N] ["--mechanisms" list] ["--service" name] ["--tlskey" keyfile] ["--notls"] ["--cafile" cacertfile] ["--capath" cacertdir] user
okay so authenticate logs you into the server. You have to already be connected first, and Cyrus imapd will absolutely refuse to let you re-authenticate once youβve authenticated once. no cap.
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.
aliases: cd.
π createmailbox π
createmailbox ["--partition" partition] ["--specialuse" specialuse] mailbox
createmailbox ["--specialuse" specialuse] mailbox partition
Create a mailbox on the default partition or a specified partition. Both old-style and getopt-style usages are accepted β combining them will produce an error. 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.
π« Example Usage π«
localhost> cm user.john
localhost> lm
user.john (\HasNoChildren)
localhost> lam user.john
john lrswipkxtecda
Note β 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> cm user/john
localhost> lm
user/john (\HasNoChildren)
localhost> 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.
aliases: delteacl, dam.
π deletemailbox π
deletemailbox mailbox
Delete the specified mailbox.
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.
aliases: delete, dm.
π§ disconnect π§
disconnect
Disconnect from the current server. The prompt will revert to cyradm>. This does not quit cyradm.
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.
aliases: quit.
β¨ help β¨
help [command]
Show help for command or all commands.
aliases: ?.
π«Ά getmetadata π«Ά
getmetadata [mailbox]
Display mailbox/server metadata.
aliases: getmd.
πΈ info πΈ
info [mailbox]
Display the mailbox/server annotations.
π¦ listaclmailbox π¦
listaclmailbox mailbox
List ACLs on the specified mailbox.
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.
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.
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.
aliases: list, lm.
π« listquota π«
listquota root
List quotas on the 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.
aliases: lq.
π listquotaroot π
listquotaroot mailbox
Show quota roots and quotas for mailbox.
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.
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.
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.
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.)
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.
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.
aliases: sq.
π« subscribe π«
subscribe mailbox
Subscribe to the given mailbox.
π unsubscribe π
unsubscribe mailbox
Unsubscribe to the given mailbox.
π version π
version
Display the version info of the current server.
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.
aliases: xfer.
π¬ NOTES π¬
Okay bestie, some little deets before you go off and script things π«Ά
- GNU-style long options? You gotta spell those out in their entirety, no shortcuts. Tcl-style options can be abbreviated though β slay for them, I guess.
- Speaking of which: Tcl-style options are just a compatibility feature. They will probably go away in the future π so don't get too attached, ngl.
- You can stack multiple commands on one line, separating them with
;characters. Very main-character multitasking energy β¨ - Every command sets an exit status β which at present is not useful. Literally not useful. Don't build your whole personality on it π
- Unknown commands get passed to a subshell for execution. So if you type nonsense, the shell might still eat it up π
- The Tcl version of
cyradmis used for scripting and interactively. You can kinda-sorta script with the"run"method, but 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. It's giving "use the good one, babe" π cyradmunderstands/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 don't try to pipe your way out of this one π- If the
"Term::Readline::Perl"or"Term::Readline::GNU"modules are available,cyradmwill use it. Fancy line editing, we love to see it π - There's an alias facility implemented internally, but no access is currently provided to it π€ That will change β if only to allow some of the predefined aliases to be removed if they conflict with useful shell commands. Future you problems, fr fr.
π AUTHOR π
Brandon S. Allbery, allbery@ece.cmu.edu β iconic, we stan π«Ά
π SEE ALSO π
Cyrus::IMAP::AdminTerm::ReadLinesh(1)perl(1)imapd(8)imapd.conf(5)reconstruct(8)
Go read them, iykyk πβ¨
That's the whole page, bestie! This one'sperl v5.42.3, dated1980-01-01, and it lives atIMAP::Shell(3). Now go forth and slay your mailbox πππ¦
π¦ where this page comes from
- nixos 26.05: cyrus-imapd 3.12.4
- nixpkgs unstable: cyrus-imapd 3.12.4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms