Page MenuHomePhorge

No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
diff --git a/tests/functional/purge_users.py b/tests/functional/purge_users.py
new file mode 100644
index 0000000..1b18cb0
--- /dev/null
+++ b/tests/functional/purge_users.py
@@ -0,0 +1,37 @@
+import pykolab
+
+from pykolab import wap_client
+from pykolab.auth import Auth
+from pykolab.imap import IMAP
+
+conf = pykolab.getConf()
+
+def purge_users():
+ wap_client.authenticate(conf.get("ldap", "bind_dn"), conf.get("ldap", "bind_pw"))
+
+ users = wap_client.users_list()
+ for user in users['list']:
+ wap_client.user_delete({'user': user})
+
+ auth = Auth()
+ domains = auth.list_domains()
+
+ imap = IMAP()
+ imap.connect()
+
+ folders = []
+
+ for domain,aliases in domains:
+ folders.extend(imap.lm("user/%%@%s" % (domain)))
+
+ for folder in folders:
+ user = folder.replace('user/','')
+
+ recipient = auth.find_recipient(user)
+
+ if len(recipient) == 0 or recipient == []:
+ try:
+ imap.dm(folder)
+ except:
+ pass
+
diff --git a/tests/functional/synchronize.py b/tests/functional/synchronize.py
new file mode 100644
index 0000000..7046db2
--- /dev/null
+++ b/tests/functional/synchronize.py
@@ -0,0 +1,6 @@
+from pykolab.auth import Auth
+
+def synchronize_once():
+ auth = Auth()
+ auth.connect()
+ auth.synchronize(mode='_paged_search')

File Metadata

Mime Type
text/x-diff
Expires
Sun, Apr 5, 11:48 PM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18831624
Default Alt Text
(1 KB)

Event Timeline