Displays a summary about the specified mailbox.

Usage

mailbox-summary.py [-h] --host HOST [-p PORT] [--user USERNAME] [--password PASSWORD] [--no-ssl] [--no-color] [-f FOLDER] [--quiet]
ArgumentDescription
-h, --helpshows the help
--hostIMAP server host
--passworduser password (insecure, see below)
--no-ssldo not use SSL (insecure)
--no-colordisable terminal colors
-f, --folderIMAP mailbox (default: Inbox)
--quietdo not show any errors or warnings
Warning. Passing a password via the command-line argument is insecure because the password can be stored in bash history. You will be securely asked for the password if it is not specified.

Example

The following command will show a summary about the Inbox folder of the justexample user on the Google Mail:

$ ./mailbox-summary.py --host imap.gmail.com --user justexample --password qwerty --folder Inbox

Sample output:

Connecting ...
Connected.
Logging in ...
Logged in.
Selecting mailbox ...
Fetching unseen messages IDs ...
Total messages: 3
Unseen: 2
Available mailboxes (folders):
  (\HasNoChildren) "/" "INBOX"
  (\Noselect \HasChildren) "/" "[Gmail]"
  (\HasNoChildren \Important) "/" "[Gmail]/&BBIEMAQ2BD0EPgQ1-"
  (\HasNoChildren \All) "/" "[Gmail]/&BBIEQQRP- &BD8EPgRHBEIEMA-"
  (\HasChildren \HasNoChildren \Trash) "/" "[Gmail]/&BBoEPgRABDcEOAQ9BDA-"
  (\HasNoChildren \Sent) "/" "[Gmail]/&BB4EQgQ,BEAEMAQyBDsENQQ9BD0ESwQ1-"
  (\HasNoChildren \Flagged) "/" "[Gmail]/&BB8EPgQ8BDUERwQ1BD0EPQRLBDU-"
  (\HasNoChildren \Junk) "/" "[Gmail]/&BCEEPwQwBDw-"
  (\HasNoChildren \Drafts) "/" "[Gmail]/&BCcENQRABD0EPgQyBDgEOgQ4-"
Logging out ...
Success.

Downloads email messages from the specified IMAP folder.

Usage

download-folder.py [-h] --host HOST [-p PORT] [--user USERNAME] [--password PASSWORD] [--no-ssl] [--no-color] [-f FOLDER] [--quiet] [-d PATH] [--force]
ArgumentDescription
-h, --helpshows the help
--hostIMAP server host
--passworduser password (insecure, see above)
--no-ssldo not use SSL (insecure)
--no-colordisable terminal colors
-f, --folderIMAP mailbox (default: Inbox)
--quietdo not show any errors or warnings
-d, --directorydownload directory (default is the current directory)
--forceoverwrite files without prompt

Example

The following command will download all the Spam from the Google Mail account into the specified directory (replacing all existing files):

$ ./download-folder.py --host imap.gmail.com --user justexample --password justexample --force -d ~/Documents/Spam/ --folder "[Gmail]/Spam"

Sample output:

Connecting ...
Connected.
Logging in ...
Logged in.
Selecting mailbox ...
Fetching messages IDs ...
Found 3 message(s)
Got message #1 (5779 bytes) <000d01cdae8d$3419a4d0$00575fa8@xuysldrpkpota>
Saving as /home/eigenein/Documents/Spam/000d01cdae8d$3419a4d0$00575fa8@xuysldrpkpota.eml ...
Got message #2 (5740 bytes) <000d01c193a9$959c0230$00575fa8@eyxkcguufxqds>
Saving as /home/eigenein/Documents/Spam/000d01c193a9$959c0230$00575fa8@eyxkcguufxqds.eml ...
Got message #3 (5818 bytes) <000901cdaea3$28b11a90$00575fa8@sdvgdydcqj>
Saving as /home/eigenein/Documents/Spam/000901cdaea3$28b11a90$00575fa8@sdvgdydcqj.eml ...
Logging out ...
Success.