VirtualMailManager/alias.py
branchv0.6.x
changeset 379 7518d927d443
parent 370 1b1f8f0cc687
child 417 8209da83e256
equal deleted inserted replaced
378:af56cee51e67 379:7518d927d443
   123                 warnings.extend(duplicates)
   123                 warnings.extend(duplicates)
   124         if not destinations:
   124         if not destinations:
   125             return destinations
   125             return destinations
   126         self._check_expansion(len(destinations))
   126         self._check_expansion(len(destinations))
   127         dbc = self._dbh.cursor()
   127         dbc = self._dbh.cursor()
   128         dbc.executemany("INSERT INTO alias VALUES (%d, '%s', %%s)" %
   128         dbc.executemany("INSERT INTO alias (gid, address, destination) "
   129                         (self._gid, self._addr.localpart),
   129                         "VALUES (%d, '%s', %%s)" % (self._gid,
       
   130                                                     self._addr.localpart),
   130                         ((str(destination),) for destination in destinations))
   131                         ((str(destination),) for destination in destinations))
   131         self._dbh.commit()
   132         self._dbh.commit()
   132         dbc.close()
   133         dbc.close()
   133         self._dests.extend(destinations)
   134         self._dests.extend(destinations)
   134         return destinations
   135         return destinations