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

Unparseable dates should be handled more gracefully #8714

Open
2 tasks done
gregrenda opened this issue Jan 3, 2025 · 2 comments
Open
2 tasks done

Unparseable dates should be handled more gracefully #8714

gregrenda opened this issue Jan 3, 2025 · 2 comments
Labels
type: bug Something is causing incorrect behavior or errors unconfirmed Newly reported issues awaiting triage or confirmation

Comments

@gregrenda
Copy link

gregrenda commented Jan 3, 2025

Checklist

  • I have used the search function to see if someone else has already submitted the same bug report.
  • I will describe the problem with as much detail as possible.

App

K-9 Mail

App version

8.2

Where did you get the app from?

Google Play

Android version

14

Device model

AGM_PAD_P2

Steps to reproduce

Attempt to retrieve a message with an unparseable date.

Expected behavior

Ideally, the message will be retrieved and displayed with some indication of the problem. At a minimum, the message should be ignored.

Actual behavior

An exception is thrown and none of the retrieved messages are displayed.

Logs

01-03 10:59:35.108 14049 14074 E ImapSync: synchronizeMailbox
01-03 10:59:35.108 14049 14074 E ImapSync: com.fsck.k9.mail.MessagingException: Unable to parse IMAP datetime 'Tue, 31 Dec 2024 23:00:02 +9900' 
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.mail.store.imap.ImapList.getDate(ImapList.java:86)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.mail.store.imap.ImapList.getKeyedDate(ImapList.java:76)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.mail.store.imap.RealImapFolder.handleFetchResponse(RealImapFolder.kt:760)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.mail.store.imap.RealImapFolder.fetch(RealImapFolder.kt:623)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.backend.imap.ImapSync.fetchUnsyncedMessages(ImapSync.kt:461)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.backend.imap.ImapSync.downloadMessages(ImapSync.kt:331)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.backend.imap.ImapSync.synchronizeMailboxSynchronous(ImapSync.kt:203)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.backend.imap.ImapSync.sync(ImapSync.kt:34)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.backend.imap.ImapBackend.sync(ImapBackend.kt:56)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.controller.MessagingController.syncFolder(MessagingController.java:638)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.controller.MessagingController.synchronizeMailboxSynchronous(MessagingController.java:578)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.controller.MessagingController.loadMoreMessagesSynchronous(MessagingController.java:542)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.controller.MessagingController.lambda$loadMoreMessages$4(MessagingController.java:526)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.controller.MessagingController.$r8$lambda$R4JompHX5lAPJKWcyY6ODgWeMTs(MessagingController.java:0)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.controller.MessagingController$$ExternalSyntheticLambda21.run(R8$$SyntheticClass:0)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.controller.MessagingController.runInBackground(MessagingController.java:221)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.controller.MessagingController.-$$Nest$mrunInBackground(MessagingController.java:0)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.controller.MessagingController$1.run(MessagingController.java:162)
01-03 10:59:35.108 14049 14074 E ImapSync:      at java.lang.Thread.run(Thread.java:1012)
01-03 10:59:35.108 14049 14074 E ImapSync: Caused by: java.text.ParseException: Unparseable date: "Tue, 31 Dec 2024 23:00:02 +9900"
01-03 10:59:35.108 14049 14074 E ImapSync:      at java.text.DateFormat.parse(DateFormat.java:400)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.mail.store.imap.ImapList.parseDate(ImapList.java:157)
01-03 10:59:35.108 14049 14074 E ImapSync:      at com.fsck.k9.mail.store.imap.ImapList.getDate(ImapList.java:84)
01-03 10:59:35.108 14049 14074 E ImapSync:      ... 18 more
01-03 10:59:35.117 14049 14074 E ImapSync: Failed synchronizing folder [email protected]:INBOX @ Fri Jan 03 10:59:35 PST 2025
@gregrenda gregrenda added type: bug Something is causing incorrect behavior or errors unconfirmed Newly reported issues awaiting triage or confirmation labels Jan 3, 2025
@cketti
Copy link
Member

cketti commented Jan 4, 2025

This exception is not about the Date header field of a message. It's the internal date of the IMAP message. See RFC 3501, section 2.3.3.

Not using the proper date format is a bug that should be fixed on the server side. Please inform the operator of your mail server.

@gregrenda
Copy link
Author

I understand that the server is providing an erroneous date. I'm suggesting that rather than essentially silently failing some error indication and workaround could be provided. What if the mail server operator is unable to fix the problem in a timely manner? Then you're stuck unable to read your mail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something is causing incorrect behavior or errors unconfirmed Newly reported issues awaiting triage or confirmation
Projects
None yet
Development

No branches or pull requests

2 participants