setquota in Python

Marc Patermann hans.moser at
Wed Jul 14 06:57:54 EDT 2010


for my migration purposes (2.2.12 -> 2.3.16) I'm experimenting with 
python (2.4.2) to transfer the quota information from the old to the new 

When I try to set the quota (on the old testserver, 2.2.12), I get the 
following error:

 >>> from imaplib import *
 >>> quellserver = "bar"
 >>> s_server = IMAP4(quellserver)
 >>> s_server.login("cyrus","pw")
('OK', ['User logged in'])
 >>> r = s_server.getquota("")
('OK', [' (STORAGE 0 20000)'])
 >>> r = s_server.setquota("",5000)
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/usr/lib64/python2.4/", line 651, in setquota
     typ, dat = self._simple_command('SETQUOTA', root, limits)
   File "/usr/lib64/python2.4/", line 1028, in _simple_command
     return self._command_complete(name, self._command(name, *args))
   File "/usr/lib64/python2.4/", line 865, in _command_complete
     raise self.error('%s command error: %s %s' % (name, typ, data))
imaplib.error: SETQUOTA command error: BAD ['Invalid quota list in 

What am I doing wrong?

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Info-cyrus mailing list