VirtualMailManager/Domain.py
changeset 58 1692da96ec17
parent 56 9ae1b1b2ee5c
child 76 14c0a092d7d2
equal deleted inserted replaced
57:38c42e09677a 58:1692da96ec17
   241         return accounts
   241         return accounts
   242 
   242 
   243     def getAliases(self):
   243     def getAliases(self):
   244         """Returns a list with all aliases from the domain."""
   244         """Returns a list with all aliases from the domain."""
   245         dbc = self._dbh.cursor()
   245         dbc = self._dbh.cursor()
   246         dbc.execute("SELECT address from alias where gid = %s ORDER BY address",
   246         dbc.execute("SELECT DISTINCT address FROM alias WHERE gid = %s\
   247                 self._id)
   247  ORDER BY address",  self._id)
   248         addresses = dbc.fetchall()
   248         addresses = dbc.fetchall()
   249         dbc.close()
   249         dbc.close()
   250         aliases = []
   250         aliases = []
   251         if len(addresses) > 0:
   251         if len(addresses) > 0:
   252             for alias in addresses:
   252             for alias in addresses: