Dancer-SearchApp

 view release on metacpan or  search on metacpan

lib/Mail/Email/IMAP.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use strict;
use Scalar::Util qw(weaken);
use Encode qw(decode);
use HTTP::Date qw( time2isoz );
#use 5.016; # for fc
 
use Mail::Clean 'clean_subject';
use vars qw($VERSION);
$VERSION = '0.06';
 
sub new {
    my $class = shift;
    bless {
        text_formatter => Text::Markdown->new(),
        @_,
    } => $class;
};
 
sub from_imap_client {
    my ($package, $conn, $uid, %info) = @_;
    #weaken $conn;
     
    my $dt = $conn->date( $uid );
     
    my $timestamp;
    if( $dt ) {
        $dt =~ s!\s*\(([A-Z]+.*?)\)\s*$!!; # strip clear name of timezone at end
        $dt =~ s!\s*$!!; # Strip whitespace at end
        $dt =~ s!\bUTC$!GMT!; # "UTC" -> "GMT", ah, well...
         
        # Let's be lenient about the time format:



( run in 0.219 second using v1.01-cache-2.11-cpan-55f5a4728d2 )