aerc/worker/lib
Thomas Faughnan 5ed849688a parse: remove trailing whitespace from rfc1123z regex
When there is no Date header in a message, aerc falls back to the
Received header and tries to extract an rfc1123z date from it
(introduced in commit d1600e46). The current regex for extracting the
date incorrectly allows for trailing whitespace, causing time.Parse() to
fail inside of parseReceivedHeader(). As a result, the message's date is
shown as "???????????????????" in the message list and as
"0000-12-31 07:03 PM" in the message view (the latter is likely related
to the zero value of time.Time).

Steps to reproduce:
1) Send yourself a message with no Date header, e.g. with msmtp:
printf 'Subject: foo bar\n\nbody text\n' | msmtp --set-date-header=off me@example.com
2) Note the message's displayed date in aerc's message list and message
   view.

Signed-off-by: Thomas Faughnan <tom@tjf.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-22 15:46:56 +02:00
..
testdata/message parse: fix content-type parsing error 2022-06-07 16:19:27 +02:00
parse.go parse: remove trailing whitespace from rfc1123z regex 2022-08-22 15:46:56 +02:00
parse_test.go go: removed io/ioutil 2022-08-22 09:30:19 +02:00
search.go go: removed io/ioutil 2022-08-22 09:30:19 +02:00
sort.go lint: homogenize operations and minor fixes (gocritic) 2022-08-04 21:58:01 +02:00