-
-
Notifications
You must be signed in to change notification settings - Fork 178
Description
Bug Metadata
- Version of extract_msg:
0.53.1(and previous versions: 0.49.0, 046.2) - Your python version: Python
3.10.14and3.11.9 - How did you launch extract_msg?
- My command line
Describe the bug
A clear and concise description of what the bug is.
When parsing a .msg file on the command line, we saw the error traceback documented below. This issue appears related to #427.
**What code did you use or can we use to reproduce this error?
I can't share the .msg file, so hopefully the traceback is sufficient
Traceback
Traceback (most recent call last):
File "~/.local/share/mise/installs/pipx-extract-msg/0.53.1/extract-msg/lib/python3.10/site-packages/extract_msg/properties/prop.py", line 199
, in _parseType
value = filetimeToDatetime(rawTime)
File "~/.local/share/mise/installs/pipx-extract-msg/0.53.1/extract-msg/lib/python3.10/site-packages/extract_msg/utils.py", line 308, in filet
imeToDatetime
raise ValueError(f'Timestamp value of {filetimeToUtc(rawTime)} (raw: {rawTime}) caused an exception. This was probably caused by the time stamp being too
far in the future.')
ValueError: Timestamp value of 910692730085.4775 (raw: 9223372036854775807) caused an exception. This was probably caused by the time stamp being too far in
the future.
2025-03-13 20:54:56,019 - extract_msg.properties.prop - ERROR - b'@\x00\x1c0\x06\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\x7f'
Traceback (most recent call last):
File "~/.local/share/mise/installs/pipx-extract-msg/0.53.1/extract-msg/lib/python3.10/site-packages/extract_msg/utils.py", line 298, in filet
imeToDatetime
date += datetime.timedelta(seconds = filetimeToUtc(rawTime))
OverflowError: date value out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "~/.local/share/mise/installs/pipx-extract-msg/0.53.1/extract-msg/lib/python3.10/site-packages/extract_msg/properties/prop.py", line 199
, in _parseType
value = filetimeToDatetime(rawTime)
File "~/.local/share/mise/installs/pipx-extract-msg/0.53.1/extract-msg/lib/python3.10/site-packages/extract_msg/utils.py", line 308, in filet
imeToDatetime
raise ValueError(f'Timestamp value of {filetimeToUtc(rawTime)} (raw: {rawTime}) caused an exception. This was probably caused by the time stamp being too
far in the future.')
ValueError: Timestamp value of 910692730085.4775 (raw: 9223372036854775807) caused an exception. This was probably caused by the time stamp being too far in
the future.
Screenshots
N/A
Additional context
Thank you for building and maintaining this library! Let me know if there is any additional information that I can provide
Attempted Fix
I tried exploring the code base and adding a new unit test, but I can't trigger the same failure. I can confirm that adding a try/except for OverflowError to return constants.NULL_DATE passes our internal testing.
Without changes, I was able to add the below test case to extract_msg_tests/prop_tests.py and have the test suite pass, but not raise an error, so maybe there is something wrong about the initial binary?
(
'OverFlow Error?',
b'@\x00\x1c0\x06\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\x7f', # Copied from traceback
b'@\x00\x1c0\x06\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\x7f',
FixedLengthProp,
'301C0040', # retentionDate?
0x0040,
PropertyFlags.READABLE|PropertyFlags.WRITABLE,
b'\xff\xff\xff\xff\xff\xff\xff\x7f'
),
``