none
Unique fields of mailbox RRS feed

  • Question

  • Hi everyone,

    If I have many profiles in my computer and every profile have many mailboxes, then what are the fields in MAPI to distinguish every mailbox. And also how to retrieve them? The field should be same for one mailbox in any profile. Kindly help me.

    Thanks and regards,

    Talib Hussain

    Wednesday, July 2, 2014 5:23 AM

Answers

All replies

  • Try PR_MAPPING_SIGNATURE: http://msdn.microsoft.com/en-us/library/office/cc815683(v=office.15).aspx

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, July 2, 2014 5:59 AM
  • Hello,

    It looks like you are interested in the EnumerateAccounts method of the IOlkAccountManager interface. You can read more about this in the Using Account Management API (IOlkAccountManger) to List Outlook Email Accounts article.

    • Marked as answer by talib2608 Wednesday, July 2, 2014 4:32 PM
    Wednesday, July 2, 2014 6:02 AM
  • How would IOlkAccountManager help?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, July 2, 2014 6:52 AM
  • IOlkAccountManager would do the work I guess. I will try that. What about PR_ENTRYID of message store? IMAPISession::CompareEntryIDs() can be used to compare PR_ENTRYID of two message stores.
    Wednesday, July 2, 2014 7:08 AM
  • > What about PR_ENTRYID of message store?

    Multiple stores may exist in the signle mailbox. Moreover, a message store can be attached to different profiles. So, you can't identify exactly the mailbox.

    Wednesday, July 2, 2014 8:56 AM
  • Hi Eugene,

    Even if a message store is attached to different profiles, PR_ENTRYID must be same on all of them to identify a particular mailbox. PR_ENTRYID must also be the unique property to identify mailboxes in profiles

    Wednesday, July 2, 2014 10:44 AM
  • Talib,

    Okay. How are you going to identify mailbox if multiple stores are attached to the single profile (each store has a corresponding mailbox)?

    Wednesday, July 2, 2014 10:51 AM
  • Using PR_ENTRYID,

    Even if the same mailbox is added in more profiles on the same computer, and if they are having same values in all the profiles - will imply that all refer to same mailbox.

    Wednesday, July 2, 2014 11:13 AM
  • Talib,

    I know what the PR_ENTRYID property is and how it works. What I am trying to say is a bit different.

    Wednesday, July 2, 2014 12:18 PM
  • No, the same mailbox opened as a primary store vs the same mailbox opened as a delegate store will have a different entry id.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, July 2, 2014 1:50 PM
  • How would you make IOlkAccountManager work in your case? It will not help you identity a particular mailbox attached to different profiles or opened as primary vs delegate stores.

    In case of Exchange stores, you can extract the DN of the store owner from the entry id, but the entry id itself mayl be different. PR_MAPPING_SIGNATURE on the other hand uniquely identifies a mailbox.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, July 2, 2014 4:57 PM
  • Hi Dmitry,

    Actually, I want to apply AdviseSink Notification (as given in MFCMAPI), so that if notifications are to be applied on a mailbox only once. If I get the identity of the mailbox and store it somewhere, and check if notification is already applied to the mailbox then skip, otherwise add to a list, then there wouldn't be more than one notification.

    If a mailbox is added in more than one profile, then that many times the user or administrator would be notified about the email being sent. I will do more research on IOlkAccountManager or something easier to solve this problem.

    Wednesday, July 2, 2014 5:39 PM