<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-15">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2658.2">
<TITLE>setquota in Python</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Hi,</FONT>
</P>
<P><FONT SIZE=2>for my migration purposes (2.2.12 -> 2.3.16) I'm experimenting with </FONT>
<BR><FONT SIZE=2>python (2.4.2) to transfer the quota information from the old to the new </FONT>
<BR><FONT SIZE=2>server.</FONT>
</P>
<P><FONT SIZE=2>When I try to set the quota (on the old testserver, 2.2.12), I get the </FONT>
<BR><FONT SIZE=2>following error:</FONT>
</P>
<P><FONT SIZE=2> >>> from imaplib import *</FONT>
<BR><FONT SIZE=2> >>> quellserver = "bar"</FONT>
<BR><FONT SIZE=2> >>> s_server = IMAP4(quellserver)</FONT>
<BR><FONT SIZE=2> >>> s_server.login("cyrus","pw")</FONT>
<BR><FONT SIZE=2>('OK', ['User logged in'])</FONT>
<BR><FONT SIZE=2> >>> r = s_server.getquota("user.foo")</FONT>
<BR><FONT SIZE=2>('OK', ['user.foo (STORAGE 0 20000)'])</FONT>
<BR><FONT SIZE=2> >>> r = s_server.setquota("user.foo",5000)</FONT>
<BR><FONT SIZE=2>Traceback (most recent call last):</FONT>
<BR><FONT SIZE=2> File "<stdin>", line 1, in ?</FONT>
<BR><FONT SIZE=2> File "/usr/lib64/python2.4/imaplib.py", line 651, in setquota</FONT>
<BR><FONT SIZE=2> typ, dat = self._simple_command('SETQUOTA', root, limits)</FONT>
<BR><FONT SIZE=2> File "/usr/lib64/python2.4/imaplib.py", line 1028, in _simple_command</FONT>
<BR><FONT SIZE=2> return self._command_complete(name, self._command(name, *args))</FONT>
<BR><FONT SIZE=2> File "/usr/lib64/python2.4/imaplib.py", line 865, in _command_complete</FONT>
<BR><FONT SIZE=2> raise self.error('%s command error: %s %s' % (name, typ, data))</FONT>
<BR><FONT SIZE=2>imaplib.error: SETQUOTA command error: BAD ['Invalid quota list in </FONT>
<BR><FONT SIZE=2>Setquota']</FONT>
</P>
<P><FONT SIZE=2>What am I doing wrong?</FONT>
</P>
<BR>
<P><FONT SIZE=2>Marc</FONT>
</P>
</BODY>
</HTML>