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

System.FormatException: Invalid INTERNALDATE format: 00-Jan-0000 00:00:00 +0000 #1236

Closed
zmarkusdev opened this issue Jul 27, 2021 · 2 comments
Labels
compatibility Compatibility with existing software server-bug The bug appears to be in the server

Comments

@zmarkusdev
Copy link

Describe the bug
When fetching from a Domino IMAP4 Server with the version 10.0.1 i occasionaly get the exception documented below.

Platform (please complete the following information):

  • OS: Windows
  • .NET Framework: 4.6.1
  • MailKit Version: 2.9.0

Exception
If you got an exception, please include the exception Message and StackTrace.

System.FormatException: Invalid INTERNALDATE format: 00-Jan-0000 00:00:00 +0000
bei MailKit.Net.Imap.ImapUtils.ParseInternalDate(String text)
bei MailKit.Net.Imap.ImapFolder.d__188.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei MailKit.Net.Imap.ImapFolder.d__189.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei MailKit.Net.Imap.ImapFolder.d__190.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei MailKit.Net.Imap.ImapEngine.d__173.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei MailKit.Net.Imap.ImapCommand.d__83.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei MailKit.Net.Imap.ImapEngine.d__174.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei MailKit.Net.Imap.ImapEngine.d__175.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei MailKit.Net.Imap.ImapFolder.d__230.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei MailKit.Net.Imap.ImapFolder.Fetch(Int32 min, Int32 max, MessageSummaryItems items, CancellationToken cancellationToken)

Protocol Logs
Please include a protocol log (scrubbed of any authentication data), especially
if you got an exception such as Syntax error in XYZ. Unexpected token: ....

S: * OK Domino IMAP4 Server Release 10.0.1FP3 ready Mon, 26 Jul 2021 13:56:27 +0200
C: L00000000 CAPABILITY
S: * CAPABILITY IMAP4rev1 AUTH=PLAIN LITERAL+ QUOTA UIDPLUS
S: L00000000 OK CAPABILITY completed
C: L00000001 AUTHENTICATE PLAIN
S: +
C: ************************************
S: L00000001 OK AUTHENTICATE completed
C: L00000002 CAPABILITY
S: * CAPABILITY IMAP4rev1 AUTH=PLAIN LITERAL+ QUOTA UIDPLUS
S: L00000002 OK CAPABILITY completed
C: L00000003 LIST "" ""
S: * LIST (\Noselect) "\" ""
S: L00000003 OK LIST completed
C: L00000004 LIST "" "INBOX"
S: * LIST (\Noinferiors \HasNoChildren) "\" Inbox
S: L00000004 OK LIST completed
C: L00000005 EXAMINE Inbox
S: * 277 EXISTS
S: * 0 RECENT
S: * OK [UNSEEN 263] Message 263 is first unseen
S: * OK [UIDVALIDITY 36] UIDs valid
S: * OK [UIDNEXT 21234] Predicted next UID
S: * FLAGS (\Flagged \Seen \Answered \Deleted \Draft)
S: * OK [PERMANENTFLAGS ()] No permanent flags permitted
S: L00000005 OK [READ-ONLY] EXAMINE completed
C: L00000006 FETCH 253:277 (UID INTERNALDATE)
S: * 253 FETCH (UID 21093 INTERNALDATE "21-Jul-2021 06:11:32 +0000")
S: * 254 FETCH (UID 21111 INTERNALDATE "21-Jul-2021 12:18:36 +0000")
S: * 255 FETCH (UID 21123 INTERNALDATE "22-Jul-2021 05:03:43 +0000")
S: * 256 FETCH (UID 21124 INTERNALDATE "22-Jul-2021 05:03:53 +0000")
S: * 257 FETCH (UID 21141 INTERNALDATE "22-Jul-2021 08:28:30 +0000")
S: * 258 FETCH (UID 21145 INTERNALDATE "22-Jul-2021 07:15:18 +0000")
S: * 259 FETCH (UID 21149 INTERNALDATE "22-Jul-2021 08:28:36 +0000")
S: * 260 FETCH (UID 21153 INTERNALDATE "22-Jul-2021 11:58:25 +0000")
S: * 261 FETCH (UID 21164 INTERNALDATE "07-Jul-2021 15:35:49 +0000")
S: * 262 FETCH (UID 21173 INTERNALDATE "22-Jul-2021 15:34:32 +0000")
S: * 263 FETCH (UID 21184 INTERNALDATE "23-Jul-2021 08:06:18 +0000")
S: * 264 FETCH (UID 21185 INTERNALDATE "23-Jul-2021 05:02:07 +0000")
S: * 267 FETCH (UID 21197 INTERNALDATE "00-Jan-0000 00:00:00 +0000")
S: * 269 FETCH (UID 21211 INTERNALDATE "26-Jul-2021 06:55:19 +0000")
S: * 270 FETCH (UID 21212 INTERNALDATE "26-Jul-2021 06:05:56 +0000")
S: * 271 FETCH (UID 21213 INTERNALDATE "26-Jul-2021 07:28:01 +0000")
S: * 272 FETCH (UID 21217 INTERNALDATE "26-Jul-2021 08:13:11 +0000")
S: * 273 FETCH (UID 21220 INTERNALDATE "26-Jul-2021 06:15:51 +0000")
S: * 274 FETCH (UID 21225 INTERNALDATE "22-Jul-2021 12:02:32 +0000")
S: * 265 FETCH (UID 21195 INTERNALDATE "00-Jan-0000 00:00:00 +0000")
S: * 268 FETCH (UID 21198 INTERNALDATE "00-Jan-0000 00:00:00 +0000")
S: * 266 FETCH (UID 21196 INTERNALDATE "00-Jan-0000 00:00:00 +0000")
S: * 275 FETCH (UID 21229 INTERNALDATE "26-Jul-2021 09:24:43 +0000")
S: * 276 FETCH (UID 21231 INTERNALDATE "26-Jul-2021 07:40:51 +0000")
S: * 277 FETCH (UID 21233 INTERNALDATE "26-Jul-2021 11:50:25 +0000")
S: L00000006 OK FETCH completed

