Bug 288040 - kmail2 fails to remove duplicate mails from folder
Summary: kmail2 fails to remove duplicate mails from folder
Alias: None
Product: kmail2
Classification: Applications
Component: folders (show other bugs)
Version: 4.7
Platform: openSUSE Linux
: NOR normal with 40 votes (vote)
Target Milestone: ---
Assignee: kdepim bugs
Depends on:
Reported: 2011-12-02 09:47 UTC by Nino
Modified: 2017-01-07 21:39 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:

diff of the to instances of a "duplicate" mail (324 bytes, text/plain)
2011-12-02 09:47 UTC, Nino
an illustratino of the duplicate email problem (25.79 KB, image/png)
2013-04-29 13:19 UTC, Gerry Gavigan

Note You need to log in before you can comment on or make changes to this bug.
Description Nino 2011-12-02 09:47:05 UTC
Created attachment 66296 [details]
diff of the to instances of a "duplicate" mail

Version:           4.7 (using KDE 4.7.2) 
OS:                Linux

see bug#271660 (https://bugs.kde.org/show_bug.cgi?id=271660)

Please reopen that bug :-)  or use this one...

Maybe it's some kind of matching problem? In my case, I set up a new box with openSUSE 12.1, and imported my old kmail folders. Then my first POP3 poll redownloaded all the old mails which have been kept in the remote Mailbox for different reasons. In the end, the two mail copies were slightly different as kmail seemed to have added some headers to one of them but not to the other (see diff). But however, the MID was the same.

Reproducible: Always

Steps to Reproduce:
Details see bug#271660
In short, slight differences seem to prevent kmail2 from removing duplicate mails from a folder.

Actual Results:  
see above.

Expected Results:  
kmail2 should be more tolerant or ask if it does not know what to do (e.g. in case of mails with identical Message-ID).
Comment 1 Laurent Montel 2011-12-02 13:53:34 UTC
I fixed some bug in this method.
But works fine here.
Do you select multi folder ?
How many email do you try to search duplicate ?
Comment 2 Nino 2011-12-02 14:29:25 UTC
> Do you select multi folder ?

> How many email do you try to search duplicate ?
About 180 duplicates, the folder had about 2700 mails in total
Comment 3 Laurent Montel 2011-12-02 18:05:10 UTC
could you send me 2 duplicate emails in attachement please.
Will look at why it doesn't work.
Comment 4 Nino 2011-12-03 22:29:49 UTC
Am Freitag, 2. Dezember 2011, 18:05:10 schrieb Laurent Montel:
> https://bugs.kde.org/show_bug.cgi?id=288040
> --- Comment #3 from Laurent Montel <montel kde org>  2011-12-02 18:05:10 ---
> could you send me 2 duplicate emails in attachement please.
> Will look at why it doesn't work.

As the mails are confidential, which mail address should I use?

Regards, Nino
Comment 5 avlas 2012-01-17 03:44:53 UTC
I'm suffering the same issues
Comment 6 avlas 2012-01-18 19:31:48 UTC
I'm willing to collaborate to fix this issue from a user perspective if this would help...
Comment 7 Beat Wolf 2012-02-05 21:05:23 UTC
I have the same problem with kmail 4.8. Kmail duplicated many mails because of a bug, so i was told to use this feature. sadly it does not work
Comment 8 Mark Fraser 2012-03-17 11:18:25 UTC
I've recently upgraded to Kubuntu 11.10 and KDE 4.8. Trying to sort my emails out, I found that I have multiple copies of some emails in a few folders. Trying "remove duplicate mails" doesn't work.
Comment 9 Nikita Bige 2012-03-27 07:15:48 UTC
I have the same problem.
Kmail duplicates mails because of some bugs while downloading new mails
And remove duplicate mails function doesn't work at all!
kmail version is 4.8.1, KDE 4.8.1
QT - 4.8.0
Distr: fedora 16
Comment 10 piedro 2013-03-26 09:18:21 UTC
This Bug still affects me with KDE 4.10.1
Comment 11 g.a.lauder 2013-04-22 03:41:37 UTC
This bug is still occurring.  Kmail 4.10 in OpenSuse 12.3.

I get the following error.  

Unable to fetch item from backend (collection 49) : Unable to retrieve item from resource: Invalid item retrieved
I thought possibly that it may be the import tool as I had just upgraded to 12.3.  "Import from Archive took many hours" so I did  a simple import mails and folders.  No difference. and same error although the collection number keeps rising

It has now gotten so bad that it is rendering Kmail unusable so I am now going to have to delete all my mail in this installation and start from scratch.
Comment 12 Gerry Gavigan 2013-04-29 13:18:03 UTC
Occasionally I get a duplicate email appearing in my in box - the attachment is from a mailing list filtered to a sub folder but it also happens on general email
Comment 13 Gerry Gavigan 2013-04-29 13:19:58 UTC
Created attachment 79546 [details]
an illustratino of the duplicate email problem

I can supply the originals for inspection but prefer not to post full details to list
Comment 14 piedro 2013-04-29 13:31:03 UTC
Suggestion: Wouldn't it be good to offer the user a choice for the criteria of what is considered as duplicate? I'd rather prefer to only compare the content, because the header is often different with flag or forwards and what not ... 

Just an idea ... 
thx, p.
Comment 15 Gerry Gavigan 2013-04-29 13:43:53 UTC
I'm not sure if that comment was directed at me

If the developers want the originals that's fine but I don't want to post them to the list
Comment 16 Denis Kurz 2016-09-24 18:00: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 17 Denis Kurz 2017-01-07 21:39:29 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.