<?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>297198</bug_id>
          
          <creation_ts>2012-03-31 17:16:44 +0000</creation_ts>
          <short_desc>Violation of rfc4155: kmail2 does not use ctime format for first from line when storing in mbox format</short_desc>
          <delta_ts>2014-03-22 12:16:41 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kmail2</product>
          <component>commands and actions</component>
          <version>4.8.3</version>
          <rep_platform>openSUSE</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>grave</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Thomas Arend">thomas</reporter>
          <assigned_to name="kdepim bugs">pim-bugs-null</assigned_to>
          <cc>martin</cc>
    
    <cc>montel</cc>
    
    <cc>thomas</cc>
          
          <cf_commitlink>http://commits.kde.org/kdepimlibs/d1379fda35c9809913d5ab5432461ad5a8fe92d8</cf_commitlink>
          <cf_versionfixedin>4.13</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>20</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1241707</commentid>
    <comment_count>0</comment_count>
      <attachid>70041</attachid>
    <who name="Thomas Arend">thomas</who>
    <bug_when>2012-03-31 17:16:44 +0000</bug_when>
    <thetext>Created attachment 70041
zipped file of a single exported message

Since 4.7 the spamassassin &quot;sa-learn --spam --mbox&quot; command can not learn spam messages which are stored in mbox format by kmail. sa-learn always reports:
  Learned tokens from 0 message(s) (0 message(s) examined)

sa-learn still works on older mbox files.

I noticed some differences between former and current mbox exports. Now there are two empty lines between two messages. Removing the empty lines didn&apos;t not solve the problem.   

This same error in 4.8.0, 4.8.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1243367</commentid>
    <comment_count>1</comment_count>
    <who name="Laurent Montel">montel</who>
    <bug_when>2012-04-06 07:59:30 +0000</bug_when>
    <thetext>I confirm it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1255100</commentid>
    <comment_count>2</comment_count>
      <attachid>71117</attachid>
    <who name="Thomas Arend">thomas</who>
    <bug_when>2012-05-15 20:11:28 +0000</bug_when>
    <thetext>Created attachment 71117
Message saved from kmail Version 1.13.6

This message was received and saved from
 
KMail
Version 1.13.6
Unter KDE 4.6.00 (4.6.0) &quot;release 6&quot;

sa-learn --spam --mbox reports
Learned tokens from 1 message(s) (1 message(s) examined)

Which is what we expect!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1255103</commentid>
    <comment_count>3</comment_count>
      <attachid>71118</attachid>
    <who name="Thomas Arend">thomas</who>
    <bug_when>2012-05-15 20:15:25 +0000</bug_when>
    <thetext>Created attachment 71118
Message saved from kmail Version 4.8.3

This message was received and stored with kmail2 Version 4.8.3

sa-learn --spam --mbox gives
Learned tokens from 0 message(s) (0 message(s) examined)

Which we do not expect. 

Both checks sa-learn were run on the same computer with spamassassin 3.3.1!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1255112</commentid>
    <comment_count>4</comment_count>
    <who name="Thomas Arend">thomas</who>
    <bug_when>2012-05-15 20:47:34 +0000</bug_when>
    <thetext>There is a simple difference in the messages which causes the problem.

kmail1 used the following format of the &quot;From&quot; line:
  From thomas@arend-rhb.de Tue May 15 22:01:41 2012

kmail2 used the format:
  From thomas@arend-rhb.de Tue, 15 May 2012 22:01:41 +0200

If I change the &quot;From&quot;-line to the older format, sa-learn can learn the messages!

kmail1 is not iaw RFC 822; which kmail2 is. Sticking to the standard the problem is with spamassassin.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1255474</commentid>
    <comment_count>5</comment_count>
    <who name="Thomas Arend">thomas</who>
    <bug_when>2012-05-16 20:06:07 +0000</bug_when>
    <thetext>See bug report to SpamAssassin #6703 (https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6703)

See http://tools.ietf.org/html/rfc4155 which states that &quot;A comprehensive description of mbox database files on UNIX-like systems can be found at http://qmail.org./man/man5/mbox.html, which should be treated as mostly authoritative ...&quot;

man 5 mbox defines that the date time stamp of the From_ line shopuld be in ctime format. 

Therefore I propose to switch back to the old  date time stamp format of kmail (Version 1.x).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1255489</commentid>
    <comment_count>6</comment_count>
    <who name="Thomas Arend">thomas</who>
    <bug_when>2012-05-16 21:11:19 +0000</bug_when>
    <thetext>Comment from Mark Martinec 2012-05-16 13:42:01 UTC from https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6703#c6

&gt; When saving messages with kmail 1 the From Line has following format
&gt; which is not iaw RFC 822:
&gt;   From info@ende-18-06.com Fri Jun 17 16:03:07 2011
&gt; With kmail 2 the format is changed to the format which is iaw RFC 822
&gt;   From thomas@arend-rhb.de Tue, 15 May 2012 22:01:41 +0200
&gt; which is not parsed correctly by sa-learn. sa-learn --spam reports: [...]