Additional context
Add any other context about the problem here.

@jstedfast
Copy link
Owner

Yikes, yea, "00-Jan-0000 00:00:00 +0000" is an invalid date. Not sure how Domino ended up having that internal date for the message, but I can look into handling this edge case better and not throwing an exception so that you can still get mail.

Thanks for reporting this.

@jstedfast jstedfast added compatibility Compatibility with existing software server-bug The bug appears to be in the server labels Jul 27, 2021
jstedfast added a commit that referenced this issue Jul 27, 2021
…nValue

Do not throw a FormatException.

Fixes issue #1236
@jstedfast
Copy link
Owner

I plan to make a new release this week which will contain this fix. Keep an eye out for 2.14.0.

Elanis pushed a commit to Elanis/portfolio that referenced this issue Dec 13, 2022
Bumps [MailKit](https://github.com/jstedfast/MailKit) from 2.13.0 to 2.15.0.
<details>
<summary>Changelog</summary>

*Sourced from [MailKit's changelog](https://github.com/jstedfast/MailKit/blob/master/ReleaseNotes.md).*

> ### MailKit 2.15.0 (2021-08-18)
>
> * Use DebugType=full for .NET Framework v4.x. (issue [#1239](jstedfast/MailKit#1239))
> * Updated GMail SSL certificate serial numbers and fingerprints.
> * Small NTLM code improvements.
>
> ### MailKit 2.14.0 (2021-07-28)
>
> * Added support for logging timestamps in the `ProtocolLogger` (see the `LogTimestamps` and `TimestampFormat`
>   properties on `ProtocolLogger`).
> * Added support for automatically redacting user credentials in protocol logs. To enable this, set the
>   `ProtocolLogger.RedactSecrets` property to `true`. (issue [#1174](jstedfast/MailKit#1174))
> * Added the GetMessageSizeAsync() method to the IMailSpool interface.
>   (issue [#1233](jstedfast/MailKit#1233))
> * Added a work-around to the IMAP INTERNALDATE parser to handle invalid dates such as "00-Jan-0000 00:00:00 +0000"
>   which appears in Domino IMAP server responses, likely when the INTERNALDATE value is uninitialized in the database.
>   (issue [#1236](jstedfast/MailKit#1236))
> * Make sure to dispose X509Certificates in .NET >= 4.6.
> * Re-added NTLM as one of the default supported SASL mechanisms.
> * Updated GMail SSL certificate serial numbers and fingerprints.
</details>
<details>
<summary>Commits</summary>

- [`6ff7091`](jstedfast/MailKit@6ff7091) Bumped version to 2.15.0
- [`a645991`](jstedfast/MailKit@a645991) Bump Microsoft.NET.Test.Sdk from 16.10.0 to 16.11.0 ([#1242](jstedfast/MailKit#1242))
- [`caa02b9`](jstedfast/MailKit@caa02b9) NTLM improvements
- [`b206436`](jstedfast/MailKit@b206436) Drop expired GMail SSL certificates
- [`945508f`](jstedfast/MailKit@945508f) Updated GMail SSL certificate serial #'s and fingerprints
- [`e188a02`](jstedfast/MailKit@e188a02) Bump NUnit3TestAdapter from 3.17.0 to 4.0.0 ([#1218](jstedfast/MailKit#1218))
- [`3f54627`](jstedfast/MailKit@3f54627) Use DebugType=full for .NET Framework v4.x
- [`1e34019`](jstedfast/MailKit@1e34019) Bumped version to 2.14.0
- [`ca0751c`](jstedfast/MailKit@ca0751c) If an invalid INTERNALDATE is encountered, just use DateTimeOffset.MinValue
- [`f1323e6`](jstedfast/MailKit@f1323e6) Update GMail SSL certificate info
- Additional commits viewable in [compare view](jstedfast/MailKit@2.13.0...2.15.0)
</details>

<br />

Reviewed-on: https://gitea.dysnomia.studio/elanis/portfolio/pulls/6
Co-authored-by: elanis <elanis@noreply.example.org>
Co-committed-by: elanis <elanis@noreply.example.org>
Elanis pushed a commit to Dysnomia-Studio/dysnomia-website that referenced this issue Jul 14, 2023
Bumps [MailKit](https://github.com/jstedfast/MailKit) from 2.13.0 to 2.15.0.
<details>
<summary>Changelog</summary>

*Sourced from [MailKit's changelog](https://github.com/jstedfast/MailKit/blob/master/ReleaseNotes.md).*

> ### MailKit 2.15.0 (2021-08-18)
>
> * Use DebugType=full for .NET Framework v4.x. (issue [#1239](jstedfast/MailKit#1239))
> * Updated GMail SSL certificate serial numbers and fingerprints.
> * Small NTLM code improvements.
>
> ### MailKit 2.14.0 (2021-07-28)
>
> * Added support for logging timestamps in the `ProtocolLogger` (see the `LogTimestamps` and `TimestampFormat`
>   properties on `ProtocolLogger`).
> * Added support for automatically redacting user credentials in protocol logs. To enable this, set the
>   `ProtocolLogger.RedactSecrets` property to `true`. (issue [#1174](jstedfast/MailKit#1174))
> * Added the GetMessageSizeAsync() method to the IMailSpool interface.
>   (issue [#1233](jstedfast/MailKit#1233))
> * Added a work-around to the IMAP INTERNALDATE parser to handle invalid dates such as "00-Jan-0000 00:00:00 +0000"
>   which appears in Domino IMAP server responses, likely when the INTERNALDATE value is uninitialized in the database.
>   (issue [#1236](jstedfast/MailKit#1236))
> * Make sure to dispose X509Certificates in .NET >= 4.6.
> * Re-added NTLM as one of the default supported SASL mechanisms.
> * Updated GMail SSL certificate serial numbers and fingerprints.
</details>
<details>
<summary>Commits</summary>

- [`6ff7091`](jstedfast/MailKit@6ff7091) Bumped version to 2.15.0
- [`a645991`](jstedfast/MailKit@a645991) Bump Microsoft.NET.Test.Sdk from 16.10.0 to 16.11.0 ([#1242](jstedfast/MailKit#1242))
- [`caa02b9`](jstedfast/MailKit@caa02b9) NTLM improvements
- [`b206436`](jstedfast/MailKit@b206436) Drop expired GMail SSL certificates
- [`945508f`](jstedfast/MailKit@945508f) Updated GMail SSL certificate serial #'s and fingerprints
- [`e188a02`](jstedfast/MailKit@e188a02) Bump NUnit3TestAdapter from 3.17.0 to 4.0.0 ([#1218](jstedfast/MailKit#1218))
- [`3f54627`](jstedfast/MailKit@3f54627) Use DebugType=full for .NET Framework v4.x
- [`1e34019`](jstedfast/MailKit@1e34019) Bumped version to 2.14.0
- [`ca0751c`](jstedfast/MailKit@ca0751c) If an invalid INTERNALDATE is encountered, just use DateTimeOffset.MinValue
- [`f1323e6`](jstedfast/MailKit@f1323e6) Update GMail SSL certificate info
- Additional commits viewable in [compare view](jstedfast/MailKit@2.13.0...2.15.0)
</details>

<br />

Reviewed-on: https://gitea.dysnomia.studio/elanis/dysnomia-website/pulls/9
Co-authored-by: elanis <elanis@noreply.example.org>
Co-committed-by: elanis <elanis@noreply.example.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with existing software server-bug The bug appears to be in the server
Projects
None yet
Development

No branches or pull requests

2 participants