Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

cyrus::imap::imsp(3) [centos man page]

IMAP::IMSP(3)						User Contributed Perl Documentation					     IMAP::IMSP(3)

NAME
Cyrus::IMAP::IMSP - Perl module for Cyrus IMSP user options SYNOPSIS
use Cyrus::IMAP::IMSP; my $client = Cyrus::IMAP::IMSP->new('imsphost'[, $port[, $flags]]); $rc = $client->set('mailreader.window.size', '200x300'); %options = $client->get('mailreader.*') $rc = $client->unset('mailreader.window.size'); DESCRIPTION
This module is a Perl interface to the Cyrus IMSP functions that relate to user options (preferences). Only three IMSP operations are implemented: set, unset, and get. METHODS
new($server[, $port[, $flags]]) Instantiates a Cyrus::IMAP::IMSP object. This is in fact a 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 "authenticate" method.) error Return the last error that occurred, or undef if the last operation was successful. This is in some cases (such as "get") the only way to distinguish between a successful return of an empty list and an error return. Calling "error" does not reset the error state, so it is legal to write: %options = $client->get($option); print STDERR "Error: ", $client->error if $client->error; set($option, $value) Sets the option named by $option to the value in $value. There are no restrictions or quoting rules needed to protect special characters in the value argument. (The Cyrus::IMAP layer will take care those details by adding double quotes or a literal introducer.) If successful, returns 1. Otherwise, returns undef and makes an error message available through the "error" function. unset($option) Removes the option named by $option. The option is completely removed from the user's name space but will revert to a site-wide default if one has been set. Note that this is different from assigning an option the null value with set($option, ''). If you try to unset an option that does not exist, an error is returned saying that the option was already unset. If successful, returns 1. Otherwise, returns undef and makes an error message available through the "error" function. get($option_pattern) Get takes either an option name or a pattern of names to fetch. The pattern can contain either "*" or "%" wildcards anywhere in the string. The usual IMAP wildcard semantics apply. The return value is a hash of options with each key being an option name and each value being the option's value string. If an empty hash is returned, it's either because there were no matching options or because some error happened. Check the "error" function to see which was the case. The IMSP protocol also returns an access flag of "[READ-WRITE]" or "[READ-ONLY]" but that information is discarded by this function. A more complicated function that returns both the value and the access flag could be added later if needed. AUTHOR
Brandon S. Allbery, allbery@ece.cmu.edu IMSP modifications by Joseph Jackson, jackson@CMU.EDU SEE ALSO
Cyrus::IMAP perl(1), cyradm(1), imapd(8). perl v5.16.3 2012-12-01 IMAP::IMSP(3)

Check Out this Related Man Page

IMAP(3) 						User Contributed Perl Documentation						   IMAP(3)

NAME
Cyrus::IMAP - Interface to Cyrus imclient library SYNOPSIS
use Cyrus::IMAP; my $client = Cyrus::IMAP->new('mailhost'[, $flags]); $flags = Cyrus::IMAP::CONN_NONSYNCLITERAL; ($server, $mailbox) = Cyrus::IMAP->fromURL($url); $url = Cyrus::IMAP->toURL($server, $mailbox); $client->setflags($flags); $client->clearflags(Cyrus::IMAP::CONN_INITIALRESPONSE); $flags = $client->flags; $server = $client->servername; $client->authenticate; $flags = Cyrus::IMAP::CALLBACK_NUMBERED || Cyrus::IMAP::CALLBACK_NOLITERAL; $client->addcallback({-trigger => $str, -flags => $flags, -callback => &cb, -rock => $var}, ...); $client->send(&callback, &cbdata, $format, ...); $client->processoneevent; ($result, $text) = $client->send(undef, undef, $format, ...); ($fd, $writepending) = $client->getselectinfo; DESCRIPTION
The Cyrus::IMAP module provides an interface to the Cyrus imclient library. These are primarily useful for implementing cyradm operations within a Perl script; there are easier ways to implement general client operations, although they may be more limited in terms of authentication options when talking to a Cyrus imapd. In the normal case, one will attach to a Cyrus server and authenticate using the best available method: my $client = Cyrus::IMAP::new('imap'); $client->authenticate; if (!$client->send('', '', 'CREATE %s', 'user.' . $username)) { warn "createmailbox user.$username: $@"; } In simple mode as used above, "send()" is invoked with "undef", 0, or '' for the callback and rock (callback data) arguments; it returns a list of "($result, $text)" from the command. If invoked in scalar context, it returns $result and places $text in $@. In this mode, there is no need to use "processoneevent()". If more control is desired, use the callback and rock arguments and invoke "processoneevent()" regularly to receive results from the IMAP server. If still more control is needed, the "getselectinfo()" method returns a list containing a file descriptor (not Perl filehandle) which can be passed to select(); if the second element of the list is true, you should include it in the write mask as well as the read mask because the imclient library needs to perform queued output. For more information, consult the Cyrus documentation. NOTES
"send()" behaves as if the "Cyrus::IMAP::CONN_NONSYNCLITERAL" flag is always set. This is because it is a wrapper for the C version, which cannot be made directly available from Perl, and synchronous literals require interaction with the IMAP server while parsing the format string. This is planned to be fixed in the future. The 'LOGIN' mechanism can be used to authenticate with a plaintext username and password. This is intended as a workaround for a bug in early SASL implementations; use of Cyrus::IMAP with non-Cyrus servers is not recommended, primarily because there are easier ways to implement IMAP client functionality in Perl. (However, if you need SASL support, "Cyrus::IMAP" is currently the only way to get it.) The file descriptor returned by "getselectinfo()" should not be used for anything other than "select()". In particular, I/O on the file descriptor will almost certainly cause more problems than whatever problem you think you are trying to solve. The toURL and fromURL routines are to ease conversion between URLs and IMAP mailbox and server combinations, and are a simple frontend for the libcyrus functions of the same name. The imparse library routines are not implemented, because they are little more than a (failed) attempt to make parsing as simple in C as it is in Perl. This module exists primarily so we can integrate Cyrus administration into our Perl-based account management system, and secondarily so that we can rewrite cyradm in a sensible language instead of Tcl. Usability for other purposes is not guaranteed. AUTHORs Brandon S. Allbery <allbery@ece.cmu.edu>, Rob Siemborski <rjs3+@andrew.cmu.edu> SEE ALSO
Cyrus::IMAP::Admin perl(1), cyradm(1), imclient(3), imapd(8). perl v5.16.3 2012-12-01 IMAP(3)
Man Page