Skip to content

MSG read error This was probably caused by the time stamp being too far in the future. #427

@ragebear00

Description

@ragebear00

Bug Metadata
*Version of extract_msg: [0.48.7]
*Your python version: Python [3.10]
*How did you launch extract_msg?
def outlook_meta(filename):
try:
msg = extract_msg.openMsg(filename, errorBehavior = extract_msg.enums.ErrorBehavior.SUPPRESS_ALL) #filename including path https://msg-extractor.readthedocs.io/en/stable/extract_msg.html
meta = "Subject:" + str(msg.subject) + " PERSON: From: " + str(msg.sender) + " To: " + str(msg.to)
if str(msg.cc) != "None": meta += " CC: " + str(msg.cc)
print(meta)
msg.close()
return (meta)
except Exception as e:
print("=================================Error Extract_Msg Person==================")
try:
msg.close()
except:
pass
return ("Error to Read File "+ str(e))

Describe the bug
[2024-08-02 07:28:06,394] [ ERROR] prop.py:201 - b'@\x00\x03\x80\x06\x00\x00\x00\x00\xcc\x0b\xf1\xbc\xff\xff\x1f'
Traceback (most recent call last):
File "C:\Users\z\AppData\Local\Programs\Python\Python310\lib\site-packages\extract_msg\utils.py", line 295, in filetimeToDatetime
return fromTimeStamp(filetimeToUtc(rawTime))
File "C:\Users\z\AppData\Local\Programs\Python\Python310\lib\site-packages\extract_msg\utils.py", line 347, in fromTimeStamp
return datetime.datetime.fromtimestamp(stamp, tz)
OSError: [Errno 22] Invalid argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\z\AppData\Local\Programs\Python\Python310\lib\site-packages\extract_msg\properties\prop.py", line 199, in _parseType
value = filetimeToDatetime(rawTime)
File "C:\Users\z\AppData\Local\Programs\Python\Python310\lib\site-packages\extract_msg\utils.py", line 300, in filetimeToDatetime
raise ValueError(f'Timestamp value of {filetimeToUtc(rawTime)} caused an exception. This was probably caused by the time stamp being too far in the future.')
ValueError: Timestamp value of 218939798520.0 caused an exception. This was probably caused by the time stamp being too far in the future.
[2024-08-02 07:28:06,472] [ ERROR] prop.py:201 - b'@\x00\x03\x80\x06\x00\x00\x00\x00\xcc\x0b\xf1\xbc\xff\xff\x1f'
Traceback (most recent call last):
File "C:\Users\z\AppData\Local\Programs\Python\Python310\lib\site-packages\extract_msg\utils.py", line 295, in filetimeToDatetime
return fromTimeStamp(filetimeToUtc(rawTime))
File "C:\Users\z\AppData\Local\Programs\Python\Python310\lib\site-packages\extract_msg\utils.py", line 347, in fromTimeStamp
return datetime.datetime.fromtimestamp(stamp, tz)
OSError: [Errno 22] Invalid argument

Additional context
The msg was send in 2010, so not in the future. It is not the isolated case, many msgs exported from this user raise the same flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions