Package: weighmail
An application to label your Gmail messages according to sizeAuthor:Brian Neal <bgneal@gmail.com>Version:0.1.0Date:May 20, 2012Home Page:https://bitbucket.org/bgneal/weighmail/License:New BSD License (see LICENSE.txt)Support:https://bitbucket.org/bgneal/weighmail/issuesOverviewweighmailis 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.Installationweighmailcan be installed usingPip:$ pip install weighmailAlternatively you can download a tarball and install with:$ python setup.py installweighmaildepends on theIMAPClientlibrary. This library is automatically
installed if you usePip.Gmail NotesIn case it isn’t clear,weighmailworks withGmail. You must have a Gmail
account withIMAP support turned on. Please go into your settings and verify
IMAP support is turned on before proceeding.If you are usingtwo-step verificationon your Gmail account (and you
really should be), youneed to generate an application specific passwordforweighmailto use. In this case you will use an application specific
password instead of your normal password when runningweighmail.Usageweighmailcan accept options from a configuration file and/or the
command-line. Command-line arguments always take precedence over options found
in the configuration file.Command-Line Argumentsweighmailtakes 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 runweighmailis as follows:$ weighmail --labels big:1MB-5MB huge:5MB-10MB enormous:10MB-This example demonstrates:Abiglabel will be applied to messages between 1 and 5 MegabytesAhugelabel will be applied to messages between 5 and 10 MegabytesAnenormouslabel will be applied to messages 10 MB and biggerSince nouserorpasswordoptions were supplied on the command-line,weighmailwill interactively prompt for them. Neither will be echoed out
for privacy reasons.To see a list of all command-line options:$ weighmail --helpSome notes on the options follows.The--configoption is used to specify a configuration file thatweighmailwill read for options. Any options supplied on the command-line
will override any options from this file. In particular, if you specify any
label rules on the command-line, all label rules in the configuration file
will be ignored.The--folderoption can be used to specify which Gmail label to search for
messages. This defaults to yourAll Maillabel.The--userand--passwordoptions are used to specify which Gmail
account to log into. If these are not supplied, and also omitted from a config
file (or if no config file is being used),weighmailwill prompt you for
these options.The--labelsargument is how you specify the rules for labeling your
messages. See the sub-section below for more detail on this syntax.The--host,--port, and--nosslarguments are for advanced use
only, and may in fact not work. The defaults should work for most people, and
will connect you toimap.gmail.comport 993 using SSL.The –labels argument syntaxTo specify label rules on the command-line, use the following syntax:$ weighmail --labels name:min-max [name:min-max] ...Where:nameis the name of the label. Note that Gmail labels cannot have spaces in
them.minandmaxspecify the message size range in bytes. Either one, but not
both, may be omitted (but the dash must remain). You may use the suffixesKB,MB, orGBto indicate kilobytes, Megabytes, or Gigabytes,
respectively.Another example:$ 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.Configuration FileIf you specify the--config=filenameoption on the command-line,weighmailwill parse this file for options. Please see the includedsample-weighmail.inifile for the syntax and option descriptions.Again, note that command-line arguments take precedence over options found in
the configuration file. If you specifyanylabel rules on the command-line,alllabel rules in the configuration file are ignored.ThanksA big thank-you to Menno Smits, the author of theIMAPClientlibrary. This
application would have been considerably more complicated if the awesome
IMAPClient library did not exist.