Sicos1977 / MSGReader

C# Outlook MSG file reader without the need for Outlook
http://sicos1977.github.io/MSGReader
MIT License
493 stars 168 forks source link

System.ArgumentOutOfRangeException for DateTime.MinValue #411

Closed DCdeVilliers closed 5 months ago

DCdeVilliers commented 5 months ago

System.ArgumentOutOfRangeException: The UTC time represented when the offset is applied must be between year 0 and 10,000. (Parameter 'offset') at System.DateTimeOffset.ValidateDate(DateTime dateTime, TimeSpan offset) at System.DateTimeOffset.op_Implicit(DateTime dateTime) at MsgReader.Mime.Header.Received..ctor(String headerValue) at MsgReader.Mime.Header.MessageHeader.ParseHeader(String headerName, String headerValue) at MsgReader.Mime.Header.MessageHeader.ParseHeaders(NameValueCollection headers) at MsgReader.Mime.Header.HeaderExtractor.ExtractHeadersAndBody(Byte[] fullRawMessage, MessageHeader& headers, Byte[]& body) at MsgReader.Mime.Message.ParseContent(Byte[] rawMessageContent, Boolean parseBody, Boolean parseHeaders) at MsgReader.Mime.Message..ctor(Byte[] rawMessageContent, Boolean parseBody) at MsgReader.Mime.Message..ctor(Byte[] rawMessageContent) at MsgReader.Mime.Message.Load(Stream messageStream) at MsgReader.Reader.ExtractToFolder(String inputFile, String outputFolder, ReaderHyperLinks hyperlinks, Nullable`1 messageType, Stream logStream, Boolean includeReactionsInfo)

Sicos1977 commented 5 months ago

Can you send me the EML file that is giving this error? If so, then please ZIP it before sending it to sicos2002@hotmail.com

My first guess is that there is an invalid date somewhere in the EML file.

DCdeVilliers commented 5 months ago

Can you send me the EML file that is giving this error? If so, then please ZIP it before sending it to sicos2002@hotmail.com

My first guess is that there is an invalid date somewhere in the EML file.

Thank you for your prompt response.

I am unfortunately unable to provide you with the EML file, as this exception occurred on a customer's EML file upon communicating with my API, and I do not have access to the customer's data.

My apologies for not being able to assist in this regard.

Sicos1977 commented 5 months ago

Without something to debug I'm closing your issue. I can't fix something if I don't know what is going wrong.

Sicos1977 commented 5 months ago

Should be fixed in version 5.6.2 . Somebody else did sent me a example message that was giving the exact same error.