This can be used to modify the Gmail labels of a message via the Gmail API.
- Perl
- module Data::Dumper
- module Google::API::Client
- module Google::API::OAuth2::Client
- module Config::Simple
- module Storable
- module Crypt::CBC
- module IO::Prompter
- module Getopt::Long
- module File::Basename
- module Crypt::OpenSSL::AES
- Go to https://console.developers.google.com/apis
- Create a project. Project name: gmail-labeler
- Credentials -> Create credentials -> OAuth client ID -> Other
- Dashboard -> ENABLE API -> Gmail API -> ENABLE
./gmail-labeler.pl
vi ~/.gmail-labelerrc
./gmail-labeler.pl
./gmail-labeler.pl -f /path/to/gmail-labelerrc
./gmail-labeler.pl -l
./gmail-labeler.pl -i 1234567890abcdef -a "newlabel" -r "INBOX"
./gmail-labeler.pl -i 1234567890abcdef -a "label1,label2"
./gmail-labeler.pl -d -i 1234567890abcdef -a "newlabel"
./gmail-labeler.pl -p mysuperawesomepassphrase
Default configuration file is ~/.gmail-labelerrc, but you may specify it as an argument.
- API client ID
- API client secret
- Where to save google token
- Encrypted token passphrase (make this unique as it's cleartext)
- Path to logfile
- Path to failure log
- Print out debug messages. Default is 0.