User Tools

Site Tools



jMailBackup is a small tool I wrote for backing up mails from my Google Mail account via IMAP/IMAP SSL.

Example usage

Backup all mails. The EML files containing single messages will be stored in a new directory “mails”.

java -jar jMailBackup.jar -T imaps -H -U -P mypassword -f "[Google Mail]/All Mail"

Convert them into MBOX format with the bundled script eml2mbox.rb.

ruby eml2mbox.rb mails $(pwd)/mails.mbox

You can now import the MBOX file into your favourite mail-client.

Source code

You can checkout the latest development version via Git. An Eclipse project file is included.

$ git clone

Browse repository online

TODO/ Improvements

  • Don't supply password on command-line. Instead, ask for it.
  • Configurable delay between a number of messages to prevent disconnection (especially for gmail).
  • Restore feature

Report bugs / contact

You may send an email to


jMailBackup is licensed under the GPLv3 license.

The included Java library JavaMail 1.4.3 is licensed under the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0.

The included Ruby script eml2mbox.rb v0.08 is licensed under the LGPL 2.1.

apps/jmailbackup.txt · Last modified: 2014-01-17 17:24 CET by dominik