INSTALL | 9 +++++---- Makefile.PL | 1 - TODO | 4 ---- ci/deps.perl | 2 +- lib/PublicInbox/Admin.pm | 2 +- lib/PublicInbox/MDA.pm | 5 ++--- diff --git a/INSTALL b/INSTALL index a6ca77723d5d7eac12077af4e9987889fbf70c39..137c9a54b1601dc6e0d75a29e5c9ff7816062204 100644 --- a/INSTALL +++ b/INSTALL @@ -32,10 +32,6 @@ * SpamAssassin (spamc/spamd) (for public-inbox-watch/public-inbox-mda) Beyond that, there is a long list of Perl modules required, starting with: -* Date::Parse deb: libtimedate-perl - pkg: p5-TimeDate - rpm: perl-TimeDate - * Digest::SHA typically installed with Perl rpm: perl-Digest-SHA @@ -80,6 +76,11 @@ - Inline::C[7] deb: libinline-c-perl pkg: pkg-Inline-C (speeds up process spawning on Linux, see public-inbox-daemon(8)) + +- Date::Parse deb: libtimedate-perl + pkg: p5-TimeDate + rpm: perl-TimeDate + (for broken, mostly historical emails) - Plack::Middleware::ReverseProxy deb: libplack-middleware-reverseproxy-perl pkg: p5-Plack-Middleware-ReverseProxy diff --git a/Makefile.PL b/Makefile.PL index c4495c4f9325bac163ad902ef8206a3d723bf827..5faced6389bf3e5f2172c59b3a4b6ddf48cbec7f 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -110,7 +110,6 @@ PREREQ_PM => { # note: we use spamc(1), NOT the Perl modules # We also depend on git. # Keep this sorted and synced to the INSTALL document - 'Date::Parse' => 0, # libperl$PERL_VERSION, # `perl5' on FreeBSD diff --git a/TODO b/TODO index 369fc56ed92b4bbb8c0ebdb1bf850a832d33f360..0e31e6d766b54a5ca8e14315ee2de028ebf7b3e0 100644 --- a/TODO +++ b/TODO @@ -110,10 +110,6 @@ * imperfect scraper importers for obfuscated list archives (e.g. obfuscated Mailman stuff, Google Groups, etc...) -* consider using HTTP::Date instead of Date::Parse, since we need the - former is capable of parsing RFC822-ish dates, used by Plack, and - the latter is missing from OpenBSD and maybe other distros. - * improve performance and avoid head-of-line blocking on slow storage * share "git cat-file --batch" processes across inboxes to avoid diff --git a/ci/deps.perl b/ci/deps.perl index ae6083b99cd27a2b3bc6b2b5f78d9962082e4703..330ba2f32fa43140bcde89733093afbb8bc1acfb 100755 --- a/ci/deps.perl +++ b/ci/deps.perl @@ -19,7 +19,6 @@ # and we don't need that for mda-only installs essential => [ qw( git perl - Date::Parse Devel::Peek Digest::SHA Email::Simple @@ -34,6 +33,7 @@ ), @test_essential ], # everything optional for normal use optional => [ qw( + Date::Parse BSD::Resource DBD::SQLite DBI diff --git a/lib/PublicInbox/Admin.pm b/lib/PublicInbox/Admin.pm index dddeeae94efc8763100b565e21f4d934d3eec5d4..3d0d80b92003347771b135cbeab47c6444d510c5 100644 --- a/lib/PublicInbox/Admin.pm +++ b/lib/PublicInbox/Admin.pm @@ -136,7 +136,7 @@ @ibxs; } # TODO: make Devel::Peek optional, only used for daemon -my @base_mod = qw(Email::MIME Date::Parse Devel::Peek); +my @base_mod = qw(Email::MIME Devel::Peek); my @over_mod = qw(DBD::SQLite DBI); my %mod_groups = ( -index => [ @base_mod, @over_mod ], diff --git a/lib/PublicInbox/MDA.pm b/lib/PublicInbox/MDA.pm index b0dfac4564cfe12425a1ece5d31caa06f63069d4..ef5e7dfa1f271bb339e6da860871660515a5e4a0 100644 --- a/lib/PublicInbox/MDA.pm +++ b/lib/PublicInbox/MDA.pm @@ -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 @@ defined($str) && length($str) >= $len; } sub usable_date { - my @t = eval { strptime(@_) }; - scalar @t; + defined(eval { PublicInbox::MsgTime::str2date_zone($_[0]) }); } sub alias_specified {