mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
Better behaviour if the QUOTA feature is not supported by the server.
fixed #137
This commit is contained in:
@@ -345,6 +345,10 @@ class IMAPconnector(object):
|
||||
return True
|
||||
|
||||
def getquota(self, folder):
|
||||
if not "QUOTA" in self.m.capabilities:
|
||||
self.quota_limit = self.quota_actual = None
|
||||
return
|
||||
|
||||
status, data = self.m.getquotaroot(self._encodefolder(folder))
|
||||
if status == "OK":
|
||||
quotadef = data[1][0]
|
||||
@@ -442,7 +446,7 @@ class ImapListing(EmailListing):
|
||||
try:
|
||||
return int(float(mbc.quota_actual) \
|
||||
/ float(mbc.quota_limit) * 100)
|
||||
except AttributeError:
|
||||
except (AttributeError, TypeError):
|
||||
return -1
|
||||
|
||||
def getquota(self):
|
||||
|
||||
Reference in New Issue
Block a user