Microsoft Outlook will typically replicate the contents of an IMAP mailbox locally to facilitate off-line access to email. I have been looking for a similar function for opensource based packages. I found it.
OfflineIMAP is a GPLv2 software to dispose your mailbox(es) as a local Maildir(s).
For example, this allows reading the mails while offline without the need for your mail reader (MUA) to support disconnected operations.
OfflineIMAP will synchronize both sides via IMAP.
Code is maintained at github.
I found this when seeing Notmuch -- Just an email system at LWN: A year with Notmuch mail.
2018/02/12 - astroid - a lightweight and fast Mail User Agent that provides a graphical interface to searching, displaying and composing email, organized in threads and tags. Astroid uses the notmuch backend for blazingly fast searches through tons of email. Astroid searches, displays and composes emails - and rely on other programs for fetching, syncing and sending email.