Hi List, I've been working recently on adding multisession support into OpenChange. You'll find below a quick status update on this task.
+----------------------------------------------------------------------+
[0x0] Contents
==============
[0x1] Context
[0x2] Objectives
[0x3] Impact
[0x4] Implementation
[0x5] Resources
+-----------------------------------------------------------------------+
[0x1] Context:
==============
So far applications were limited to a single session stored in
the global mapi context. This was preventing users from
accessing different mailboxes - using other credentials - within
the same session.
[0x2] Objectives:
=================
multisession goes beyond this context and allows applications to
create as many sessions as required, open different mailboxes
with different credentials on same/different Exchange servers
and access private mailbox and public folders at the same time.
[0x3] Impact:
=============
This code naturally impacts on OpenChange existing API and
semantics. Initially we had a single session within a global
context which libmapi/*.c functions were blindly referring to.
We still have a global context, but we now have a double chained
list of MAPI session, each of them having the ability to log
onto one emsmdb pipe and one nspi pipe.
With this design, we can't refer anymore to the
global_mapi_ctx->session and we needed new mechanisms able to
find and use the correct MAPI session for a given operation.
[0x4] Implementation:
=====================
This is where the change occurs. While session are kept within
the global mapi context, objects now holds a pointer on the
session and are responsible from passing it across MAPI calls -
which they inherit from their parent objects (container).
Everything is done seamlessly except for a couple of functions:
* IMAPISession.c functions (OpenMsgStore, OpenPublicFolder):
These are the initial MAPI calls application uses. These
function now take a struct mapi_session * parameter returned
from MapiLogonEx/MapiLogonProvider.
* IMAPISupport.c functions (Unsubscribe,MonitorNotifications):
These calls require the MAPI session context so they can store
their information (callback, id etc.) within the correct
context.
* IABContainer.c functions (ResolveNames, GetGALTable) which
require a pointer to a MAPI session so they can use the correct
NSPI context.
In the meantime, except for OpenMsgStore/OpenPublicFolder which
are generally called directly after MapiLogonEx, other functions
can retrieve the pointer to a MAPI session from any valid object
using the mapi_object_get_session() method.
I've added a very preliminary piece of code in the multisession
branch so you can see how multisession works. This tool is named
multisession and can be found under utils/multisession.c. This
tool basically takes 2 profiles (a default profile and a
specified one) and list the mailbox hierarchy for the default
profile and the public folders hierarchy for the specified one.
This should give you an output similar to what you'll find
below. Note that in the following example 'default' and 'office'
profiles connect to different Exchange servers:
-------------------------------------
./bin/multisession --profile2=office
+ Mailbox - Julien K. Kerihuel
|---+ Calendar : Calendar Comment (Total: 0 / Unread: 0 - Container
class: IPF.Appointment) [FID: 0xaa13000000000001]
|---+ Contacts : Contacts Comment (Total: 4 / Unread: 0 - Container
class: IPF.Contact) [FID: 0xab13000000000001]
|---+ Deleted Items : (Total: 0 / Unread: 0 - Container
class: IPF.Note) [FID: 0x9814000000000001]
|---+ Drafts : Drafts Folder (Total: 0 / Unread: 0 - Container
class: IPF.Note) [FID: 0xac13000000000001]
|---+ Inbox : (Total: 16 / Unread: 16 -
Container class: IPF.Note) [FID: 0x9514000000000001]
|---+ Journal : Journal Comment (Total: 0 / Unread: 0 - Container
class: IPF.Journal) [FID: 0xad13000000000001]
|---+ Junk E-mail : Junk Email Comment (Total: 0 / Unread: 0 - Container
class: IPF.Note) [FID: 0x200080000000003]
|---+ Notes : Notes Comment (Total: 0 / Unread: 0 - Container
class: IPF.StickyNote) [FID: 0xae13000000000001]
|---+ Outbox : (Total: 10 / Unread: 0 - Container
class: IPF.Note) [FID: 0x9614000000000001]
|---+ Sent Items : (Total: 0 / Unread: 0 - Container
class: IPF.Note) [FID: 0x9714000000000001]
|---+ Sync Issues : (Total: 0 / Unread: 0 - Container
class: IPF.Note) [FID: 0xb013000000000001]
| |---+ Conflicts : (Total: 0 / Unread: 0 -
Container class: IPF.Note) [FID: 0xb113000000000001]
| |---+ Local Failures : (Total: 0 / Unread: 0 -
Container class: IPF.Note) [FID: 0xb213000000000001]
| |---+ Server Failures : (Total: 0 / Unread: 0 -
Container class: IPF.Note) [FID: 0xb313000000000001]
|---+ Tasks : Tasks Comment (Total: 0 / Unread: 0 - Container
class: IPF.Task) [FID: 0xaf13000000000001]
---------------------------------------------
|---+ IPM_SUBTREE [FID: 0x100000000000001]
| |---+ Internet Newsgroups [FID: 0x300ffffffff0002]
|---+ NON_IPM_SUBTREE [FID: 0x200000000000001]
| |---+ EFORMS REGISTRY [FID: 0x300000000000001]
| |---+ Events Root [FID: 0x400ffffffff0002]
| |---+ OFFLINE ADDRESS BOOK [FID: 0x500000000000001]
| | |---+ /o=First Organization/cn=addrlists/cn=oabs/cn=Default Offline
Address List [FID: 0x800000000000004]
| | | |---+ OAB Version 2 [FID: 0xf12e000000000001]
| | | |---+ OAB Version 3a [FID: 0xf22e000000000001]
| | |---+ EX:/o=First Organization/ou=First Administrative Group [FID:
0x800000000000003]
| |---+ OWAScratchPad{E95EE010-3E8A-425B-806F-15ED60887F6B} [FID:
0x1900000000000001]
| |---+ SCHEDULE+ FREE BUSY [FID: 0x400000000000001]
| | |---+ EX:/o=First Organization/ou=First Administrative Group [FID:
0x700000000000003]
| |---+ schema-root [FID: 0x1500000000000001]
| | |---+ Default [FID: 0x1600000000000001]
| | |---+ microsoft [FID: 0x1700000000000001]
| | | |---+ exchangeV1 [FID: 0x1800000000000001]
| |---+ StoreEvents{E95EE010-3E8A-425B-806F-15ED60887F6B} [FID:
0x1100000000000001]
| | |---+ globalevents [FID: 0x1300000000000001]
| | |---+ internal [FID: 0x1200000000000001]
-------------------------------------
[0x5] Resources:
================
The multisession code is available at the SVN address below:
svn co
https://svn.openchange.org/openchange/branches/multisession
Cheers,
Julien.
--
Julien Kerihuel
[EMAIL PROTECTED]
OpenChange Project Manager
GPG Fingerprint: 0B55 783D A781 6329 108A B609 7EF6 FE11 A35F 1F79
signature.asc
Description: This is a digitally signed message part
_______________________________________________ devel mailing list [email protected] http://mailman.openchange.org/listinfo/devel