Oh, no, not yet another incompatible mbox format!!!

&gt; Proposed to change the behavior in a way that the old malformed From lines
&gt; and the new correct ones are parsed.

It is the other way around, the new one differs from everybody else.

The format of the mbox file (along with its separator From_ lines)
is *not* governed by RFC 822 or its successors. There is no formal
standard for an mbox format, the RFC 4155 comes closest:
  http://tools.ietf.org/html/rfc4155
See also a Wikipedia article:
  http://en.wikipedia.org/wiki/Mbox


RFC 4155 says:

| a timestamp indicating the UTC date and time when the message
| was originally received, conformant with the syntax of the
| traditional UNIX &apos;ctime&apos; output sans timezone (note that the
| use of UTC precludes the need for a timezone indicator);

This matches qmail docs:
  http://qmail.org/qmail-manual-html/man5/mbox.html
and matches Postfix and sendmail&apos;s local delivery agent.


To accommodate the new incompatible format it seems that the
two instances of a regexps in ArchiveIterator.pm need to be
extended, or just relaxed. Not sure if the date would still
be correctly parsed.

Best would be to persuade kmail folks to back off the change!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1279602</commentid>
    <comment_count>7</comment_count>
    <who name="Martin Koller">martin</who>
    <bug_when>2012-07-28 22:52:24 +0000</bug_when>
    <thetext>confirmed in comment #1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1297419</commentid>
    <comment_count>8</comment_count>
    <who name="Thomas Arend">thomas</who>
    <bug_when>2012-09-15 02:19:48 +0000</bug_when>
    <thetext>The bug is still in 4.9.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1297421</commentid>
    <comment_count>9</comment_count>
    <who name="Thomas Arend">thomas</who>
    <bug_when>2012-09-15 02:30:47 +0000</bug_when>
    <thetext>I changed the name of the bug so that it is clear, that this is a kmail2 issue.

The mbox format kmail2 uses is incompatible to kmai1 mbox format and is a violation of rfc 4155.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1310075</commentid>
    <comment_count>10</comment_count>
    <who name="Thomas Arend">thomas</who>
    <bug_when>2012-10-27 22:33:29 +0000</bug_when>
    <thetext>kmail 4.9.2

When a message with unkown date - for example spam massages storing the adress in the date field - the from_ line used the local, nationalized  date time format:

From user@example.com So. Okt 28 00:25:18 2012

SpamAssassin can not detect messages in such an mbox.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1322491</commentid>
    <comment_count>11</comment_count>
    <who name="Thomas Arend">thomas</who>
    <bug_when>2012-12-09 16:41:25 +0000</bug_when>
    <thetext>The error is now also kmail2 4.9.4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1379612</commentid>
    <comment_count>12</comment_count>
    <who name="Thomas Arend">thomas</who>
    <bug_when>2013-06-26 19:46:40 +0000</bug_when>
    <thetext>Nice try to fix this bug, but you did it totally wrong and screwed things more than ever:

The From_ line now looks as follows:

     From thomas@example.com Mi. Jun 26 21:26:17 2013

Why did you change the weekday to German languge? Is the month now also Englisch?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1379614</commentid>
    <comment_count>13</comment_count>
    <who name="Thomas Arend">thomas</who>
    <bug_when>2013-06-26 19:47:24 +0000</bug_when>
    <thetext>I forgot the Version 4.10.4</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1436916</commentid>
    <comment_count>14</comment_count>
    <who name="Martin Koller">martin</who>
    <bug_when>2014-03-22 10:53:54 +0000</bug_when>
    <thetext>patch added https://git.reviewboard.kde.org/r/116975/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1436930</commentid>
    <comment_count>15</comment_count>
    <who name="Martin Koller">martin</who>
    <bug_when>2014-03-22 12:16:41 +0000</bug_when>
    <thetext>Git commit d1379fda35c9809913d5ab5432461ad5a8fe92d8 by Martin Koller.
Committed on 22/03/2014 at 12:14.
Pushed by mkoller into branch &apos;KDE/4.13&apos;.

write &quot;From &quot; delimiter line  with correct dateTime format

Fix writing dateTime field in the &quot;From &quot; delimiter line according
to RFC4155
FIXED-IN: 4.13
REVIEW: 116975

M  +6    -2    kmbox/mbox_p.cpp

http://commits.kde.org/kdepimlibs/d1379fda35c9809913d5ab5432461ad5a8fe92d8</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>70041</attachid>
            <date>2012-03-31 17:16:44 +0000</date>
            <delta_ts>2012-03-31 17:16:44 +0000</delta_ts>
            <desc>zipped file of a single exported message</desc>
            <filename>spam.zip</filename>
            <type>application/x-download</type>
            <size>1427</size>
            <attacher name="Thomas Arend">thomas</attacher>
            
              <data encoding="base64">UEsDBBQAAAAIAE2Uf0B5ZnXH5QQAAFMIAAAMABwAc3BhbS14MS5tYm94VVQJAAMRMndPKzJ3T3V4
