.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "managesieve 3pm" .TH managesieve 3pm 2024-02-15 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Cyrus::SIEVE::managesieve \- Perl client for the SIEVE protocol .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use Cyrus::SIEVE::managesieve; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This is a Perl module which provides a client for the SIEVE protocol. It supports SASL authentication and communication encryption, using the Cyrus SASL infrastructure. .PP It provides the following functions. .IP "sieve_get_handle($servername, &username_cb, &authname_cb, &password_cb, &realm_cb)" 4 .IX Item "sieve_get_handle($servername, &username_cb, &authname_cb, &password_cb, &realm_cb)" Creates and returns a new Sieve object which can be used for communicating with the SIEVE server. The server is connected to and a login sequence is performed, using some combination of the given callbacks to fetch from the calling program any data needed for authentication. .Sp The \fIservername\fR may take any of the forms .RS 4 .IP \fIhostname\fR 4 .IX Item "hostname" .PD 0 .IP \fIhostname\fR:\fIport\fR 4 .IX Item "hostname:port" .IP \fIipv4address\fR 4 .IX Item "ipv4address" .IP \fIipv4address\fR:\fIport\fR 4 .IX Item "ipv4address:port" .IP [\fIipv6address\fR] 4 .IX Item "[ipv6address]" .IP [\fIipv6address\fR]:\fIport\fR 4 .IX Item "[ipv6address]:port" .RE .RS 4 .PD .Sp If not explicitly specified in the \fIservername\fR, the port defaults to the port named "sieve" in the client machine's service database (for example the \f(CW\*(C`/etc/services\*(C'\fR files), or 4190. .Sp All the callbacks are called with the following arguments .Sp \&\f(CW$string\fR = callback($which, \f(CW$prompt\fR); .Sp where \fIwhich\fR is one of the strings \f(CW"username"\fR, \f(CW"authname"\fR, \&\f(CW"getpass"\fR, or \f(CW"realm"\fR respectively, and \fIprompt\fR is a human-readable English language prompt string for the user's benefit. Each callback should return a string containing the required information. .Sp The function will return \fIundef\fR on error, use \&\fIsieve_get_global_error\fR to get a description of the error. .RE .IP sieve_get_error($sieveobj) 4 .IX Item "sieve_get_error($sieveobj)" Returns a human-readable English language string describing the last error encountered on the object \fR\f(CI$sieveobj\fR\fI\fR. .IP \fBsieve_get_global_error()\fR 4 .IX Item "sieve_get_global_error()" Returns a human-readable English language string describing the last error encountered while creating a Sieve object. .IP sieve_logout($sieveobj) 4 .IX Item "sieve_logout($sieveobj)" Log out from the SIEVE server. The \fR\f(CI$sieveobj\fR\fI\fR will become unusable. .ie n .IP "sieve_put_file($sieveobj, $filename)" 4 .el .IP "sieve_put_file($sieveobj, \f(CW$filename\fR)" 4 .IX Item "sieve_put_file($sieveobj, $filename)" Installs a SIEVE script contained in a local file named by \fR\f(CI$filename\fR\fI\fR to the server. The name of the script on the server will be the basename of \fI\fR\f(CI$filename\fR\fI\fR. Returns zero on success and non-zero on failure. .ie n .IP "sieve_put_file_withdest($sieveobj, $filename, $destname)" 4 .el .IP "sieve_put_file_withdest($sieveobj, \f(CW$filename\fR, \f(CW$destname\fR)" 4 .IX Item "sieve_put_file_withdest($sieveobj, $filename, $destname)" Like \fIsieve_put_file\fR but also specifies the name of the file on the server. Any directory part of \fR\f(CI$destname\fR\fI\fR is ignored. .ie n .IP "sieve_put($sieveobj obj, $name, $data)" 4 .el .IP "sieve_put($sieveobj obj, \f(CW$name\fR, \f(CW$data\fR)" 4 .IX Item "sieve_put($sieveobj obj, $name, $data)" Installs a SIEVE script contained in the scalar \f(CW$data\fR to the server, with the script name \fR\f(CI$name\fR\fI\fR. Returns zero on success and non-zero on failure. .ie n .IP "sieve_delete($sieveobj obj, $name)" 4 .el .IP "sieve_delete($sieveobj obj, \f(CW$name\fR)" 4 .IX Item "sieve_delete($sieveobj obj, $name)" Removes a SIEVE script from the server. Returns zero on success and non-zero on failure. .IP "sieve_list($sieveobj obj, &callback)" 4 .IX Item "sieve_list($sieveobj obj, &callback)" Lists existing SIEVE scripts on the server. The \fI&callback\fR returns no value and is called once for each script on the server, with arguments .Sp callback($name, \f(CW$is_active\fR) .Sp \&\fIsieve_list\fR returns zero on success and non-zero on failure. .ie n .IP "sieve_activate($sieveobj, $name)" 4 .el .IP "sieve_activate($sieveobj, \f(CW$name\fR)" 4 .IX Item "sieve_activate($sieveobj, $name)" Makes the script named \fR\f(CI$name\fR\fI\fR the active script on the server. Only one script is active at a time; activating a script de-activates any others. Returns zero on success and non-zero on failure. .ie n .IP "sieve_get($sieveobj, $name, $output)" 4 .el .IP "sieve_get($sieveobj, \f(CW$name\fR, \f(CW$output\fR)" 4 .IX Item "sieve_get($sieveobj, $name, $output)" Retrieves the SIEVE script named <$name> from the server, and stores it in the scalar \fR\f(CI$output\fR\fI\fR. Returns zero on success and non-zero on failure. .SH AUTHOR .IX Header "AUTHOR" T. Martin, tmartin@andrew.cmu.edu .SH "SEE ALSO" .IX Header "SEE ALSO" RFC5804, A Protocol for Remotely Managing Sieve Scripts.