line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Gmail::IMAP::Label; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Net::Gmail::IMAP::Label::VERSION = '0.007'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
118260
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
68
|
|
7
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
58
|
|
8
|
2
|
|
|
2
|
|
1192
|
use Net::Gmail::IMAP::Label::Proxy; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
72
|
|
9
|
2
|
|
|
2
|
|
2141
|
use Getopt::Long::Descriptive; |
|
2
|
|
|
|
|
140944
|
|
|
2
|
|
|
|
|
18
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub import { |
12
|
2
|
|
|
2
|
|
25
|
my ($class, @opts) = @_; |
13
|
2
|
50
|
33
|
|
|
32
|
return unless (@opts == 1 && $opts[0] eq 'run'); |
14
|
0
|
|
|
|
|
0
|
$class->run; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub run { |
18
|
1
|
|
|
1
|
0
|
1929
|
my ($opts, $usage) = describe_options( |
19
|
|
|
|
|
|
|
"$0 %o", |
20
|
1
|
|
|
|
|
14
|
[ '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
|
50
|
|
|
|
1084
|
if($opts->help) { |
26
|
1
|
|
|
|
|
29
|
print($usage->text); |
27
|
1
|
|
|
|
|
249
|
return 1; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
Net::Gmail::IMAP::Label::Proxy->new(localport => $opts->port, verbose => $opts->verbose)->run(); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
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. |
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 directory. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 SEE ALSO |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
See L for a complete listing of options. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 BUGS |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Report bugs and submit patches to the repository on L. |
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 for pointing out the |
91
|
|
|
|
|
|
|
Gmail IMAP extensions. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=cut |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
# vim:ts=4:sw=4 |