5
# For this test, we are running the whole environment on a different
6
# server: imap, ldap, postgresql, postfix, openchange, samba and sogo.
7
# We have configured SOGo backend locally and adjusted defaults to
8
# connect to this remote server.
10
# Finally we are accessing the openchange.ldb file through sshfs and
11
# map it at the top of the checkout within private folder:
12
# sshfs openchange@ip_addr:/usr/local/samba/private private
13
# We have also adjusted the permissions to allow openchange user to
14
# read/write openchange.ldb file remotely.
16
# Do not forget to run memcached with the user account running the
24
sys.path.append("python")
26
import openchange.mapistore as mapistore
28
dirname = "/usr/local/samba/private/mapistore"
29
if not os.path.exists(dirname):
30
os.mkdir("/usr/local/samba/private/mapistore")
32
mapistore.set_mapping_path(dirname)
33
MAPIStore = mapistore.mapistore(syspath="/usr/local/samba/private")
34
MAPICtx = MAPIStore.add_context("sogo://Administrator:Administrator@inbox/", "Administrator")
35
Inbox = MAPICtx.open()
36
identifier = MAPICtx.add_subscription("sogo://Administrator:Administrator@inbox/", False, 0x2)
39
MAPICtx.get_notifications()
42
MAPICtx.delete_subscription("sogo://Administrator:Administrator@inbox/", False, 0x2, identifier)
44
#Calendar = MAPIStore.add_context("sogo://Administator:Administrator@inbox/", "Administrator").open()
46
#print Calendar.folder_count
48
#MAPICtx = MAPIStore.add_context("sogo://Administrator:Administrator@inbox/", "GoodAdmin")
49
Inbox.create_folder(name="Test")
51
NewCalender = MAPICtx.open()
53
print "[I] We have %d sub folders, %d messages and %d fai messages within %s" % (Inbox.folder_count,
55
Inbox.fai_message_count,
57
MAPIStore.delete_context(MAPICtx)