I originally wrote this to allow me to backup my Gmail account through IMAP, but am no longer able to maintain it. It is released under GPLv2, so you are welcome to fork the project.
ImapGrab is a cli and gui program (written in Python) that allows you to log into an IMAP server, list mailboxes, and download selected mailboxes to mbox or maildir files. It requires getmail 4.8.2 or higher. The gui requires PyGtk 2.0 or higher.
ImapGrab Version 0.1.4 (Download)
Warning! This is an alpha release and should not be considered stable. The program is currently just two python scripts with some glade/svg files.
imapgrab.py
is a command line interface (CLI) that allows you to log into an IMAP server and download selected mailboxes (i.e. folders/labels) to mbox files or maildir folders. You can also list the mailboxes on that server. It is basically a wrapper for getmail (a mail downloading program). When done downloading selected mailboxes, you end up with one .mbox file per mailbox or one set of maildir folders per mailbox.
imapgrab-gui.py
is a graphical user interface (GUI) that is a wrapper for the imapgrab.py CLI. It must be run in the same directory as imapgrab.py and must have imapgrab-gui.glade
, imapgrab-gui-about.glade
, and imapgrab_logo_plain.svg
in the same directory.
imapgrab-gui.py
only)ImapGrab has a mailing list at Google Groups. I am always looking for more help developing this.
Currently, there isn't a formal bug tracker, so the best place to report bugs is the mailing list.
imapgrab [-ldaSv] [-s] SERVER [-P] PORT [-u] USERNAME [-p] PASSWORD [-m] "BOX1,BOX2,..." [-f] DIRECTORY
--list
-l
--download
-d
--mbox
-B
--maildir
-M
--all
-a
--ssl
-S
--server
-s
--port
-P
--username
-u
--password
-p
--mailboxes
-m
"Box1, Box2, Box3"
) ({,}
for non-separating commas) ("_ALL_"
for all mailboxes) ("_ALL_, -Box1"
to except Box1 from ALL) ("_ALL_, -_Gmail_"
to except Gmail* and Google Mail* folders) (required for -d)--folder
-f
--localuser
-L
--quiet
-q
--verbose
-v
--debug
--version
--about
--help
-h
imapgrab -l -s imap.example.com -u username -p password
imapgrab -d -s imap.example.com -u username -p password -m "box1, box2"
imapgrab -d -s imap.example.com -u username -p password -m "_ALL_, -box3"
imapgrab -d -S -s imap.gmail.com -u username -p password -m "_ALL_, -_Gmail_"
imapgrab -d -S -s imap.gmail.com -u username -p password -m "receipts"