Bug 300472

Summary: Moving Mails between folders causes them to be recreated in source folder
Product: [Applications] kmail2 Reporter: redcap <forenhampel>
Component: commands and actionsAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: mmauder+kde, null, seres.david, thomas
Priority: NOR    
Version: 4.8.5   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description redcap 2012-05-22 20:06:23 UTC
I set up a new Gentoo system and encountered the following bug in 
Kmail2. Everytime I move an email from, say the inbox folder, to some
other folder the email is moved correctly, at least initially. However, 
upon switching from to inbox folder to another folder and then back 
to the inbox folder, the harddrive is accessed and  the email is recreated 
in the inbox folder resulting in two copies of the same mail in different folders.
This behaviour is reproducible every time.

Here is some more precise information about how I set up the machine. Maybe 
its helpful.

1) Installed KDE SC including KDE-PIM suite from gentoo's stable portage tree
2) started KDE and set up Akonadi resources, namely 4
"POP3 Email-Server"-resources
3) started kmail2 and imported messages from a backup

Curiously, the behaviour described above only applies to newly received 
emails. Emails from the backup are not affected.

Please let me now if I can provide more information.
Comment 1 Seres Dávid 2012-05-29 09:00:30 UTC
I installed Kubuntu 12.04 with KDE 4.8.3 from kubuntu-ppa, and i have to comfirm this bug.

I uses pop3 mailboxes. When i drag and drop mails from inbox folder to other one, and choose moving, mails are moved, but a few minutes later they are recreated in inbox folder.  KNotify shows one ,,crazy'' message from every moved emails. If i move hundred, i get hundred notification.  Copy and delete are working, but uncomfortable.

Other problem is that moving mail as action of mail filters do the same!!! The filter runs on inbox moving every mail it have to, but a few minute later new mails will recreated, and filter rerun on these mails too. I had to disable my filters, because KMail 2 produced thousands of duplicate mails in target folders jumped into infinite cycle!!!
Comment 2 Ronnie Bailey 2012-09-27 15:24:46 UTC
I can confirm this bug is in version 4.8.5

Shortly after I move a message from my inbox to a folder, the image re-appears in the inbox. As many of these are receipts for payments that I store, I have to verify that the messages are identical before deleting them. It is very inconvenient.
Comment 3 Myriam Schweingruber 2012-09-30 10:16:15 UTC
Setting status to confirmed.
Comment 4 Ronnie Bailey 2012-10-26 03:09:51 UTC
   I have found that if you move a message to another folder, then switch your view from your inbox to any other folder and back to inbox, the message reappears instantly. 
  I am assuming that moving a message is similar to moving a normal file in that the file is actually copied and then the original is deleted after the copy is confirmed. Apparently the file is not deleted from the inbox upon successful copy to the other folder and reappears as soon as anything causes the inbox to refresh.
Comment 5 Thomas Arend 2012-10-26 23:23:55 UTC
I can confirm this bug. I thought that the messeges were not buved but reading this bug report I found that the messages are stored in the target folder. This is not always reproducible. Some times they are moved sometimes not.

Have a nice weekend
Thomas
Comment 6 Thomas Arend 2012-10-26 23:28:14 UTC
(In reply to comment #5)
> I can confirm this bug. I thought that the messeges were not buved but
> reading this bug report I found that the messages are stored in the target
> folder. This is not always reproducible. Some times they are moved sometimes
> not.
> 
> Have a nice weekend
> Thomas

I have to add my comment. I deleted the messages in the target folder and they disappeared although from the inbox. There was only one copy in the paste bin.

Seem that one message can be displayed in more than one folder.
Comment 7 Thomas Arend 2012-10-26 23:34:48 UTC
I didn't want to do some testing so excuse me for making more comments.
I moved 3 deleted messages form the paste bin back to inbox. Switching back to inbox I found 5 messages. Two messages were duplicated, one only a singe copy.

Very strange behaviour. Seem there is something very buggy.

Not for productive use!
Comment 8 Thomas Arend 2012-10-26 23:47:45 UTC
Another comment.

I could remove the duplicate messages and copied them to the target folder. After this I could not delete the messages in the inbox. But: They appeared in teh pastebin.

Now I have three copies in my spam folder, the inbox and the pastebin. 

I deleted the messages in pastebin and the messages in the inbox disappeared.

Now I have the messages in the folder they belong to.

Maybe this "tricky" thing is related to the filter problem, were messages are not moved to the destination folder.

See Bugs following bugs
https://bugs.kde.org/show_bug.cgi?id=293918 	
https://bugs.kde.org/show_bug.cgi?id=301338
https://bugs.kde.org/show_bug.cgi?id=307548

Good night.
Comment 9 Unknown 2013-01-23 10:33:14 UTC
Please, make a control with "akonadi console"
Choose "DB Browser", "collectiontable", "Refresh"
Get a look to the column "remoteId".
Are there any cell(s) with nothing? If yes, let me/us know by copying the raw(s).
Comment 10 Denis Kurz 2016-09-24 18:11:23 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 11 Denis Kurz 2017-01-07 22:27:33 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.