mfcmapi icon indicating copy to clipboard operation
mfcmapi copied to clipboard

Cannot use MFCMAPI to copy and paste personal retention policy tags from one folder to another

Open Alex-Catalin opened this issue 2 years ago • 8 comments

A while back I wrote this guide on how to use MFCMAPI to prevent auto archiving for Calendar, Notes and Tasks in Exchange Online - https://answers.microsoft.com/en-us/msoffice/forum/all/prevent-archiving-for-calendar-notes-and-tasks-in/477d93b9-143e-4ace-8c7b-de1bfafc913d.

This is no longer working and I have tested with the following MFCMAPI versions: x64.19.2.19207.938, x64..21.0.21127.03, x64.23.0.23086.06.

The steps to reproduce the issue are:

  • Create a new folder with Outlook desktop client or OWA in the mailbox
  • Assign to this new folder a personal archive tag
  • Run Start-ManagedFolderAssistant to confirm the changes
  • Start MFCMAPI x64.23.0.23086.06, select Tools, Options and make sure you check "use MDB_ONLINE" and "MAPI_NO_CACHE", then click OK
  • Click on Session tab and then logon to select the Outlook profile of the affected mailbox
  • Double click on the name of the Exchange mailbox and expand the Root Container in the new window
  • Expand Top of Information Store and look for the new folder that you created
  • There will be a property stamped on it called PR_ARCHIVE_TAG, right click on it and select Copy
  • Now select the Calendar folder for example, right click on it and select Paste - nothing happens, the PR_ARCHIVE_TAG property is not copied over on the Calendar folder

It's the same behavior as above with version x64..21.0.21127.03. With version x64.19.2.19207.938 however, there are additional things going on:

  • When I right click on the Calendar folder and I select Paste, I get a new window prompt that asks me how do I want to paste the property with the Copy Style field automatically set to IMAPIProp::CopyProps
  • I click OK on the Copy Style prompt and a second windows pops up on which I also click OK
  • The end result is that the PR_ARCHIVE_TAG property is created on the Calendar folder but with a null binary value, which makes it useless, as the expected result is to have the ID of the tag in that binary value

Alex-Catalin avatar Mar 28 '23 13:03 Alex-Catalin

Is the problem limited to just the PR_ARCHIVE_TAG or does it reproduce with other properties of type PT_BINARY?

stephenegriffin avatar Mar 28 '23 13:03 stephenegriffin

I have not tested other properties because PR_ARCHIVE_TAG is the only one of interest to me.

Alex-Catalin avatar Mar 28 '23 14:03 Alex-Catalin

I tried to copy and paste this property 0x67590102 (PT_BINARY) from one folder to another, and it is the same thing. The property does already exist on the target folder but with another binary value, and I was expecting that copy pasting would at least rewrite the value, but maybe that's not supposed to happen, and it doesn't in this case, the target folder retains its initial binary value for property 0x67590102.

I don't know what other properties I can check, because I don't know their meaning, and it seems that most of the properties already exist on all folders, but they have different binary values.

Alex-Catalin avatar Apr 04 '23 07:04 Alex-Catalin

@Alex-Catalin the link above no longer works. I'm hoping this can be fixed since I'd also like to prevent archiving of Tasks for a particular user, and this is like the only way to do it.

greatquux avatar May 07 '24 18:05 greatquux

@Alex-Catalin the link above no longer works. I'm hoping this can be fixed since I'd also like to prevent archiving of Tasks for a particular user, and this is like the only way to do it.

Yeah, I disabled access to that article on purpose because given this MFCMAPI issue, the solution I was discussing in the article no longer applies, unfortunately :).

Alex-Catalin avatar May 09 '24 07:05 Alex-Catalin

Retention Policy through EWS.pdf I got a procedure from Microsoft support to use EWS Editor to do this. I threw it into a PDF for safe-keeping. This is not the best place to put this but until Microsoft makes an article about it, I'm putting it here!

greatquux avatar May 21 '24 20:05 greatquux

@greatquux , I'll see if I can put the info on my forum post. The thing is that in the near future EWS will also go away, and everything will be done with Graph. I will check the file and if that's a good way of tackling this issue, I will add the information on the old thread that I took down. I will give you the credit for the info :). Thanks!

PS: Please let me know if you agree for me to put the info from the pdf file in my old article. I will not do it without your consent.

Alex-Catalin avatar May 22 '24 07:05 Alex-Catalin

@greatquux , FIY, I republished the forum post using the EWSEditor method :). Thanks again for pointing it out!

Alex-Catalin avatar May 30 '24 13:05 Alex-Catalin