none
How to get account details via MAPI RRS feed

  • Question

  • I spawned a new question from http://social.msdn.microsoft.com/Forums/vstudio/en-US/75ceabe9-c691-4866-89a7-c80c338ac786/urgent-how-to-get-user-name-and-password-from-outlook-mapi-or-

    I have one Outlook profile, but several accounts (email addresses to different servers). I can see the regkey

    HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging\Profiles\<profilename>\9375CFF0413111d3B88A00104B2A6676

    I have 5 subkeys under that and as the other example states I can read "00000004" to get the (encrypted) server and password.

    So the problem is that I only see the one account name (and password) but I do have several accounts. So where are those stored?

    My goal is to write an Outlook add-on, so when I look at an Outlook email - I want to look at the actual POP server to see if it exists there. (actually my real goal is for the add-on to see when I move an Outlook email to another folder, then to delete that email from the pop server).

    So I see the To,CC,BCC properties on the Outlook email - and right now I'm guessing I have to parse and determine the address that was used to it got to my inbox.

    Then I need to check that address that I (somehow) got from my various Outlook accounts and get the server login info for.

    Then I was going to read the POP mail (probably via OpenPop) and compare message ids (or other properties) to see if I see the email and then remove it from the pop server.

    Saturday, June 29, 2013 5:05 AM

Answers

  • How do you decrypt the data? Are you using CryptProtectData?

    What version of Outlook are you using? Keep in mind that Outlook 2013 stores profiles in a different registry key.


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

    Monday, July 1, 2013 5:26 PM
  • I actually meant CryptUnprotectData, sorry.

    You could use the MailItem.SendUsingAccount property, but Outlook.Account will not give you all the account details.

    You can either

    1. retrieve the data from the registry

    2. use IOlkAccountManager interface (Extended MAPI in C++ or Delphi only) - you can play with it in OutlookSpy (click IOlkAccountManager button).

    3. Use Redemption and the RDOMail.Account property, which for the POP3/SMTP account will return the RDOPOP3Account object with all the account details except the password.


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


    Tuesday, July 2, 2013 6:47 PM

All replies

  • How do you decrypt the data? Are you using CryptProtectData?

    What version of Outlook are you using? Keep in mind that Outlook 2013 stores profiles in a different registry key.


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

    Monday, July 1, 2013 5:26 PM
  • Thank you for replying Dmitry,

    It is not a commercial project - just something I was doing for myself. So I thought the example I referred to got the unencrypted password from the registry but I guess it just gets the encrypted one.

    If you are suggesting I use CryptProtectData I can investigate, but since this is (right now) for personal use I can just supply my own passwords again somewhere.

    To reword the question: I have several pop addresses all being sent to the one Outlook inbox. I'm making an addin that when I move the Outlook email to another folder. I want to remove it from the pop server. So I can see in the email who it was sent to, I was hoping I could use the Outlook profile and find the email account and get the pop server info. If I can somehow get all the pop server info except for the password then since it is for personal use that is not the end of the world.

    So yes I'm currently using Outlook2013, but how do I get the pop server info when I'm looking at a given email. How do I iterate through the accounts of an Outlook profile?

    Tuesday, July 2, 2013 1:44 PM
  • I actually meant CryptUnprotectData, sorry.

    You could use the MailItem.SendUsingAccount property, but Outlook.Account will not give you all the account details.

    You can either

    1. retrieve the data from the registry

    2. use IOlkAccountManager interface (Extended MAPI in C++ or Delphi only) - you can play with it in OutlookSpy (click IOlkAccountManager button).

    3. Use Redemption and the RDOMail.Account property, which for the POP3/SMTP account will return the RDOPOP3Account object with all the account details except the password.


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


    Tuesday, July 2, 2013 6:47 PM