VirtualMailManager/Account.py
changeset 90 1734eb5101c6
parent 82 6c85915f3815
child 102 485d3f7d6981
--- a/VirtualMailManager/Account.py	Thu Sep 18 18:40:54 2008 +0000
+++ b/VirtualMailManager/Account.py	Sun Oct 05 03:33:38 2008 +0000
@@ -197,6 +197,19 @@
                     tid=info['transport']).getTransport()
             return info
 
+    def getAliases(self):
+        dbc = self._dbh.cursor()
+        dbc.execute("SELECT address ||'@'|| domainname FROM alias, domain_name\
+ WHERE destination = %s AND domain_name.gid = alias.gid\
+ AND domain_name.is_primary", str(self._addr))
+        addresses = dbc.fetchall()
+        dbc.close()
+        aliases = []
+        if len(addresses) > 0:
+            for alias in addresses:
+                aliases.append(alias[0])
+        return aliases
+
     def delete(self, delalias):
         if self._uid < 1:
             raise AccE(_(u"The account »%s« doesn't exists.") % self._addr,