Binary package “imapcopy” in ubuntu focal
IMAP backup, copy and migration tool
IMAPCopy is a small command line tool to copy messages for multiple
users from one imap server to another. You can use it with any IMAP
implementation, for example you can migrate from Cyrus to MS Exchange
or from MS Exchange to Courier IMAP.