Summary: | Spam filtering breaks HTML / multipart mail headers on POP3 accounts | ||
---|---|---|---|
Product: | [Applications] kmail2 | Reporter: | markuss <kamikazow> |
Component: | filtering | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | 2Kmm, cfeck, lrajchel1981, mrkfbrn, pragma, tomas.bautista, winter |
Priority: | NOR | ||
Version: | 4.8 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.8.1 | |
Sentry Crash Report: | |||
Attachments: | Screenshot |
I can confirm this for 4.8rc2. It's especially annoying when receiving pdf's as I have to decode the base64 code on the command line. I also can confirm this on 4.8rc2. I have been experiencing this also for KDE 4.8 using crm114. I had the impression that an already existing header with "Content-Type: something" is been replaced by kmail with this other one mentioned. I've opted for unsetting the filtering option for the moment. Can't reproduce it here with current version. Can you try again please and attach the filter log for that run? This does not happen every time. But after reactivating my spam filter some days ago (and restricting it on an account with low traffic) today it happens again. So yes, it's reproducable with kmail 4.8.0. But i don't know how to get a filter log. Can someone give me a hint? It still happens with current master. I have enabled filter logs now, will provide one if it comes out. A snippet from the filter log relevant to a message received with broken Content-Type header. The [...] part that I have removed is a sequence of filter rules identical to the previous ones (only From e-mail addresses change). I have selected the message immediately after it appeared in the folder and the contents were correct. Then the mail viewer automatically updated the contents (as they were written to disk, I supposes) with the broken ones. [14:32:20] Evaluating filter rules: (match all of the following) "From" <contains> "xxx1@yyyy1" [14:32:20] 0 = "From" <contains> "xxx1@yyy1 (Szymon Tomasz Stefanek <sss@ggg>) [14:32:20] Evaluating filter rules: (match all of the following) "From" <contains> "xxx2@yyy2" [14:32:20] 0 = "From" <contains> "xxx2@yyy2" (Szymon Tomasz Stefanek <sss@ggg>) [14:32:20] Evaluating filter rules: (match all of the following) "From" <contains> "xxx3@yyy3" [14:32:20] 0 = "From" <contains> "xxx3@yyy3" (Szymon Tomasz Stefanek <sss@ggg>) [...] [14:32:20] Evaluating filter rules: (match all of the following) "<size>" <less-or-equal> "256000" [14:32:20] 1 = "<size>" <less-or-equal> "256000" ( 4324 ) [14:32:20] Filter rules have matched. [14:32:20] Applying filter action: Pipe Through "spamc" [14:32:20] Evaluating filter rules: (match any of the following) "X-Spam-Flag" <contains> "yes" [14:32:20] 0 = "X-Spam-Flag" <contains> "yes" () Another bit of information. The Content-Type header is NOT broken by the spamc executable. I have written a wrapper for it that saves the input and the output on disk. In both I find the correct Content-Type. Should be fixed in current master. See commit http://commits.kde.org/kdepim/4a2b04233995562919fa894f0cde59f29364fc39 Bugzilla just didn't let me close it with the commit hook. Can you backport the fix to 4.8? That would be very helpful. Git commit c9fbfb3f597486052080d6bf8e769645d9e73447 by Allen Winter, on behalf of Szymon Tomasz Stefanek. Committed on 28/02/2012 at 11:08. Pushed by winterz into branch 'KDE/4.8'. Avoid parsing the message multiple times in filters. This is against the published KMime policy. (cherry picked from commit 4a2b04233995562919fa894f0cde59f29364fc39) M +3 -1 mailcommon/searchpattern.cpp http://commits.kde.org/kdepim/c9fbfb3f597486052080d6bf8e769645d9e73447 This bug seems to have reappeared. I am seeing it on KMail 4.8.4 in Opensuse 12.2 Only seems to appear with the use of bogofilter. Spamassassin does not seem to cause this problem. Removal of bogofilter and problem diasppears. This is what I see . . . --047d7bdc0b0caa030b04c959adc8 Content-Type: text/plain; charset=ISO-8859-1 [my message] [lot of html code] I've been observing this bug on my system for some time, now with KMail 4.14.4. I had to choose "Show Message Structure" option to be able to see both parts. This is pretty annoying and indeed a very serious bug with might result in a data loss. It seems I've corrected the problem in my case: though I had the option Settings > Security > Prefer HTML to plain text I also had to choose each folder and mark Folder > Message Default Format > Use Global Setting Now it seems to work fine. I'll post new info if I see some problems. |
Created attachment 67658 [details] Screenshot Version: 4.8 (using Devel) OS: Linux This bug may affect all mails processed by external applications, but it's definitively most visible on spam filtering. So far the bug only affected my POP3 accounts, not IMAP accounts processed by mail filtering. (This could just be a coincidence, though.) KMail seems to blindly set the content type in mail headers to: Content-Type: text/plain; charset="US-ASCII" Completely ignoring the individual content types of the two parts in multipart HTML+plaintext mails. This is not a bug of the spam filter programs themselves. I tried both Bogofilter as well as SpamAssassin: Same results. Technically that bug causes data loss which is why I chose 'Severity: Major (data loss)'. Reproducible: Sometimes Steps to Reproduce: - Set up a POP3 account. - Set up the spam filtering via wizzard - Get multipart HTML+plaintext mails Actual Results: KMail displays multipart mails as source code Expected Results: Do not force 'Content-Type: text/plain; charset="US-ASCII"' and actually properly render the HTML / plaintext parts