Hi All, 

I've updated openchangeclient behavior so it now supports custom folder
lookup, creation and deletion.

$ openchangeclient --mkdir --folder=Inbox --folder-name=test
$ openchangeclient --mkdir --folder=Inbox/test --folder-name=test2
$ openchangeclient --mkdir --folder=Inbox/test/test2 --folder-name=test3
$ openchangeclient --mailbox
+ Mailbox - Julien Kerihuel
|---+ Calendar        :                      (Total: 7 / Unread: 0 - Container 
class: IPF.Appointment) [FID: 0x661f000000000001]
|---+ Contacts        :                      (Total: 3 / Unread: 0 - Container 
class: IPF.Contact) [FID: 0x671f000000000001]
|---+ Deleted Items   :                      (Total: 0 / Unread: 0 - Container 
class: IPF.Note) [FID: 0x5020000000000001]
|---+ Drafts          :                      (Total: 0 / Unread: 0 - Container 
class: IPF.Note) [FID: 0x681f000000000001]
|---+ Inbox           :                      (Total: 1 / Unread: 0 - Container 
class: IPF.Note) [FID: 0x4d20000000000001]
|   |---+ test            :                      (Total: 0 / Unread: 0 - 
Container class: IPF.Note) [FID: 0xe94b050000000001]
|   |   |---+ test2           :                      (Total: 0 / Unread: 0 - 
Container class: IPF.Note) [FID: 0xea4b050000000001]
|   |   |   |---+ test3           :                      (Total: 0 / Unread: 0 
- Container class: IPF.Note) [FID: 0xeb4b050000000001]
|---+ Journal         :                      (Total: 0 / Unread: 0 - Container 
class: IPF.Journal) [FID: 0x691f000000000001]
|---+ Junk E-mail     : Junk Email Comment   (Total: 0 / Unread: 0 - Container 
class: IPF.Note) [FID: 0x210160000000002]
|---+ Notes           :                      (Total: 0 / Unread: 0 - Container 
class: IPF.StickyNote) [FID: 0x6a1f000000000001]
|---+ Outbox          :                      (Total: 0 / Unread: 0 - Container 
class: IPF.Note) [FID: 0x4e20000000000001]
|---+ Sent Items      :                      (Total: 35 / Unread: 0 - Container 
class: IPF.Note) [FID: 0x4f20000000000001]
|---+ Sync Issues     :                      (Total: 0 / Unread: 0 - Container 
class: IPF.Note) [FID: 0x5427000000000001]
|   |---+ Conflicts       :                      (Total: 0 / Unread: 0 - 
Container class: IPF.Note) [FID: 0x5527000000000001]
|   |---+ Local Failures  :                      (Total: 0 / Unread: 0 - 
Container class: IPF.Note) [FID: 0x5627000000000001]
|   |---+ Server Failures :                      (Total: 0 / Unread: 0 - 
Container class: IPF.Note) [FID: 0x5727000000000001]
|---+ Tasks           :                      (Total: 1 / Unread: 0 - Container 
class: IPF.Task) [FID: 0x6b1f000000000001]
    mailbox                  : MAPI_E_SUCCESS (0x0)

This behavior similarly applies to --rmdir option but we will skip this
step and directly delete the first-level child folder 'test'.

$ openchangeclient --rmdir --folder=Inbox --folder-name=test

The custom folder behavior has also been propagated to --fetchmail and
--fetch-items. For example:

$ openchangeclient --fetchmail --folder=Inbox/test/test2

However it can happen that users want to fetch folders with a message
class different from IPF.Note. In this case you can use --fetch-items.
For example if we have a MyAppointments folder with IPF.Appointment
entries, we can run the following command to fetch its messages:

$ openchangeclient --fetch-items=Appointment --folder=Calendar/MyAppointments


Developers interested in this behavior should note that a
mapi_object_copy function has been introduced which allow to overwrite
an existing object with data from another one. 

Semantically, each OpenFolder requires a Release call to be performed
after we finish operations involving this object. However in our folder
lookup case, we do not want to deal with intermediary objects and
assumes Exchange maintains an object hierarchy: Releasing the top
container resulting in Releasing its associated hierarchy on the server.

I'll ask this question on MSDN forum to get confirmation whether this
assumption is correct or not.

Cheers,
Julien.

-- 
Julien Kerihuel
[EMAIL PROTECTED]
OpenChange Project Manager

GPG Fingerprint: 0B55 783D A781 6329 108A  B609 7EF6 FE11 A35F 1F79

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
devel mailing list
[email protected]
http://mailman.openchange.org/listinfo/devel

Reply via email to