Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ragebear00 opened this issue Aug 1, 2024 · 4 comments

Comments

@ragebear00
Copy link

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.

@TheElementalOfDestruction
Copy link
Collaborator

It actually is from it being too far in the future, but it's a specific property that is too far. Let me write a quick patch to try and fix this

@TheElementalOfDestruction
Copy link
Collaborator

When I say fix this, I mean the date provided is far beyond any of the known null dates, so I'm going to see if this number is meaningful in any way, and if not just make it so that null dates are formed for numbers beyond a certain point

TheElementalOfDestruction added a commit that referenced this issue Aug 2, 2024
@TheElementalOfDestruction
Copy link
Collaborator

I've added a fix for this on the next-release branch. Feel free to test it, but it will be in the 0.49.0 update

@TheElementalOfDestruction
Copy link
Collaborator

Fixed in version 0.49.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants