| 1 | package Net::Gmail::IMAP::Label; | ||||||||||||||||||||||||||||
| 2 | { | ||||||||||||||||||||||||||||
| 3 | 2 | $Net::Gmail::IMAP::Label::VERSION = '0.007'; | |||||||||||||||||||||||||||
| 4 | } | ||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use Net::Gmail::IMAP::Label::Proxy; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 2 | ▶ | use Getopt::Long::Descriptive; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | sub import { | ||||||||||||||||||||||||||||
| 12 | 2 | ▶ | my ($class, @opts) = @_; | ||||||||||||||||||||||||||
|
Subroutine
import: called CC=3 SCAR=14.2
| |||||||||||||||||||||||||||||
| 13 | 2 | ▶ | return unless (@opts == 1 && $opts[0] eq 'run'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
@opts == 1 and $opts[0] eq "run"
MC/DC0%0/2
@opts == 1 and $opts[0] eq "run"
@opts == 1
$opts[0] eq "run"
Truth table33%1/3
A and B
A= @opts == 1B= $opts[0] eq "run"
| |||||||||||||||||||||||||||||
| 14 | 0 | $class->run; | |||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | sub run { | ||||||||||||||||||||||||||||
| 18 | 1 | ▶ | my ($opts, $usage) = describe_options( | ||||||||||||||||||||||||||
|
Subroutine
run: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||||||||||||||||||||
| 19 | "$0 %o", | ||||||||||||||||||||||||||||
| 20 | 1 | [ 'port|p=i', "local port to connect to (default: @{[Net::Gmail::IMAP::Label::Proxy::DEFAULT_LOCALPORT]})", { default => Net::Gmail::IMAP::Label::Proxy::DEFAULT_LOCALPORT } ], | |||||||||||||||||||||||||||
| 21 | [ 'verbose|v+', "increase verbosity (multiple flags for more verbosity)" , { default => 0 } ], | ||||||||||||||||||||||||||||
| 22 | [ 'help|h|?', "print usage message and exit" ], | ||||||||||||||||||||||||||||
| 23 | ); | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 1 | ▶ | if($opts->help) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 26 | 1 | print($usage->text); | |||||||||||||||||||||||||||
| 27 | 1 | return 1; | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 0 | Net::Gmail::IMAP::Label::Proxy->new(localport => $opts->port, verbose => $opts->verbose)->run(); | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 2 | 1; | |||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | =head1 NAME | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | Net::Gmail::IMAP::Label - IMAP proxy for Google's Gmail that retrieves message labels | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | gmail-imap-label [OPTION]... | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | This module provides a proxy that sits between an IMAP client and Gmail's IMAPS | ||||||||||||||||||||||||||||
| 46 | server and adds GMail labels to the X-Label header. This proxy uses the | ||||||||||||||||||||||||||||
| 47 | L<Gmail IMAP extensions|http://code.google.com/apis/gmail/imap/#x-gm-labels>. | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | To use this proxy, your e-mail client will need to connect to the proxy using | ||||||||||||||||||||||||||||
| 50 | the IMAP protocol (without SSL). | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | =head1 EXAMPLES | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | The simplest way of starting is to run the proxy on the default port of 10143: | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | gmail-imap-label | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | An alternative port can be specified using the B<--port> option | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | gmail-imap-label --port 993 | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | The proxy has been tested with both mutt (v1.5.21) and offlineimap (v6.3.4). | ||||||||||||||||||||||||||||
| 63 | Example configuration files for these are available in the C<doc> directory. | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | =head1 SEE ALSO | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | See L<gmail-imap-label> for a complete listing of options. | ||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | =head1 BUGS | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | Report bugs and submit patches to the repository on L<Github|https://github.com/zmughal/gmail-imap-label>. | ||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | Copyright 2011 Zakariyya Mughal. | ||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | This program is free software; you can redistribute it and/or | ||||||||||||||||||||||||||||
| 78 | modify it under the terms of either: | ||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | =over 4 | ||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | =item * the ISC license, or | ||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | =item * the Artistic License version 2.0. | ||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | =back | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | =head1 ACKNOWLEDGMENTS | ||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | Thanks to L<Paul DeCarlo|http://windotnet.blogspot.com/> for pointing out the | ||||||||||||||||||||||||||||
| 91 | Gmail IMAP extensions. | ||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||
| 93 | =cut | ||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | # vim:ts=4:sw=4 | ||||||||||||||||||||||||||||