Created attachment 66792 [details] Patch to fix the bug. Version: 4.7 (using KDE 4.7.3) OS: Linux kio_imap's APPEND command is missing the (mandatory) message size when there are no flags being set on the new message. Reproducible: Always Steps to Reproduce: KIO PUT a file to any IMAP 4.1 compliance server (like Courier IMAP). Actual Results: Error. Expected Results: Message added to mail folder. This is a regression, broken by: commit d961033b4a5c02edbda8901a2c90349f859f6c00 Author: Montel Laurent <montel@kde.org> Date: Sun May 22 15:05:57 2011 +0200 Fix compile with "(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)"
Please have a look at this, it may be related to https://bugs.kde.org/show_bug.cgi?id=279432 https://bugs.gentoo.org/show_bug.cgi?id=382411
Created attachment 66793 [details] more compact version of the patch, makes it easier to see the change
I can confirm that my simplified patch resolves the problem described in the Gentoo bug. > https://bugs.gentoo.org/show_bug.cgi?id=382411
(In reply to comment #2) > Created an attachment (id=66793) [details] > more compact version of the patch, makes it easier to see the change That was what I originally had, but I opted to reformat it slightly to make it easier to read (as opposed to easier to compare) in hopes of avoiding a regression like this in the future. I would prefer whoever merges this provide proper attribution. `git am <file>` on my original patch will do this properly, or `git commit --author="Luke Dashjr <luke-jr+git@utopios.org>"` if another route is taken.
Git commit ddc273ca863aacc65742bf6193826809a2d3265e by Allen Winter. Committed on 17/12/2011 at 18:38. Pushed by winterz into branch 'master'. In clientAppend(), be careful how the arguments for the APPEND command are constructed so as not to break things. Found by Luke Dashjr <luke-jr+git@utopios.org> with help from Andreas. Thanks guys. Please test this. BUG: 289084 FIXED-IN: 4.8.0 M +6 -1 kioslave/imap4/imapcommand.cpp http://commits.kde.org/kdepimlibs/ddc273ca863aacc65742bf6193826809a2d3265e
I'm not sure Allen's rewrite will work, unless there's some C++/Qt magic I'm unaware of... You're starting with a char, adding a QString, then a const char*. In the original version, as well as my rewrite, everything begins with a QString, so there is operator+ in effect. Perhaps more importantly, the original commit that broke this was doing something to enable some QString optimization, and I suspect this rewrite may break that. Is there a reason not to just revert this and apply my original, safer patch with `git am`?