# HG changeset patch # User Pascal Volk # Date 1204588087 0 # Node ID 44161dbb1518ca3a961e05dc419459cfffd87383 # Parent 7a5bd38c5b98269e1434f44563dd8e42710fb690 * 'VirtualMailManager/Alias.py' * 'VirtualMailManager/VirtualMailManager.py' * 'vmm' - added support for deleting only the alias with the matching destination address diff -r 7a5bd38c5b98 -r 44161dbb1518 ChangeLog --- a/ChangeLog Sun Mar 02 23:15:13 2008 +0000 +++ b/ChangeLog Mon Mar 03 23:48:07 2008 +0000 @@ -1,5 +1,12 @@ === 0.0.0 === -2008-03-03 Pascal Volk +2008-03-04 Pascal Volk + + * VirtualMailManager/Alias.py: + * VirtualMailManager/VirtualMailManager.py: + * vmm: Now it's possible to delete an alias with a specific destination + +2008-03-03 Pascal Volk + * pgsql-virtual_mailbox_domains.cf: Added to repository * INSTALL: fixed postfix docu diff -r 7a5bd38c5b98 -r 44161dbb1518 VirtualMailManager/Alias.py --- 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: diff -r 7a5bd38c5b98 -r 44161dbb1518 VirtualMailManager/VirtualMailManager.py --- a/VirtualMailManager/VirtualMailManager.py Sun Mar 02 23:15:13 2008 +0000 +++ b/VirtualMailManager/VirtualMailManager.py Mon Mar 03 23:48:07 2008 +0000 @@ -414,8 +414,8 @@ alias = self.__getAlias(aliasaddress) return alias.getInfo() - def alias_delete(self, aliasaddress): - alias = self.__getAlias(aliasaddress) + def alias_delete(self, aliasaddress, targetaddress=None): + alias = self.__getAlias(aliasaddress, targetaddress) alias.delete() def user_info(self, emailaddress, diskusage=False): diff -r 7a5bd38c5b98 -r 44161dbb1518 vmm --- a/vmm Sun Mar 02 23:15:13 2008 +0000 +++ b/vmm Mon Mar 03 23:48:07 2008 +0000 @@ -43,7 +43,7 @@ ud userdelete user@domain.tld aa aliasadd alias@domain.tld user@domain.tld ai aliasinfo alias@domain.tld - ad aliasdelete alias@domain.tld + ad aliasdelete alias@domain.tld user@domain.tld* cf configure section* h help v version @@ -234,8 +234,10 @@ global argc if argc < 3: usage(EXIT.MISSING_ARGS, 'Missing alias address') + elif argc < 4: + vmm.alias_delete(sys.argv[2].lower()) else: - vmm.alias_delete(sys.argv[2].lower()) + vmm.alias_delete(sys.argv[2].lower(), sys.argv[3].lower()) def showWarnings(): if vmm.hasWarnings():