I originally wrote this to allow me to backup my Gmail account through IMAP. It is released under GPLv2.
You can browse the SVN at ImapGrab's SourceForge.net project page.
Table of Contents (hide)
ImapGrab Version 0.1.4 [ Download ]
Warning! This is an alpha release and should not be considered stable.
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 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 | List the mailboxes available for download |
--download | -d | Download mailboxes to separate mbox files |
--mbox | -B | Download into Mbox format (optional, default) |
--maildir | -M | Download into Maildir format (optional) |
--all | -a | Force download all mail in a mailbox (optional) |
--ssl | -S | Use SSL connection (optional) |
--server | -s | IP or domain of server (required) |
--port | -P | Port of server (optional) |
--username | -u | Username for account (required) |
--password | -p | Password for account (required) |
--mailboxes | -m | Comma separated list of mailboxes to download (i.e. "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 | Path to folder (optional, creates imapgrab folder in current directory as default) |
--localuser | -L | User that writes to the mailboxes (use only when involking imapgrab as root) |
--quiet | -q | Don't display any output |
--verbose | -v | Verbose output |
--debug | Print debug output | |
--version | Print version | |
--about | Display detailed info | |
--help | -h | Print help with command options |
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"
Version 0.2
Version 0.3
Version 0.4
Version 0.5
Version 1.0