Dancer-SearchApp
view release on metacpan or search on metacpan
lib/Mail/Email/IMAP.pm view on Meta::CPAN
12345678910111213141516171819202122232425262728293031323334353637package
Mail::Email::IMAP;
use
strict;
use
MIME::WordDecoder;
use
MIME::Base64;
use
MIME::QuotedPrint;
use
Text::Markdown ();
use
Time::Piece;
#use 5.016; # for fc
$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 )