3 # unused. was in a mail archiving script, but its too slow.
5 from email
.parser
import BytesParser
, Parser
6 from email
.policy
import default
7 from pathlib
import Path
8 from email
.utils
import mktime_tz
, parsedate_tz
10 with
open(sys
.argv
[1], 'rb') as fp
:
11 headers
= BytesParser(policy
=default
).parse(fp
)
12 print(mktime_tz(parsedate_tz(headers
['date'])))