Labels your Gmail messages according to size.
|Author:||Brian Neal <email@example.com>|
|Date:||May 20, 2012|
|License:||New BSD License (see LICENSE.txt)|
weighmail is a program that analyzes your Gmail and applies labels to your messages according to their size. This is useful if you are close to reaching your quota as it allows you to quickly identify large messages. You have complete control over the rules used to create the labels.
weighmail can be installed using Pip:
$ pip install weighmail
Alternatively you can download a tarball and install with:
$ python setup.py install
If you are using two-step verification on your Gmail account (and you really should be), you need to generate an application specific password for weighmail to use. In this case you will use an application specific password instead of your normal password when running weighmail.
weighmail can accept options from a configuration file and/or the command-line. Command-line arguments always take precedence over options found in the configuration file.
weighmail takes a fair number of arguments on the command-line. Most of these can be omitted however, as they all have sensible defaults. In fact, the simplest way to run weighmail is as follows:
$ weighmail --labels big:1MB-5MB huge:5MB-10MB enormous:10MB-
This example demonstrates:
To see a list of all command-line options:
$ weighmail --help
Some notes on the options follows.
To specify label rules on the command-line, use the following syntax:
$ weighmail --labels name:min-max [name:min-max] ...
$ weighmail --labels normal:-2MB big:2MB-7MB huge:7MB-
In all these examples the label ranges do not overlap. This does not have to be the case; overlapping ranges may be defined if desired.
If you specify the --config=filename option on the command-line, weighmail will parse this file for options. Please see the included sample-weighmail.ini file for the syntax and option descriptions.
Again, note that command-line arguments take precedence over options found in the configuration file. If you specify any label rules on the command-line, all label rules in the configuration file are ignored.
A big thank-you to Menno Smits, the author of the IMAPClient library. This application would have been considerably more complicated if the awesome IMAPClient library did not exist.