Bug 144960 - imap copy moves files instead of copying
Summary: imap copy moves files instead of copying
Status: RESOLVED WORKSFORME
Alias: None
Product: kmail
Classification: Unmaintained
Component: IMAP (show other bugs)
Version: 1.9.6
Platform: openSUSE Linux
: NOR grave
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 147333 147736 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-05-02 15:58 UTC by Holger Lehmann
Modified: 2008-07-19 14:12 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
ethereal trace of the kmail <-> cyrus imapd conversation (8.39 KB, text/plain)
2007-05-02 16:02 UTC, Holger Lehmann
Details
kdepim3 specfile modified to build on SuSE 9.3 (54.57 KB, text/plain)
2007-08-27 09:17 UTC, Holger Lehmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Lehmann 2007-05-02 15:58:05 UTC
Version:           1.9.6 (using KDE 3.5.6 "release 77.1" , openSUSE )
Compiler:          gcc version 3.3.5 20050117 (prerelease) (SUSE Linux)
OS:                Linux (i686) release 2.6.11.4-21.15-default

Using the following System:
SuSE 9.3
KDE 3.5.6 (Release 77.1) retreived via http://ftp.gwdg.de/pub/linux/suse/opensuse/repositories/KDE:/KDE3/SUSE_Linux_9.3/
kmail is contained in the RPM: kdepim3-3.5.6-39.2
Using the imap server: Open-Xchange (SLES9SP3) with cyrus imapd 2.2.3

Before updating my KDE subsystem copying messages either via drag and drop or via right mouse click->copy to... only copied the messages into the new location.

After updating my KDE subsystem choosing to copy one or more mail messages moves those messages into the selected destination folder instead.

I have verified the correct functionality of the cyrus imapd by using another imap client. The copying still works in other imap clients.
Comment 1 Holger Lehmann 2007-05-02 16:02:47 UTC
Created attachment 20458 [details]
ethereal trace of the kmail <-> cyrus imapd conversation

The mail message in question has the imap id 34498.
You can see a copy command from kmail to the imapd:
4348 UID COPY 34498 "INBOX/Projekte"
and later on another command relating to the same message:
4354 UID STORE 34498 +FLAGS.SILENT (\DELETED)

There is some noise in the file as well, since some new mail arrived during the
capture.
Comment 2 Holger Lehmann 2007-05-02 16:06:56 UTC
Here some (maybe) interesting information:

All copy operations were attempted on _one_ imap server (no cross server actions).

I have selected the option to compress mail folders automatically on the genereal settings tab of the imap connection.
I have also selected the option from the miscellaneous->folders tab that I want to prompted for the requested action upon moving messaged with drag an drop.
Comment 3 Holger Lehmann 2007-05-02 16:12:18 UTC
Copying the message(s) from the imap server to my local mail store (from the days of pop3) and back did _not_ delete the messages.
Also copying mail messages locally from one folder to another also did _not_ delete the messages.
So it must be an imap related behaviour, that the client seems to show only when copying messages from one folder to another on the same imap server.
I have not tried to copy messages across imap servers, since I have access to only one imap server.
Comment 4 Thomas McGuire 2007-05-08 16:43:22 UTC
Raising severity to grave, potential for dataloss (see bug 145179).
Comment 5 Andre Woebbeking 2007-06-07 18:45:42 UTC
I can confirm this for KMail 1.9.7 with self compiled and openSuSE 10.2 packages.
Comment 6 Thomas McGuire 2007-06-28 22:19:53 UTC
*** Bug 147333 has been marked as a duplicate of this bug. ***
Comment 7 Julian Bäume 2007-06-29 11:14:10 UTC
I also can confirm this for KMail 1.9.7 on my gentoo machine. I also tested this with an different imap server (one local on my file/mail server and one via internet). There everything works fine.
So this just happens when copying mails on the same server.

Hope this helped
Comment 8 Ville-Pekka Vainio 2007-07-04 08:19:17 UTC
I can confirm this too, 1.9.7 on Fedora Core 6 with kde-redhat packages. I started seeing this bug after an update from KDE 3.5.6 to 3.5.7. I don't know which version of KMail was in kde-redhat's 3.5.6 but this bug definitely wasn't there.
Comment 9 Michael Nottebrock 2007-07-05 17:29:58 UTC
I just hit this bug as well on with KMail 1.9.7 on FreeBSD 5.5-Release and a Courier IMAP 4.0.6 server running on FreeBSD 6.2-Release.
Comment 10 Thomas McGuire 2007-07-10 17:35:06 UTC
*** Bug 147736 has been marked as a duplicate of this bug. ***
Comment 11 ian 2007-07-13 12:56:59 UTC
I can confirm this bug exists for Gentoo with KDE 3.5.7.  This problem also exists when copying between my personal IMAP folder and shared IMAP folders in both directions.  To the best of my memory, this problem did not exist in KDE 3.5.4.
Comment 12 Chris Haumesser 2007-08-25 19:48:33 UTC
I too am bitten by this bug.  I was loving kmail until I ran across this.  Now, well... I'm back to square one on mail clients.