CwABBOgDAAAEZAAAAI1Va3PaOhD9HP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YgD7VuNKp95tfWu2h10hrI9u+vrzpNfq1O3vyvju0p1c9
fjZyN3cXUUpOvo6chmBajWXU10eTL5N03vt22lzoOjfgr0t3OHZXurHaTs9vjpKrdFxbLW7uJ+3G
n+tbdzTYZTwOsofzzW2z9qDibqdz7Rwj46vz/sgHLz0vHSZ8UDp0+l7psNHqlA4N4yzDksAlQS/D
ihrnHMdWwqQo+0O2Boo/MGBIeaR+atia2BPKDSPWOvWPjvZ+SlO9lJSZG0YiYi6LMX98qbx+NIEF
DSlehQiMwmeRLot7BghmYZkk5KYJKsVQDZRxCjORJBRHLo8zxjsdi0REePaR3obcCihfi2RVseA0
w7Xi0Ak+SyiLMh4BU3uggUxItuBMFUj4QFqvqUJpbUmi80Au9BbdhUWPRPbYY2w3No9DwmikQWU0
TFgQI4aCjVijlhIhSShglnscRHTBkpDmpRqRFUW1bmmSAEqmIEISBUpElBOOEpR5zEokOLmGZnRJ
+SZLVgQpBjECXEmVSmSmLOQOVMZ0gQQeL890wSKj+PiBkCiYIceF2BrTBCeVZNUiZw7dBWJxpnVB
+JnsPkpVc2b7Dv0NUEsBAh4DFAAAAAgATZR/QHlmdcflBAAAUwgAAAwAGAAAAAAAAQAAAKSBAAAA
AHNwYW0teDEubWJveFVUBQADETJ3T3V4CwABBOgDAAAEZAAAAFBLBQYAAAAAAQABAFIAAAArBQAA
AAA=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>71117</attachid>
            <date>2012-05-15 20:11:28 +0000</date>
            <delta_ts>2012-05-15 20:11:28 +0000</delta_ts>
            <desc>Message saved from kmail Version 1.13.6</desc>
            <filename>k2-0001.mbox</filename>
            <type>application/mbox</type>
            <size>1110</size>
            <attacher name="Thomas Arend">thomas</attacher>
            
              <data encoding="base64">RnJvbSB0aG9tYXNAYXJlbmQtcmhiLmRlIFR1ZSBNYXkgMTUgMjI6MDE6NDEgMjAxMgpSZXR1cm4t
UGF0aDogPHRob21hc0BhcmVuZ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dGVudC1UcmFuc2Zlci1FbmNvZGluZzogN2JpdApNZXNzYWdlLUlkOiA8MjAxMjA1MTUyMDAxNDIu
MUEwNUUyOEE4QkBrMi5hcmVuZC50a3NkPgpGcm9tOiB0aG9tYXNAYXJlbmQtcmhiLmRlIChUaG9t
YXMgQXJlbmQpClgtVUlETDogTVJGISFKV2MiIThLaCIhOWskIyEKU3RhdHVzOiBSClgtU3RhdHVz
OiBOClgtS01haWwtRW5jcnlwdGlvblN0YXRlOiAgClgtS01haWwtU2lnbmF0dXJlU3RhdGU6ICAK
WC1LTWFpbC1NRE4tU2VudDogIAoKdGVzdAoK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>71118</attachid>
            <date>2012-05-15 20:15:25 +0000</date>
            <delta_ts>2012-05-15 20:15:25 +0000</delta_ts>
            <desc>Message saved from kmail Version 4.8.3</desc>
            <filename>x1-0001.mbox</filename>
            <type>application/mbox</type>
            <size>1032</size>
            <attacher name="Thomas Arend">thomas</attacher>
            
              <data encoding="base64">RnJvbSB0aG9tYXNAYXJlbmQtcmhiLmRlIFR1ZSwgMTUgTWF5IDIwMTIgMjI6MDE6NDEgKzAyMDAK
UmV0dXJuLVBhdGg6IDx0aG9tYXNAYXJlbmQtcmhiLmRlPgpYLVNwYW0tQ2hlY2tlci1WZXJzaW9u
OiBTcGFtQXNzYXNzaW4gMy4zLjEgKDIwMTAtMDMtMTYpIG9uIGsyLmFyZW5kLnRrc2QKWC1TcGFt
LUxldmVsOiAKWC1TcGFtLVN0YXR1czogTm8sIHNjb3JlPS0xLjIgcmVxdWlyZWQ9NC41IHRlc3Rz
PUFXTCxCQVlFU18wMCxOT19SRUxBWVMKCWF1dG9sZWFybj1oYW0gdmVyc2lvbj0zLjMuMQpYLVNw
YW0tU3BhbW15OiAwLjk1Ny01NjQ2LS0xODU3aC0xMzYxNXMtLTBkLS1IQ29udGVudC1UcmFuc2Zl
ci1FbmNvZGluZzo3Yml0LAoJ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