This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git

commit a0810e9c864af88e37f2f1f3def28df4d9ee9d14
Author: Sebb <[email protected]>
AuthorDate: Thu Mar 12 15:59:17 2026 +0000

    Allow for missing Date header
---
 tools/mboxhdr2csv.rb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/mboxhdr2csv.rb b/tools/mboxhdr2csv.rb
index e093ee25..974160db 100644
--- a/tools/mboxhdr2csv.rb
+++ b/tools/mboxhdr2csv.rb
@@ -186,7 +186,9 @@ module MailUtils
       next if email.end_with? '/index'
       message = IO.read(email, mode: 'rb')
       data = {}
-      data[DATE] = Time.parse(message[/^Date: (.*)/, 1]).iso8601
+      date = message[/^Date: (.*)/, 1]
+      date = message[/^From \S+ +(.+)/,1] unless date # Use envelope date if 
necessary
+      data[DATE] = Time.parse(date).iso8601
       data[FROM] = message[/^From: (.*)/, 1]
       # Originally (before 2265343) the local method #find_who_from expected 
an email address and returned who, committer
       # Emulate this with the version from MailUtils which expects and updates 
a hash

Reply via email to