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

_______________________________________________
This mailing list is hosted and supported
by bit-heads GmbH | http://www.bit-heads.ch

_______________________________________________
Web-cyradm mailing list
[email protected]
http://www.web-cyradm.org/mailman/listinfo/web-cyradm

Reply via email to