thunderbird / thunderbird-android

Thunderbird for Android – Open Source Email App for Android (fka K-9 Mail)
https://thunderbird.net/
Apache License 2.0
10.52k stars 2.49k forks source link

Badly formatted MIME prevents email from syncing #1959

Closed vsound99 closed 7 years ago

vsound99 commented 7 years ago

Expected behavior

New e-mail should show in Inbox

Actual behavior

Get an "IllegalArgumentException" error

Steps to reproduce

  1. Check Mail

Environment

K-9 Mail version: 5.201

Android version: 6.0.1

Account type (IMAP, POP3, WebDAV/Exchange): POP3

This happens on all of my accounts after the new K-9 Mail update.

philipwhiuk commented 7 years ago

If you enable debugging in the app is there are corresponding 'email' in the k9mail-errors folder for the account.

Can you provide the content of that 'email'.

vsound99 commented 7 years ago

K9-Mail version: 5.201 Device make: samsung Device model: SM-N910P Android version: 6.0.1

java.lang.IllegalArgumentException: The value of 'raw' needs to start with the supplied field name followed by a colon at com.fsck.k9.mail.internet.MimeHeader$Field.newRawField(MimeHeader.java:174) at com.fsck.k9.mail.internet.MimeHeader.addRawHeader(MimeHeader.java:41) at com.fsck.k9.mail.internet.MimeMessage.addRawHeader(MimeMessage.java:390) at com.fsck.k9.mail.internet.MimeMessage$MimeMessageBuilder.field(MimeMessage.java:581) at org.apache.james.mime4j.parser.MimeStreamParser.parse(MimeStreamParser.java:153) at com.fsck.k9.mail.internet.MimeMessage.parse(MimeMessage.java:107) at com.fsck.k9.mail.internet.MimeMessage.parse(MimeMessage.java:77) at com.fsck.k9.mail.store.pop3.Pop3Store$Pop3Folder.fetchBody(Pop3Store.java:951) at com.fsck.k9.mail.store.pop3.Pop3Store$Pop3Folder.fetch(Pop3Store.java:816) at com.fsck.k9.controller.MessagingController.downloadSmallMessages(MessagingController.java:1393) at com.fsck.k9.controller.MessagingController.downloadMessages(MessagingController.java:1196) at com.fsck.k9.controller.MessagingController.synchronizeMailboxSynchronous(MessagingController.java:953) at com.fsck.k9.controller.MessagingController$9.run(MessagingController.java:739) at com.fsck.k9.controller.MessagingController.runInBackground(MessagingController.java:204) at com.fsck.k9.controller.MessagingController.access$000(MessagingController.java:115) at com.fsck.k9.controller.MessagingController$1.run(MessagingController.java:173) at java.lang.Thread.run(Thread.java:818)

Joe Vaccaro

From: Philip [mailto:notifications@github.com] Sent: Wednesday, January 04, 2017 9:07 AM To: k9mail/k-9 Cc: vsound99; Author Subject: Re: [k9mail/k-9] Can't get email after 5.201 update (#1959)

If you enable debugging in the app is there are corresponding 'email' in the k9mail-errors folder for the account.

Can you provide the content of that 'email'.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/k9mail/k-9/issues/1959#issuecomment-270377863 , or mute the thread https://github.com/notifications/unsubscribe-auth/AXwukCRVL5vgIgWe8bQTfSgnczLko_o2ks5rO6dvgaJpZM4Lalnj . https://github.com/notifications/beacon/AXwukCjEZuwL382ULMmZ9j_tFQlD1U5Oks5rO6dvgaJpZM4Lalnj.gif

philipwhiuk commented 7 years ago

Thanks! Looks like there's something wrong with one specific message's header. Could you provide the source of the (first?) message that isn't being displayed in K-9?

vsound99 commented 7 years ago

What e-mail message are you referring to?

philipwhiuk commented 7 years ago

One of the emails you have been sent but not received in K-9 has an invalid header. I suspect it's the earliest one that hasn't arrived.

vsound99 commented 7 years ago

I deleted some emails through my webmail on my pc and then checked my mail on my phone in k9 mail. Working fine now. Thanks.

-------- Original Message -------- From: Philip notifications@github.com Sent: January 4, 2017 10:52:21 AM EST To: k9mail/k-9 k-9@noreply.github.com Cc: vsound99 joevaccaro@vsoundproductions.com, Author author@noreply.github.com Subject: Re: [k9mail/k-9] Can't get email after 5.201 update (#1959)

One of the emails you have been sent but not received in K-9 has an invalid header. I suspect it's the earliest one that hasn't arrived.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/k9mail/k-9/issues/1959#issuecomment-270404839

philipwhiuk commented 7 years ago

I wonder if it would be smarter to just log and drop bad single fields rather than block sync. No it's not standards-compliant but breaking someone's email because one spammer is bad is not great.

cketti commented 7 years ago

I'd rather mark the message as "unable to parse" and skip it. We should have enough meta data to still show it in the message list so users can delete it.

steveday72 commented 7 years ago

I'm also having the same problem frequently.

I have signed up to GitHub just to report this annoying issue. I'm sure the messages are coming from a single spammer - which sends me one about every other day. They prevent me from syncing/checking my email until I log into the webmail app, track down the offending email (sometimes a lengthy process, as I receive 200-300 spams per day) and delete them manually.

Two emails are attached which caused the error. They both verified as being MIME compliant via the online tool at mimevalidator.net

k9-problem-email-1.txt k9-problem-email-2.txt

philipwhiuk commented 7 years ago

@steveday72 Neither of those are the email source :(. They are just links to emails behind a login.

steveday72 commented 7 years ago

I've never used GitHub before, but managed to find where I could pull the latest build (5.203) and install it. I used my webmail site to copy the problem emails back into the inbox. The new installation downloaded/synced them without a problem. The syncing process seemed a little faster too (watching the message numbers compared to before).

Thank you for fixing it!

Philipwhiuk - I used the GitHub message composer (the same one I'm using to reply here) to attach the files from my tablet. It uploaded them and worked when I clicked on them.

philipwhiuk commented 7 years ago

All I get is a file with https://mail4.hostica.com/horde/imp/view.php?popup_view=1&mailbox=INBOX.Problem-Mails&index=2&actionID=view_source&id=0&mimecache=90ffdf912a4cb70f741b0d9c5b27d184 :(

steveday72 commented 7 years ago

Fixed them. Sorry.

I assumed that "Sharing" a web page from Chrome->Total Commander would share the content and not just the URL.

Valodim commented 7 years ago

This issue is the same as the one fixed in #1976, it will be fixed when the next bugfix release is out. This is also already released in our alpha channel.