VirtualMailManager/account.py
branchv0.6.x
changeset 404 0c52094447b0
parent 390 660b42391c8e
child 417 8209da83e256
equal deleted inserted replaced
403:a4f5d4cd886d 404:0c52094447b0
    14 from VirtualMailManager.transport import Transport
    14 from VirtualMailManager.transport import Transport
    15 from VirtualMailManager.common import version_str
    15 from VirtualMailManager.common import version_str
    16 from VirtualMailManager.constants import \
    16 from VirtualMailManager.constants import \
    17      ACCOUNT_EXISTS, ACCOUNT_MISSING_PASSWORD, ALIAS_PRESENT, \
    17      ACCOUNT_EXISTS, ACCOUNT_MISSING_PASSWORD, ALIAS_PRESENT, \
    18      INVALID_ARGUMENT, INVALID_MAIL_LOCATION, NO_SUCH_ACCOUNT, \
    18      INVALID_ARGUMENT, INVALID_MAIL_LOCATION, NO_SUCH_ACCOUNT, \
    19      NO_SUCH_DOMAIN, UNKNOWN_SERVICE
    19      NO_SUCH_DOMAIN, UNKNOWN_SERVICE, VMM_ERROR
    20 from VirtualMailManager.errors import AccountError as AErr
    20 from VirtualMailManager.errors import VMMError, AccountError as AErr
    21 from VirtualMailManager.maillocation import MailLocation
    21 from VirtualMailManager.maillocation import MailLocation
    22 from VirtualMailManager.password import pwhash
    22 from VirtualMailManager.password import pwhash
    23 
    23 
    24 __all__ = ('SERVICES', 'Account', 'get_account_by_uid')
    24 __all__ = ('SERVICES', 'Account', 'get_account_by_uid')
    25 
    25 
   317         Arguments:
   317         Arguments:
   318 
   318 
   319         `quotalimit` : VirtualMailManager.quotalimit.QuotaLimit
   319         `quotalimit` : VirtualMailManager.quotalimit.QuotaLimit
   320           the new quota limit of the domain.
   320           the new quota limit of the domain.
   321         """
   321         """
       
   322         if cfg_dget('misc.dovecot_version') < 0x10102f00:
       
   323             raise VMMError(_(u'PostgreSQL-based dictionary quota requires '
       
   324                              u'Dovecot >= v1.1.2'), VMM_ERROR)
   322         self._chk_state()
   325         self._chk_state()
   323         assert isinstance(quotalimit, QuotaLimit)
   326         assert isinstance(quotalimit, QuotaLimit)
   324         if quotalimit == self._qlimit:
   327         if quotalimit == self._qlimit:
   325             return
   328             return
   326         self._update_tables('qid', quotalimit.qid)
   329         self._update_tables('qid', quotalimit.qid)