Bug 286703

Summary: Kmail2 makes multiple (>30) duplicates of new, unread mails from IMAP account.
Product: [Applications] kmail2 Reporter: cdputnam
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: kde, kdenis, tharrrk, xms-00
Priority: NOR    
Version: 4.7   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description cdputnam 2011-11-15 16:14:13 UTC
Version:           unspecified (using KDE 4.7.3) 
OS:                Linux

After upgrading from kmail (KDE 3.5) to kmail2 (KDE 4.7), things worked fine
with my IMAP account initially.

Over the last few days, I now have a new behavior in which kmail2 starts to generate duplicates (more than 30 copies) of new unread emails downloaded from the server.  These duplicates are present both in kmail2 and on the IMAP account (as observed by a web interface).  New _read_ emails (marked 'read' after reading on the web interface) do not seem to be duplicated.


Reproducible: Always

Steps to Reproduce:
All that is required is having Kmail2 start to download new messages (that are marked as unread) from the IMAP server.


Expected Results:  
I would like to only have one copy of each new e-mail please.
Comment 1 David 2011-11-16 02:51:58 UTC
I am having this problem as well on Fedora with KDE 4.7.2 and 4.7.3 using an IMAP account that worked fine with Kmail 1 and works fine with every other email client I've tried.
Comment 2 cdputnam 2011-11-18 21:56:23 UTC
I think I've found the source of the problem.  Eliminating SpamBayes for spam filtering seems to have fixed the e-mail duplication problem and would be consistent with the effect being limited to new unread e-mails.

Any chance that it's a timing problem where kmail2 thinks it hasn't seen messages that it has already downloaded when they're passing through SpamBayes?

Also, I've seen this with both KDE 4.7.2 and 4.7.3 as well (4.7.2 being the KDE distribution with Fedora 16).
Comment 3 David 2011-11-18 21:59:07 UTC
I have been using bogofilter with KMail for years and this seems like a likely cause. I will try disabling bogofilter and report back with results.
Comment 4 David 2011-11-19 01:49:04 UTC
Removing the two bogofilter filters in KMail2 works around this issue. Looks like a bug in how KMail handles these spam filters.
Comment 5 Tharrrk 2012-01-19 12:58:53 UTC
Hi,
  same here on Fedora 16, Kmail2+KDE 4.7.4 - seems like any filter that uses pipe and adds any header starts this duplication.
  For me this KMail2 seems to be a big big step back... :(

Tharrrk
Comment 6 Tharrrk 2012-01-19 14:21:20 UTC
Ok I made some basic analysis...

An email from IMAP (damned M$Exchange) is read in multipart/alternative format, but the message appears something like twice inside when I manually export it from KMail2.

Looking directly in IMAP folder using telnet the message seems to be OK.

After going through the SpamAssassin pipe, the second (duplicate) piece of multipart message doesn't appear anymore.

The MessageID is the same, but KMail2 puts it back into the IMAP folder.

Please check it devs, now it's up to you :) 
Thx
Comment 7 Matthias Mailänder 2012-02-10 12:59:35 UTC
I am also affected on openSUSE 12.1 with
Qt: 4.7.4
KDE: 4.7.2 (4.7.2) "release 5"
KMail: 4.7.2
Disabling the spam filter works around the scary duplication issue. Somehow opening the account in Thunderbird, letting it do it's spam filtering, closing it, opening KMail again, seems to clean up the mess.

I think this is a the same issue as Bug 283682 - KMail duplicates filtered messages.
Comment 8 Denis Kurz 2016-09-24 18:22:25 UTC
This bug has only been reported for versions before 4.14, which have been unsupported for at least two years now. Can anyone tell if this bug still present?

If noone confirms this bug for a Framework-based version of kmail2 (version 5.0 or later, as part of KDE Applications 15.12 or later), it gets closed in about three months.
Comment 9 Denis Kurz 2017-01-07 23:13:04 UTC
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.