[Web-cyradm] updated quota is not seen on the web-cyradm interface

Leon Kolchinsky leonk at construct.haifa.ac.il
Tue Dec 11 12:06:59 CET 2007


Hello All,


I've used the following simple perl script to change users quota from 100MB
to 1GB:
-----------------------------------------
#!/usr/bin/perl -w

use Cyrus::IMAP::Admin;

#
# CONFIGURATION PARAMS
#
my $cyrus_server = "localhost";
my $cyrus_user = "admin";
my $cyrus_pass = "secret";

# 1 GB
my $quota_size = "1048576";

my $mechanism = "login";

#
# EOC
#

if (!$ARGV[0]) {
	die "Usage: $0 [user to add] \n";
} else {
	$newuser = "$ARGV[0]"
}

sub setQuota {

	my ($user) = @_;

	my $cyrus = Cyrus::IMAP::Admin->new($cyrus_server);
	
$cyrus->authenticate($mechanism,'imap','',$cyrus_user,'0','100000',$cyrus_pa
ss);	
	$mailbox = "user/". $user;
	$cyrus->setquota($mailbox,"STORAGE",$quota_size);
	if ($cyrus->error) {
		print STDERR "Error: ", $mailbox," ", $cyrus->error, "\n";
	} else {
		print "Setting Quota: $mailbox at $quota_size \n";
	}

}

print "Setting quota for user: ", $newuser, "\n";

setQuota($newuser);
-------------------------------------

My usernames are of form "leon" and not "leon.domain.com".

I successfully run this script on the mailboxes and check it:

# su - cyrus -c "/usr/lib/cyrus/quota -f user/username"
   Quota  % Used    Used Root
 1048576       0    8612 user/username


But on the web-cyradm interface I still see the old quota - 100MB:

"Quota used:
8 KBytes out of 1024 KBytes (0.82%)"


How could I solve this problem?


Best Regards,
Leon Kolchinsky



More information about the Web-cyradm mailing list