IMAPISession: MAPI_E_UNKNOWN_FLAGS error occurs when a user is trying to export the repaired mailboxes of an Exchange Database (EDB) file to Office 365. Refer to screenshot below:

To avoid the error, users must take following factors into consideration before exporting mailbox data to Office 365:

  1. User need to have an Office 365 account for exporting data to Office 365
  2. The system used for exporting mailbox should be a part of ‘Workgroup’. It should not be in any Exchange domain.
  3. Outlook profile should not be synced with any Exchange account. Remove the Outlook profile which is synced with Exchange Server.
  4. If still user is facing any issue to connect with Office 365 account then he has to create the profile with the same email id of Office 365 that is to be used to login into our software.

Also check this KB for Prerequisite while migrating offline EDB to Office 365