Odd problem

Geoff Pryke geoff at gold.ac.uk
Mon Nov 6 10:39:23 EST 2006


I have what's probably a very silly problem with a new Cyrus installation.

I am in the process of setting up a new server to take over the duties of 
an older machine doing same.  I have perl scripts which allow me to 
create/delete and move mailboxes, and I am having problems getting these to 
work on the new system.

e.g. to delete mailboxes, we use a scripts called deletemailboxes.pl. It's 
called via :

echo "user.fred" | ./deletemailboxes.pl

The error I get is :
Can't call method "authenticate" on an undefined value at 
./deletemailboxes.pl line 7.


The extract from the delete mailboxes script is thus:

#!/usr/local/bin/perl
require("/usr/cyrus/scripts/cred.pl");
use Cyrus::IMAP::Admin;


my $con = Cyrus::IMAP::Admin->new($server,$port);
$con->authenticate(-user => $imapuser, -password => $imappass, -mechanism =>
'login', -service => 'imap')
        || die "Cannot authenticate to server as $\n$!";

while(<>) {
        chomp;
        print("Deleting $_\n");
        if (!$con->setacl($_,$imapuser => "all")) {
                print("$_:".$con->error()."\n");
        } elsif (!$con->delete($_)) {
                print("$_:".$con->error()."\n");
        }
}

cred.pl contains :

#!/usr/local/bin/perl
$server="localhost";
$port="1143";
$imapuser="<cyrususer>";
$imappass="<password>";

I can happily run cyradm with the credentials used for cyrus user and 
password.

The old OS is Solaris 8, the new one is Solaris 10.
Cyrus version is 2.2.12

Anyone have any idea what's occurring.

Thanks and regards,

Geoff


More information about the Info-cyrus mailing list