<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>289084</bug_id>
          
          <creation_ts>2011-12-15 23:09:21 +0000</creation_ts>
          <short_desc>kio_imap APPEND omits message size without flags</short_desc>
          <delta_ts>2011-12-17 18:32:58 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kdepimlibs</product>
          <component>mailtransport</component>
          <version>4.7</version>
          <rep_platform>Gentoo Packages</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Luke-Jr">luke-jr+kdebugs</reporter>
          <assigned_to name="kdepim bugs">pim-bugs-null</assigned_to>
          <cc>dilfridge</cc>
    
    <cc>perezmeyer</cc>
    
    <cc>pim-bugs-null</cc>
    
    <cc>rakuco</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin>4.8.0</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>40</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1200301</commentid>
    <comment_count>0</comment_count>
      <attachid>66792</attachid>
    <who name="Luke-Jr">luke-jr+kdebugs</who>
    <bug_when>2011-12-15 23:09:21 +0000</bug_when>
    <thetext>Created attachment 66792
Patch to fix the bug.

Version:           4.7 (using KDE 4.7.3) 
OS:                Linux

kio_imap&apos;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 &lt;montel@kde.org&gt;
Date:   Sun May 22 15:05:57 2011 +0200

    Fix compile with &quot;(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1200307</commentid>
    <comment_count>1</comment_count>
    <who name="Andreas K. Huettel">dilfridge</who>
    <bug_when>2011-12-15 23:22:11 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1200318</commentid>
    <comment_count>2</comment_count>
      <attachid>66793</attachid>
    <who name="Andreas K. Huettel">dilfridge</who>
    <bug_when>2011-12-15 23:49:56 +0000</bug_when>
    <thetext>Created attachment 66793
more compact version of the patch, makes it easier to see the change</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1200326</commentid>
    <comment_count>3</comment_count>
    <who name="Andreas K. Huettel">dilfridge</who>
    <bug_when>2011-12-16 00:02:03 +0000</bug_when>
    <thetext>I can confirm that my simplified patch resolves the problem described in the Gentoo bug.

&gt; https://bugs.gentoo.org/show_bug.cgi?id=382411</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1200343</commentid>
    <comment_count>4</comment_count>
    <who name="Luke-Jr">luke-jr+kdebugs</who>
    <bug_when>2011-12-16 02:54:39 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Created an attachment (id=66793) [details]
&gt; 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 &lt;file&gt;` on my original patch will do this properly, or `git commit --author=&quot;Luke Dashjr &lt;luke-jr+git@utopios.org&gt;&quot;` if another route is taken.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1201054</commentid>
    <comment_count>5</comment_count>
    <who name="Allen Winter">winter</who>
    <bug_when>2011-12-17 17:48:57 +0000</bug_when>
    <thetext>Git commit ddc273ca863aacc65742bf6193826809a2d3265e by Allen Winter.
Committed on 17/12/2011 at 18:38.
Pushed by winterz into branch &apos;master&apos;.

In clientAppend(), be careful how the arguments for the APPEND command
are constructed so as not to break things.

Found by Luke Dashjr &lt;luke-jr+git@utopios.org&gt;
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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1201064</commentid>
    <comment_count>6</comment_count>
    <who name="Luke-Jr">luke-jr+kdebugs</who>
    <bug_when>2011-12-17 18:32:58 +0000</bug_when>
    <thetext>I&apos;m not sure Allen&apos;s rewrite will work, unless there&apos;s some C++/Qt magic I&apos;m unaware of... You&apos;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`?</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>66792</attachid>
            <date>2011-12-15 23:09:21 +0000</date>
            <delta_ts>2011-12-15 23:09:21 +0000</delta_ts>
            <desc>Patch to fix the bug.</desc>
            <filename>kio_imap-fix-APPEND-without-flags.patch</filename>
            <type>text/plain</type>
            <size>1405</size>
            <attacher name="Luke-Jr">luke-jr+kdebugs</attacher>
            
              <data encoding="base64">RnJvbSAzM2ZkNGE2MGU4Njk1ZDkzODEzMjE2YTJjNWM2MzJ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FwY29tbWFuZC5jcHAKQEAgLTIzMSw3ICsyMzEsMTEgQEAgQ29tbWFuZFB0cgogaW1h
cENvbW1hbmQ6OmNsaWVudEFwcGVuZCAoY29uc3QgUVN0cmluZyAmIGJveCwgY29uc3QgUVN0cmlu
ZyAmIGZsYWdzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgdWxvbmcgc2l6ZSkKIHsKLSAg
UVN0cmluZyB0bXAgPSBRU3RyaW5nKGZsYWdzLmlzRW1wdHkoKSA/IFFTdHJpbmcoIiIpIDogUVN0
cmluZygoJygnICsgZmxhZ3MgKyAiKSAiKSkgKyAneycgKyBRU3RyaW5nOjpudW1iZXIoc2l6ZSkg
KyAnfScpOyAKKyAgUVN0cmluZyB0bXAgPSBRU3RyaW5nKAorICAgICgoZmxhZ3MuaXNFbXB0eSgp
KSA/CisgICAgICBRU3RyaW5nKCIiKSA6CisgICAgICBRU3RyaW5nKCgnKCcgKyBmbGFncyArICIp
ICIpKSkgKworICAgIFFTdHJpbmcoJ3snICsgUVN0cmluZzo6bnVtYmVyKHNpemUpICsgJ30nKSk7
CiAgIHJldHVybiBDb21tYW5kUHRyKCBuZXcgaW1hcENvbW1hbmQgKCJBUFBFTkQiLAogICAgICAg
ICAgICAgICAgICAgICAgICAgICAiXCIiICsgS0lNQVA6OmVuY29kZUltYXBGb2xkZXJOYW1lIChi
b3gpICsgIlwiICIgKyB0bXApKTsKIH0KLS0gCjEuNy4zLjQKCg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>66793</attachid>
            <date>2011-12-15 23:49:56 +0000</date>
            <delta_ts>2011-12-15 23:49:56 +0000</delta_ts>
            <desc>more compact version of the patch, makes it easier to see the change</desc>
            <filename>kdepimlibs-4.7.4-size.patch</filename>
            <type>text/plain</type>
            <size>717</size>
            <attacher name="Andreas K. Huettel">dilfridge</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL2tpb3NsYXZlL2ltYXA0L2ltYXBjb21tYW5kLmNwcCBiL2tpb3NsYXZlL2lt
YXA0L2ltYXBjb21tYW5kLmNwcAppbmRleCA0M2RhY2NkLi44MjU2NTcwIDEwMDY0NAotLS0gYS9r
aW9zbGF2ZS9pbWFwNC9pbWFwY29tbWFuZC5jcHAKKysrIGIva2lvc2xhdmUvaW1hcDQvaW1hcGNv
bW1hbmQuY3BwCkBAIC0yMzEsNyArMjMxLDcgQEAgQ29tbWFuZFB0cgogaW1hcENvbW1hbmQ6OmNs
aWVudEFwcGVuZCAoY29uc3QgUVN0cmluZyAmIGJveCwgY29uc3QgUVN0cmluZyAmIGZsYWdzLAog
ICAgICAgICAgICAgICAgICAgICAgICAgICAgdWxvbmcgc2l6ZSkKIHsKLSAgUVN0cmluZyB0bXAg
PSBRU3RyaW5nKGZsYWdzLmlzRW1wdHkoKSA/IFFTdHJpbmcoIiIpIDogUVN0cmluZygoJygnICsg
ZmxhZ3MgKyAiKSAiKSkgKyAneycgKyBRU3RyaW5nOjpudW1iZXIoc2l6ZSkgKyAnfScpOyAKKyAg
UVN0cmluZyB0bXAgPSBRU3RyaW5nKChmbGFncy5pc0VtcHR5KCkgPyBRU3RyaW5nKCIiKSA6IFFT
dHJpbmcoKCcoJyArIGZsYWdzICsgIikgIikpKSArICd7JyArIFFTdHJpbmc6Om51bWJlcihzaXpl
KSArICd9Jyk7CiAgIHJldHVybiBDb21tYW5kUHRyKCBuZXcgaW1hcENvbW1hbmQgKCJBUFBFTkQi
LAogICAgICAgICAgICAgICAgICAgICAgICAgICAiXCIiICsgS0lNQVA6OmVuY29kZUltYXBGb2xk
ZXJOYW1lIChib3gpICsgIlwiICIgKyB0bXApKTsKIH0K
</data>

          </attachment>
      

    </bug>

</bugzilla>