Is anyone working on this?  Any hope that it will be fixed before kde4?
Comment 13 Holger Lehmann 2007-08-27 09:13:00 UTC
It seems like this bug has been fixed in 1.9.6 (enterprise 20070731.694771) that is packaged by the openSuSE Team for (at least) openSuSE 10.0.

I recompiled the Source RPM:
http://repos.opensuse.org/KDE:/KDE3/SUSE_Linux_10.0/src/kdepim3-3.5.7.enterprise.0.20070731.694771-11.1.src.rpm
along with the attached modified spec file, that enables a build of this under SuSE 9.3.
The IMAP copy bug was gone after simply upgrading (only) this RPM.

Hint: Do not try to install the RPM from openSuSE 10.0, since the kdelibs have changed.
Hint #2: If you really want a lot of work, recompile all kde Packages from openSuSE 10.0 for SuSE 9.3, it takes a while ...
Comment 14 Holger Lehmann 2007-08-27 09:17:39 UTC
Created attachment 21487 [details]
kdepim3 specfile modified to build on SuSE 9.3

The specfile from openSuSE 10.0 has a different requirement and needed to be
modified.
Also patch #5 has been disabled due to the fact, that it is only available
*after* upgrading the kdelibs3. There is in fact a switch at the start of the
specfile concerning networkstatus. You can set this to 1 if you build kdepim3
against the new kdelibs3 on a SuSE 9.3.
Comment 15 Holger Lehmann 2007-08-27 09:21:55 UTC
I am marking this bug as resolved since upgrading to the package kdepim3-3.5.7.enterprise.0.20070731.694771-11.1 (please see my last 2 posts) fixed this issue. Anyone wanting "fix" this problem needs some CPU cycles, above specfile and the above .src.rpm .
Simply do a rpm -ivh http://repos.opensuse.org/KDE:/KDE3/SUSE_Linux_10.0/src/kdepim3-3.5.7.enterprise.0.20070731.694771-11.1.src.rpm
Download the specfile info /usr/src/packages/SPECS as kdepim3.spec .
And run rpmbuild --rebuild /usr/src/packages/SPECS as kdepim3.spec .
Follow any instructions on the screen (like missing gcc and or devel packages).

At the end of the build, please install the binary RPMs for your system as they are listed at the end of the build process.
Comment 16 ian 2007-08-27 12:10:39 UTC
rpm's are not particularly useful on a gentoo system.  

I have just now completed a fresh build from the gentoo sources, where I would expect this bug has been fixed, based on the assumption that it was "fixed" in a release dated 31 July 2007.  This says to me that the problem remains most probably not fixed in the KDE source tree.

As such, this bug is for me not fixed, and should be reopened.
Comment 17 Michael Nottebrock 2007-08-27 12:37:43 UTC
Holger, we really need a source code patch here, not a specfile patch. :)
Comment 18 Holger Lehmann 2007-08-27 13:27:04 UTC
@Ian: Please supply the KDE with more and detailed infos. As long as I do not experience this bug anymore I will not be able to supply any useful infos.

@Michael: Sorry, I did not do anything to the sourcecode. I simply grabbed the source rpm of my distributor (of a newer version) and recompiled it myself. I cannot say if any of these patches have not been submitted to the KDE team or if they have rejected the patches.

I will reopen this bug due to you guys requests and I ask you to try out the patches SuSE/Novell made (contained in the source rpm). And yes you can unpack a rpm even on gentoo. In a fresh folder do:
rpm2cpio <rpm> | cpio -id
(you need rpm2cpio for that).
Alternatively use mc (Midnight Commander) and try to access the files that way.
Comment 19 ian 2007-09-03 13:02:21 UTC
Hmmmm.  I don't really know what extra information I can provide.  I'm using KMail 1.9.7, also refered to as 3.5.7-r2 in the gentoo tree.  What other information would you be looking for?
Comment 20 alancio 2007-09-06 23:35:50 UTC
I have the same problem, what a pain.
Comment 21 BJ Blanchard 2007-09-27 22:02:43 UTC
Same issue on Archlinux, KDE/kontact 3.5.7.

Further to that - if I "Select All" message prior to the copy, and use Copy To.., kontact crashes.

[KCrash handler]
#6  0x00000078 in ?? ()
#7  0xb50fad20 in KMMessage::transferInProgress ()
   from /opt/kde/lib/libkmailprivate.so
