Can I backup or mirror an IMAP mailbox on Mac OS X?
If you're comfortable using Unix tools, a few applications spring to mind:


OfflineIMAP
imapsync
Mailsync


imapsync isn't open source but the others are. You may also find this Ask Different thread useful.