From 35ac61764499c272d2760de2b2a432be412ecede Mon Sep 17 00:00:00 2001 From: "Eric Wong (Contractor, The Linux Foundation)" Date: Tue, 6 Mar 2018 04:15:38 +0000 Subject: favor Received: date over Date: header globally The first Received: header is believable since it typically hits the user's mail server and can be treated as relatively trustworthy. We still show the Date: in per-message (permalink) views, which may expose users for having incorrect Date: headers, but all the ISO YYYY-MM-DD dates we display will match what we see. --- lib/PublicInbox/SearchMsg.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/SearchMsg.pm') diff --git a/lib/PublicInbox/SearchMsg.pm b/lib/PublicInbox/SearchMsg.pm index a62a6490..23478a2a 100644 --- a/lib/PublicInbox/SearchMsg.pm +++ b/lib/PublicInbox/SearchMsg.pm @@ -7,9 +7,9 @@ package PublicInbox::SearchMsg; use strict; use warnings; use Search::Xapian; -use Date::Parse qw/str2time/; use PublicInbox::MID qw/mid_clean mid_mime/; use PublicInbox::Address; +use PublicInbox::MsgTime qw(msg_timestamp); sub new { my ($class, $mime) = @_; @@ -117,7 +117,9 @@ sub from_name { sub ts { my ($self) = @_; - $self->{ts} ||= eval { str2time($self->{mime}->header('Date')) } || 0; + $self->{ts} ||= eval { + msg_timestamp($self->{mime}->header_obj); + } || 0; } sub to_doc_data { -- cgit v1.2.3-24-ge0c7