#8  0xb5369aa5 in KMail::ImapJob::slotGetMessageResult ()
   from /opt/kde/lib/libkmailprivate.so
#9  0xb53a4f55 in KMail::ImapJob::qt_invoke ()
   from /opt/kde/lib/libkmailprivate.so
#10 0xb68d058d in QObject::activate_signal () from /opt/qt/lib/libqt-mt.so.3
#11 0xb73de4ae in KIO::Job::result () from /opt/kde/lib/libkio.so.4
#12 0xb741e4ad in KIO::Job::emitResult () from /opt/kde/lib/libkio.so.4
#13 0xb7429fce in KIO::SimpleJob::slotFinished ()
   from /opt/kde/lib/libkio.so.4
#14 0xb742a6b8 in KIO::TransferJob::slotFinished ()
   from /opt/kde/lib/libkio.so.4
#15 0xb741e10d in KIO::TransferJob::qt_invoke () from /opt/kde/lib/libkio.so.4
#16 0xb68d058d in QObject::activate_signal () from /opt/qt/lib/libqt-mt.so.3
#17 0xb68d110d in QObject::activate_signal () from /opt/qt/lib/libqt-mt.so.3
#18 0xb73d6d8c in KIO::SlaveInterface::finished ()
   from /opt/kde/lib/libkio.so.4
#19 0xb7449239 in KIO::SlaveInterface::dispatch ()
   from /opt/kde/lib/libkio.so.4
#20 0xb7438fba in KIO::SlaveInterface::dispatch ()
   from /opt/kde/lib/libkio.so.4
#21 0xb73ece5c in KIO::Slave::gotInput () from /opt/kde/lib/libkio.so.4
#22 0xb743ac38 in KIO::Slave::qt_invoke () from /opt/kde/lib/libkio.so.4
#23 0xb68d058d in QObject::activate_signal () from /opt/qt/lib/libqt-mt.so.3
#24 0xb68d1010 in QObject::activate_signal () from /opt/qt/lib/libqt-mt.so.3
#25 0xb6bf4320 in QSocketNotifier::activated () from /opt/qt/lib/libqt-mt.so.3
#26 0xb68ede50 in QSocketNotifier::event () from /opt/qt/lib/libqt-mt.so.3
#27 0xb6872c9a in QApplication::internalNotify ()
   from /opt/qt/lib/libqt-mt.so.3
#28 0xb6873876 in QApplication::notify () from /opt/qt/lib/libqt-mt.so.3
#29 0xb6f6b012 in KApplication::notify () from /opt/kde/lib/libkdecore.so.4
#30 0xb6867521 in QEventLoop::activateSocketNotifiers ()
   from /opt/qt/lib/libqt-mt.so.3
#31 0xb682256d in QEventLoop::processEvents () from /opt/qt/lib/libqt-mt.so.3
#32 0xb6889180 in QEventLoop::enterLoop () from /opt/qt/lib/libqt-mt.so.3
#33 0xb6889016 in QEventLoop::exec () from /opt/qt/lib/libqt-mt.so.3
#34 0xb68726ff in QApplication::exec () from /opt/qt/lib/libqt-mt.so.3
Comment 22 Bob 2008-03-14 05:15:51 UTC
Same happens to me using KMail 1.9.7 on Gentoo.

When copying a message it does get copied on the imap server, just not visible in both folders in KMail.  When you delete the visible message in KMail both messages get deleted from the imap server.

~ $ ls Maildir/cur/
~ $ ls Maildir/.INBOX.test/cur/
~ $

Get an email in inbox.

~ $ ls Maildir/cur/
1205467868.P18387Q7.boron:2,S
~ $ ls Maildir/.INBOX.test/cur/
~ $

Copy email from inbox to inbox.test

~ $ ls Maildir/cur/
1205467868.P18387Q7.boron:2,ST
~ $ ls Maildir/.INBOX.test/cur/
1205467935.P18387Q8.boron:2,S
~ $

Delete email from inbox.test

~ $ ls Maildir/cur/
~ $ ls Maildir/.INBOX.test/cur/
1205467935.P18387Q8.boron:2,ST
~ $

Empty the wastebin

~ $ ls Maildir/cur/
~ $ ls Maildir/.INBOX.test/cur/
~ $
Comment 23 Thomas McGuire 2008-07-19 13:28:21 UTC
Finally closing this bug again.
I can not reproduce this on KDE 4.1 (KMail 1.10.0), I tested with Google Mail and a Kolab server.

Note that the enterprise branch has been merged back into the 3.5 branch in the meantime, this bug should also be fixed with KMail 1.9.9
Comment 24 Julian Bäume 2008-07-19 14:12:20 UTC
Yes, I also tested it with KMail 1.9.9 and this error doesn't occur any longer.