VirtualMailManager/alias.py
changeset 619 4ec5c015b7aa
parent 618 d8736bb80bdc
child 637 ca6621caff2f
child 675 d24f094d1cb5
equal deleted inserted replaced
618:d8736bb80bdc 619:4ec5c015b7aa
    40 
    40 
    41     def _load_dests(self):
    41     def _load_dests(self):
    42         """Loads all known destination addresses into the _dests list."""
    42         """Loads all known destination addresses into the _dests list."""
    43         dbc = self._dbh.cursor()
    43         dbc = self._dbh.cursor()
    44         dbc.execute('SELECT destination FROM alias WHERE gid = %s AND '
    44         dbc.execute('SELECT destination FROM alias WHERE gid = %s AND '
    45                     'address = %s', (self._gid, self._addr.localpart))
    45                     'address = %s ORDER BY destination',
       
    46                     (self._gid, self._addr.localpart))
    46         dests = dbc.fetchall()
    47         dests = dbc.fetchall()
    47         if dbc.rowcount > 0:
    48         if dbc.rowcount > 0:
    48             self._dests.extend(DestAddr(dest[0], self._dbh) for dest in dests)
    49             self._dests.extend(DestAddr(dest[0], self._dbh) for dest in dests)
    49         dbc.close()
    50         dbc.close()
    50 
    51