Download and install OfflineIMAP from your distribution's software repositories. In Debian-based distributions you can use "apt-get" from the command prompt or use a package manager like Synaptic to search for and install the software. Once installed, you will need to configure the application manually.
Launch a text editor such as Gedit and create a file with this template and replace the values in parenthesis with your account information:
accounts = (Your Account Name)
localrepository = Local
remoterepository = Remote
type = Maildir
localfolders = (Where You Want To Save Your Backup ex. /home/user/backup)
type = IMAP
remotehost = (Your E-mail Server's Hostname or IP Address)
remoteuser = (Your E-mail User Name)
Save the file in your home directory as ".offlineimaprc" before you close the text editor.
Launch a terminal window from the desktop. If you have never used a terminal before, there is one located under the "Accesories" section of your "Applications" menu in Gnome, or Kterm directly from the KDE "System" menu.
Type "offlineimap" and press the "Enter" key to launch the utility. Enter your password when prompted, then wait for the entirety of your IMAP folders to be downloaded locally.