Cyrus::IMAP::Shell - Perl version of cyradm
$ 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');
This module implements cyradm in Perl. It is a shell around Cyrus::IMAP::Admin. Commands are provided in both Tcl-compatible forms and GNU-style long option forms.
authenticate
[--minssf
N] [--maxssf
N] [--mechanisms
list] [user]
auth
[--minssf
N] [--maxssf
N] [--mechanisms
list] [user]
login
[--minssf
N] [--maxssf
N] [--mechanisms
list] [user]
chdir
directory
cd
directory
pwd
builtin is not provided, but the default command
action will run pwd
from a shell if invoked.
createmailbox
[--partition
partition] mailbox
createmailbox
mailbox partition
create
[--partition
partition] mailbox
create
mailbox partition
cm
[--partition
partition] mailbox
cm
mailbox partition
deleteaclmailbox
mailbox id [...]
deleteacl
mailbox id [...]
dam
mailbox id [...]
deletemailbox
mailbox
delete
mailbox
dm
mailbox
Delete the specified mailbox.
Administrators do not have implicit delete rights on mailboxes. Use the
setaclmailbox command to grant the c
permission (or other permission
as specified by the deleteright configuration option in imapd.conf)
to your principal if you need to delete a mailbox you do not own.
Note that the online help admits to an optional host argument. This argument is not currently used, and will be rejected with an error if specified; it is reserved for IMSP.
disconnect
disc
cyradm>
.
exit
[number]
quit
[number]
command
or all commands.
info
[mailbox]
listmailbox
[--subscribed
] [pattern [reference]]
list
[--subscribed
] [pattern [reference]]
lm
[--subscribed
] [pattern [reference]]
List all, or all subscribed, 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.
listquota
root
lq
root
listquotaroot
mailbox
lqm
mailbox
lqr
mailbox?
mboxconfig
mailbox attribute value
mboxcfg
mailbox attribute value
Set mailbox metadata. A value of "none" will remove the attribute. The currently supported attributes are:
comment
expire
sieve
squat
news2mail
renamemailbox
[--partition
partition] oldname newname
rename
[--partition
partition] oldname newname
renm
[--partition
partition] oldname newname
renamemailbox
oldname newname [partition]
rename
oldname newname [partition]
renm
oldname newname [partition]
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.
setaclmailbox
mailbox id rights [id rights ...]
setacl
mailbox id rights [id rights ...]
sam
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
(lrswipcd
), or all
(lrswipcda
), or any combinations of the ACL codes:
setinfo
attribute value
Set server metadata. A value of "none" will remove the attribute. The currently supported attributes are:
motd
comment
admin
shutdown
expire
squat
setquota
root resource value [resource value ...]
sq
root resource value [resource value ...]
STORAGE
. The 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.
version
ver
xfermailbox
[--partition
partition] mailbox server
xfer
[--partition
partition] mailbox server
xfermailbox
mailbox server [partition]
xfer
mailbox server [partition]
GNU-style long options must be given in their entirety; Tcl-style options may be abbreviated.
Tcl-style options are provided as a compatibility feature. They will probably go away in the future.
Multiple commands can be given on a line, separated by ';'
characters.
All commands set an exit status, which at present is not useful.
Unknown commands are passed to a subshell for execution.
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.
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.
If the Term::Readline::Perl
or Term::Readline::GNU
modules are
available, cyradm will use it.
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.
Brandon S. Allbery, allbery@ece.cmu.edu
Cyrus::IMAP::Admin Term::ReadLine sh(1), perl(1), imapd(8).