Subfolders missing on iOS and Android Mail/Outlook App after importing PST file

Moving from an IMAP based mail hosting to Office365 Exchange is easy. I changed some information in the DNS of my domain, created a user in Office365 and started using Exchange Online with my Outlook on Windows and macOS. Last but not least I exported my old mailbox in Outlook and reimported it with Outlook connected with the new Office365 mailbox. Done! – Everything works pretty well. BUT: On my iPhone, most of the subfolders in the Office365 mailbox are missing. The same problem using the native Mail app and the iOS Outlook app. WTF?

It takes me hours the find the problem and a solution.

The Problem: Folders are still tagged as “IMAP folders”

While importing a PST file originally created with Outlook connected to an IMAP mail-system into an Outlook connected to an Exchange (Online) mail-system, the problem starts. Only some of the imported subfolders were converted from an “IMAP folder” to an “Exchange folder”. I don’t know why some of them were tagged as an Exchange folder and some not. But it is as it is. It ends in trouble.

Here you can easily understand the problem: Open Outlook, select a subfolder an open the View section.

“Change View” menu for an Exchange folder –
Those folders are visible
“Change View” menu for an IMAP folder –
Those folders are invisible on iOS/Android mail-apps

The Solution: Change „PR_CONTAINER_CLASS“

And yes, you will have to do this for each folder. But the good news is, Robert Sparnaaij  (MVP für Office) created a simple VBA script to fix the whole folder structure.

Script

'This script fixes imported IMAP folders.
'It does this by modifying the value PR_CONTAINER_CLASS property;
'The value is schanged from IPF.Imap to IPF.Note.

'Script created by: Robert Sparnaaij
'For more information about this file see;
'http://www.howto-outlook.com/howto/fix-imported-imap-folders.htm

Dim i

Call FolderSelect()

Public Sub FolderSelect()
  Dim objOutlook
  Set objOutlook = CreateObject("Outlook.Application")

  Dim F, Folders
  Set F = objOutlook.Session.PickFolder

  If Not F Is Nothing Then
    Dim Result
    Result = MsgBox("Do you want to include the subfolders?", vbYesNo+vbDefaultButton2+vbApplicationModal, "Include Subfolders")

    i = 0
    FixIMAPFolder(F)

    If Result = 6 Then
      Set Folders = F.Folders
      LoopFolders Folders
    End If

    Result = MsgBox("Done!" & vbNewLine & i & " folder(s) have been fixed.", vbInfo, "Fix Imported IMAP Folders")
  
    Set F = Nothing
    Set Folders = Nothing
    Set objOutlook = Nothing
  End If
End Sub

Private Sub LoopFolders(Folders)
  Dim F
  
  For Each F In Folders
    FixIMAPFolder(F)
    LoopFolders F.Folders
  Next
End Sub

Private Sub FixIMAPFolder(F)
  Dim oPA, PropName, Value, FolderType

  PropName = "http://schemas.microsoft.com/mapi/proptag/0x3613001E"
  Value = "IPF.Note"

  On Error Resume Next
  Set oPA = F.PropertyAccessor
  FolderType = oPA.GetProperty(PropName)

  'MsgBox (F.Name & " - " & FolderType)

  If FolderType = "IPF.Imap" Then
    oPA.SetProperty PropName, Value
    i = i + 1
  End If

  Set oPA = Nothing
End Sub

How to

  1. Start your Outlook on Windows
  2. Copy the script into a text file on your Desktop and safe it as “FixIMAP.vbs
  3. You wouldn’t need any administrative rights, so it’s easy to use
  4. Double-click the .vbs file (start the script)
  5. Now your Outlook wants to know which folder should be converted
  6. Select the Exchange base top-folder you want to fix
  7. The script now wants to know if it should fix your subfolders, too.
  8. Answer with yes, because that’s the thing we want to do
  9. Depending on the size and number of folders the script will run a few seconds.
  10. That’s it. All folders should now be tagged as “Exchange folders”.
  11. Wait until your Outlook synchronized the modifications with Exchange (Online)

It’s magic …

Try to synchronize the Exchange (Online) mailbox with your mobile app. Now you should (and will) see all folders of your mailbox.

Pretty simple – if you know how …. Thanks to Robert Sparnaaij for providing the script. And thank you to Google for bringing me the right link to the information after hours.

I hope I helped you not to spend hours searching Google for a solution.

You might also like

More Similar Posts

9 Kommentare. Hinterlasse eine Antwort

That is great ! Thank you

Antworten

Thank you for this! I was having this issue for months and couldn’t figure it out. This script fixed the problem!

Antworten

Thank you! This problem has been plaguing me for 15 months!

Antworten

My Friend, I love you so much

Antworten

    I was pleased to do that. I faced the same problem. And if it can solve then you should share the knowledge with others. 2x have to look for the same solution when others have already done it, is always stupid 😉

    Antworten

Many thanks for helping sort out my sync issue.. Perfect result going from imap to exchange

Antworten
Mark Benedict Morris
6. September 2022 16:29

Brilliant. It worked a treat. Thank you.

Antworten

Kommentar verfassen

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.

Menü