jarrodparkes / mbox-to-csv

Python script for converting MBOX files to CSV.
87 stars 31 forks source link

Hangouts chat time & chat ID #17

Closed ke4roh closed 4 years ago

ke4roh commented 4 years ago

Google Hangouts chat doesn't have time in the regular header, but only in the email._from header. This change falls back to the date in _from when the usual one is absent, and it includes the Hangouts chat ID in the "To" field (when there is nothing else there) so that the chats can be assembled into conversations. The regular "From" header is informative about chat.

Here's an example chat record:

From 6803175121078017139@xxx Thu May 28 15:08:30 +0000 2020
X-GM-THRID: 8689061491205804398
X-Gmail-Labels: lorem,ipsum
From: Jim Scarborough <ke4roh@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain

Lorem ipsum dolor st amit
jarrodparkes commented 4 years ago

incorporating this change in #18