427 def domain_add(self, domainname, transport=None): |
427 def domain_add(self, domainname, transport=None): |
428 """Wrapper around Domain's set_quotalimit, set_transport and save.""" |
428 """Wrapper around Domain's set_quotalimit, set_transport and save.""" |
429 dom = self._get_domain(domainname) |
429 dom = self._get_domain(domainname) |
430 if transport is None: |
430 if transport is None: |
431 dom.set_transport(Transport(self._dbh, |
431 dom.set_transport(Transport(self._dbh, |
432 transport=self._cfg.dget('misc.transport'))) |
432 transport=self._cfg.dget('domain.transport'))) |
433 else: |
433 else: |
434 dom.set_transport(Transport(self._dbh, transport=transport)) |
434 dom.set_transport(Transport(self._dbh, transport=transport)) |
435 dom.set_quotalimit(QuotaLimit(self._dbh, |
435 dom.set_quotalimit(QuotaLimit(self._dbh, |
436 bytes=long(self._cfg.dget('misc.quota_bytes')), |
436 bytes=long(self._cfg.dget('domain.quota_bytes')), |
437 messages=self._cfg.dget('misc.quota_messages'))) |
437 messages=self._cfg.dget('domain.quota_messages'))) |
438 dom.set_serviceset(ServiceSet(self._dbh, |
438 dom.set_serviceset(ServiceSet(self._dbh, |
439 imap=self._cfg.dget('account.imap'), |
439 imap=self._cfg.dget('domain.imap'), |
440 pop3=self._cfg.dget('account.pop3'), |
440 pop3=self._cfg.dget('domain.pop3'), |
441 sieve=self._cfg.dget('account.sieve'), |
441 sieve=self._cfg.dget('domain.sieve'), |
442 smtp=self._cfg.dget('account.smtp'))) |
442 smtp=self._cfg.dget('domain.smtp'))) |
443 dom.set_directory(self._cfg.dget('misc.base_directory')) |
443 dom.set_directory(self._cfg.dget('misc.base_directory')) |
444 dom.save() |
444 dom.save() |
445 self._make_domain_dir(dom) |
445 self._make_domain_dir(dom) |
446 |
446 |
447 def domain_quotalimit(self, domainname, bytes_, messages=0, force=None): |
447 def domain_quotalimit(self, domainname, bytes_, messages=0, force=None): |