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.
Checkout the OfflineIMAP official project.
Download releases as tarball or zipball.