Download and install OfflineIMAP from your distribution's software repositories. In Debian-based distributions you can use "apt-get"

click to enlarge
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:
[general]
accounts = (Your Account Name)
[Account Test]
localrepository = Local
remoterepository = Remote
[Repository Local]
type = Maildir
localfolders = (Where You Want To Save Your Backup ex. /home/user/backup)
[Repository Remote]
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.