]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/MDA.pm
Date::Parse is now optional
[public-inbox.git] / lib / PublicInbox / MDA.pm
index b0dfac4564cfe12425a1ece5d31caa06f63069d4..ef5e7dfa1f271bb339e6da860871660515a5e4a0 100644 (file)
@@ -6,7 +6,7 @@ package PublicInbox::MDA;
 use strict;
 use warnings;
 use Email::Simple;
-use Date::Parse qw(strptime);
+use PublicInbox::MsgTime;
 use constant MAX_SIZE => 1024 * 500; # same as spamc default, should be tunable
 use constant MAX_MID_SIZE => 244; # max term size - 1 in Xapian
 
@@ -51,8 +51,7 @@ sub usable_str {
 }
 
 sub usable_date {
-       my @t = eval { strptime(@_) };
-       scalar @t;
+       defined(eval { PublicInbox::MsgTime::str2date_zone($_[0]) });
 }
 
 sub alias_specified {