Migrating Maildir data directly to Office 365 requires a reliable migration tool that can maintain mailbox structure, emails, folders, and other data during the transfer. A manual approach can be time-consuming and may lead to data loss or formatting issues.
I would suggest using Shoviv IMAP to Office 365 Migration for this type of migration. It supports migrating email data from IMAP-based accounts to Office 365 mailboxes with proper folder hierarchy and provides options to map source and destination mailboxes. The tool is suitable for both small and large migrations and helps simplify the migration process with better control and accuracy. It is worth testing with a demo before performing the complete migration.