VirtualMailManager/Account.py
branchv0.6.x
changeset 302 32b4a39b5640
parent 293 a77b67673aa6
child 306 504fd29b4712
equal deleted inserted replaced
301:e1d3f027dd64 302:32b4a39b5640
     2 # Copyright (c) 2007 - 2010, Pascal Volk
     2 # Copyright (c) 2007 - 2010, Pascal Volk
     3 # See COPYING for distribution information.
     3 # See COPYING for distribution information.
     4 
     4 
     5 """
     5 """
     6     VirtualMailManager.Account
     6     VirtualMailManager.Account
       
     7     ~~~~~~~~~~~~~~~~~~~~~~~~~~
     7 
     8 
     8     Virtual Mail Manager's Account class to manage e-mail accounts.
     9     Virtual Mail Manager's Account class to manage e-mail accounts.
     9 """
    10 """
    10 
    11 
    11 from VirtualMailManager.Domain import Domain
    12 from VirtualMailManager.Domain import Domain
   245                        ACCOUNT_MISSING_PASSWORD)
   246                        ACCOUNT_MISSING_PASSWORD)
   246         if cfg_dget('misc.dovecot_version') >= 0x10200b02:
   247         if cfg_dget('misc.dovecot_version') >= 0x10200b02:
   247             sieve_col = 'sieve'
   248             sieve_col = 'sieve'
   248         else:
   249         else:
   249             sieve_col = 'managesieve'
   250             sieve_col = 'managesieve'
   250         self._prepare(MailLocation(format=cfg_dget('mailbox.format')))
   251         self._prepare(MailLocation(directory=cfg_dget('mailbox.root'),
       
   252                                    mbfmt=cfg_dget('mailbox.format')))
   251         sql = "INSERT INTO users (local_part, passwd, uid, gid, mid, tid,\
   253         sql = "INSERT INTO users (local_part, passwd, uid, gid, mid, tid,\
   252  smtp, pop3, imap, %s) VALUES ('%s', '%s', %d, %d, %d, %d, %s, %s, %s, %s)" % (
   254  smtp, pop3, imap, %s) VALUES ('%s', '%s', %d, %d, %d, %d, %s, %s, %s, %s)" % (
   253             sieve_col, self._addr.localpart, pwhash(self._passwd,
   255             sieve_col, self._addr.localpart, pwhash(self._passwd,
   254                                                     user=self._addr),
   256                                                     user=self._addr),
   255             self._uid, self._domain.gid, self._mail.mid, self._transport.tid,
   257             self._uid, self._domain.gid, self._mail.mid, self._transport.tid,