For libre options available from Linux distributions' repositories, see isync (aka mbsync) and offlineimap. And mail clients in general should be able to handle IMAP and standard formats (Maildir, mbox). If one cares about mail backups, it is also useful to archive and backup one's mail in one of those standard and portable formats, and/or to synchronize between multiple machines regularly.