Vomit-sync is a Rust library for IMAP to maildir synchronization. If you just want something to do this, you are looking for vsync, a thin application wrapper around vomit-sync.
The goal is to provide full two-way synchronization between an IMAP server and a local maildir, either by running periodically, or as a deamon.
Currently, only syncing from IMAP to maildir is implemented, and only by running periodically.