Skip to content
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

Date parsing error #13

Closed
saxx opened this issue Jun 20, 2014 · 4 comments
Closed

Date parsing error #13

saxx opened this issue Jun 20, 2014 · 4 comments

Comments

@saxx
Copy link

saxx commented Jun 20, 2014

I stumble over this exception a few times a day:

System.ArgumentException: Could not parse date: The added or subtracted value results in an un-representable DateTime.
Parameter name: value. Input was: "from 213.30.242.172:51773 by cmpweb05.aul.t-online.de with HTTP/1.1" ---> System.ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime.
Parameter name: value
   at System.DateTime.AddTicks(Int64 value)
   at OpenPop.Mime.Decode.Rfc2822DateTime.AdjustTimezone(DateTime dateTime, String dateInput)
   at OpenPop.Mime.Decode.Rfc2822DateTime.StringToDate(String inputDate)
   --- End of inner exception stack trace ---
   at OpenPop.Mime.Decode.Rfc2822DateTime.StringToDate(String inputDate)
   at OpenPop.Mime.Header.Received..ctor(String headerValue)
   at OpenPop.Mime.Header.MessageHeader.ParseHeader(String headerName, String headerValue)
   at OpenPop.Mime.Header.MessageHeader.ParseHeaders(NameValueCollection headers)
   at OpenPop.Mime.Message..ctor(Byte[] rawMessageContent, Boolean parseBody)
[... my stuff ...]

I'm not entirely sure, but I think most of the time it's because of some t-online.de e-mail, so I guess they use some kind of corrupted header format? It's always a similar exception, with an IP-address where the date should be.

Is there anything that can be done on the side of OpenPOP or do I have to continue ignoring these corrupted e-mails? Thanks!

@foens
Copy link
Owner

foens commented Jun 20, 2014

You can look into the raw email source and see if you can spot a problem, or you could paste the relevant header section here for us to inspect. We need more context in this case, since it seems to parse a wrong header.

@saxx
Copy link
Author

saxx commented Jun 23, 2014

Thanks a lot for your reply - sorry I haven't figured that out myself.

It will take me a few days to add the necessary error-catching logic to our product, but I will get back to you as soon as I can.

@saxx
Copy link
Author

saxx commented Jun 26, 2014

It took me a while until I realized that the problem only happens on a certain client installation of our product. Unfortunately one where I don't have access to the mail inbox or the raw mail.

I implemented a much better error routine to get more details about the mails in question. Unfortunately it will take a few months until the client will update to this new, improved version. So for now there's nothing I can do to deliver more information.

I will close that issue for now and will open a new one as soon as I have more details - sorry for the inconvenience.

@saxx saxx closed this as completed Jun 26, 2014
@foens
Copy link
Owner

foens commented Jun 26, 2014

Fair enough. Thanks for looking into the issue 👍

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