VirtualMailManager/Alias.py
changeset 12 44161dbb1518
parent 9 e3d3dbeb5b84
child 32 ceb700bc4a80
--- a/VirtualMailManager/Alias.py	Sun Mar 02 23:15:13 2008 +0000
+++ b/VirtualMailManager/Alias.py	Mon Mar 03 23:48:07 2008 +0000
@@ -96,8 +96,12 @@
 
     def delete(self):
         dbc = self._dbh.cursor()
-        dbc.execute("DELETE FROM alias WHERE gid=%s AND address=%s",
-                self._gid, self._localpart)
+        if self._dest is None:
+            dbc.execute("DELETE FROM alias WHERE gid=%s AND address=%s",
+                    self._gid, self._localpart)
+        else:
+            dbc.execute("DELETE FROM alias WHERE gid=%s AND address=%s AND \
+ destination=%s", self._gid, self._localpart, self._dest)
         rowcount = dbc.rowcount
         dbc.close()
         if rowcount > 0: