Differences
This shows you the differences between two versions of the page.
tech:others:downloading_imap_mail [2014/11/15 09:13] |
tech:others:downloading_imap_mail [2014/11/15 09:13] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Download mail ====== | ||
+ | Using imapgrab.py script that is a wrapper for getmail | ||
+ | |||
+ | ===== Command to list all mail from server ===== | ||
+ | <code> | ||
+ | ./imapgrab.py -l -s somemailserver.com -u someuser@example.com -p <password> | ||
+ | </code> | ||
+ | |||
+ | ===== Command to download all mail from server (maildir) ===== | ||
+ | This one uses the maildir format (one file per email, one directory per imap folder) | ||
+ | <code> | ||
+ | cd /home/someuser1/imap_files/imapgrab | ||
+ | mkdir mdir | ||
+ | nohup ./imapgrab.py -d -M -a -f /home/someuser1/imap_files/imapgrab/mdir -m "_ALL_" | ||
+ | -s somemailserver.com -u someuser@example.com -p <enterpass> > imapgrab.log 2>&1 | ||
+ | </code> | ||
+ | |||
+ | Output | ||
+ | <code> | ||
+ | someuser1@ub1:~/imap_files/imapgrab$ cat imapgrab.log | ||
+ | nohup: ignoring input | ||
+ | IMAP Grab 0.1.4 | ||
+ | --- | ||
+ | Downloading mailbox "INBOX" | ||
+ | Downloading mailbox "INBOX.Drafts" | ||
+ | Downloading mailbox "INBOX.Sent" | ||
+ | Downloading mailbox "INBOX.Trash" | ||
+ | .... | ||
+ | .... | ||
+ | Downloads complete | ||
+ | </code> | ||
+ | |||
+ | ===== Command to download all mail from server (mbox) ===== | ||
+ | This one uses the maildir format (one file per imap folder) | ||
+ | <code> | ||
+ | cd /home/someuser1/imap_files/imapgrab | ||
+ | mkdir mdir1 | ||
+ | nohup ./imapgrab.py -d -B -a -f /home/someuser1/imap_files/imapgrab/mdir1 -m "_ALL_" | ||
+ | -s mail.lonex.com -u someuser@example.com -p lotus111 > imapgrab1.log 2>&1 & | ||
+ | </code> | ||
+ | |||
+ | Output | ||
+ | <code> | ||
+ | someuser1@ub1:~/imap_files/imapgrab$ cat imapgrab1.log | ||
+ | nohup: ignoring input | ||
+ | IMAP Grab 0.1.4 | ||
+ | --- | ||
+ | Downloading mailbox "INBOX" | ||
+ | Downloading mailbox "INBOX.Drafts" | ||
+ | Downloading mailbox "INBOX.Sent" | ||
+ | Downloading mailbox "INBOX.Trash" | ||
+ | .... | ||
+ | .... | ||
+ | Downloads complete | ||
+ | </code> | ||