connect([$user])
error()
activate([$filename])
delete($filename)
get()
list()
getActive()
Cyrus::SIEVE::Manage - Interface to the Cyrus sieve functions
use Cyrus::SIEVE::Manage;
$Sieve = new Cyrus::SIEVE::Manage('cyrus','secret'); $Sieve->connect('martin');
my $err = $Sieve->put('/home/martin/scripts/spamfilter.sieve','spamfilter'); if ($err) { print "An error occured: ",$Sieve->error,"\n"; exit 1; } $Sieve->activate('spamfilter');
The Cyrus Sieve implementation ships with the Perl module Cyrus::SIEVE::managesieve to handle sieve scripts for the Cyrus IMAP server. The interface of the Cyrus::SIEVE::managesieve module is a little bit strange and poor documented.
This Cyrus::SIEVE::Manage module provides an object oriented interface to the functions of Cyrus::SIEVE::managesieve
Constructor for an Cyrus::SIEVE::Manage object. The parameters are:
* authname - Username of the user to connect to the server.
* password - Password of the user to connect.
* hostname - Hostname of the cyrus sieve server to connect. Optional, default is localhost.
connect([$user])
Connect to the sieve server as user $authname given at the constructor. If the optional parameter $user is given, the mailbox of $user will be connected if $authname is authorized to edit the mailbox of $user.
Returns the current object if successul or a false value if failed.
error()
Returns the last errorstring and clears the ERROR attribute.
Loads the file $filename to the server. If $upstreamname is given, the file will be stored as $upstreamname.
Returns the current object if successful, otherwise a false value.
activate([$filename])
Activates the upstream sieve script $filename. If no filename is given, the current script will be deactivated.
Returns the current object if successful, otherwise a false value.
delete($filename)
Deletes the upstream sieve script $filename. Returns the current object if successful, otherwise a false value.
get()
Fetches the upstream sieve script $filename. Returns the script as a scalar if successful, otherwise a false value.
list()
Fetches a list of upstream sieve scripts Returns an array with the list if successful, otherwise a false value.
getActive()
Returns the name of the currently activated script.
Bugs? Features!
perl(1), Cyrus::SIEVE::managesieve
Copyright (c) 2005 Martin Werthmoeller <mw@werthmoeller.de>
The code of this module is derivated from the sieveshell program of cyrus.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Fre e Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILIT Y or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 5 9 Temple Place, Suite 330, Boston, MA 02111-1307 USA