VirtualMailManager/Account.py
changeset 90 1734eb5101c6
parent 82 6c85915f3815
child 102 485d3f7d6981
equal deleted inserted replaced
89:752d3b57ebb6 90:1734eb5101c6
   194                     MailLocation(self._dbh,
   194                     MailLocation(self._dbh,
   195                         mid=info['maildir']).getMailLocation())
   195                         mid=info['maildir']).getMailLocation())
   196             info['transport'] = Transport(self._dbh,
   196             info['transport'] = Transport(self._dbh,
   197                     tid=info['transport']).getTransport()
   197                     tid=info['transport']).getTransport()
   198             return info
   198             return info
       
   199 
       
   200     def getAliases(self):
       
   201         dbc = self._dbh.cursor()
       
   202         dbc.execute("SELECT address ||'@'|| domainname FROM alias, domain_name\
       
   203  WHERE destination = %s AND domain_name.gid = alias.gid\
       
   204  AND domain_name.is_primary", str(self._addr))
       
   205         addresses = dbc.fetchall()
       
   206         dbc.close()
       
   207         aliases = []
       
   208         if len(addresses) > 0:
       
   209             for alias in addresses:
       
   210                 aliases.append(alias[0])
       
   211         return aliases
   199 
   212 
   200     def delete(self, delalias):
   213     def delete(self, delalias):
   201         if self._uid < 1:
   214         if self._uid < 1:
   202             raise AccE(_(u"The account »%s« doesn't exists.") % self._addr,
   215             raise AccE(_(u"The account »%s« doesn't exists.") % self._addr,
   203                     ERR.NO_SUCH_ACCOUNT)
   216                     ERR.NO_SUCH_ACCOUNT)