<?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>114923</bug_id>
          
          <creation_ts>2005-10-23 12:04:06 +0000</creation_ts>
          <short_desc>mbox import doesn&apos;t seem to respect mail status flags of YAM mbox</short_desc>
          <delta_ts>2009-03-19 00:30:42 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>kmail</product>
          <component>kmailcvt</component>
          <version>unspecified</version>
          <rep_platform>Debian testing</rep_platform>
          <op_sys>FreeBSD</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>wishlist</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Martin Steigerwald">Martin</reporter>
          <assigned_to name="kdepim bugs">pim-bugs-null</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>383807</commentid>
    <comment_count>0</comment_count>
    <who name="Martin Steigerwald">Martin</who>
    <bug_when>2005-10-23 12:04:06 +0000</bug_when>
    <thetext>Version:           3 (using KDE KDE 3.4.2)
Installed from:    Debian testing/unstable Packages
OS:                FreeBSD

Hello, I imported two mbox files that were created with YAM (http://www.yam.ch), development version 2005-10-12. 

The mails were imported nicely, but KMailCVT does not seem to honour mail status flags. Most emails in this mbox file are marked as being read, but in the newly created MBOX-? folder in KMail all mails are marked as being unread.

As far as I know YAM uses a standard format for mail status flags. Here is an example:

-----------------------------------------------------
From [... email address ...] Mon Sep 17 09:26:09 2001
Status: RO
X-Status: R
Return-path: [...]
Envelope-to: [...]
Delivery-date: Mon, 17 Sep 2001 11:26:09 +0200
Received: [...]
Received: [...]
Message-ID: [...]
From: [...]
To: [...]
Subject: [...]
Date: Mon, 17 Sep 2001 05:26:09 -0400
MIME-Version: 1.0
X-Mailer: [...]
Content-Type: text/plain;
 charset=&quot;iso-8859-1&quot;

[mailtext] 
-----------------------------------------------------

(see Status: and X-Status lines, where Status: should be official standard)

This is with:

martin@deepdance:~ -&gt; kmailcvt --version
Qt: 3.3.5
KDE: 3.4.2
KMailCVT: 3

I like KMailCVT to support these flags. I do not like to have every mail I import marked as being unread. Well I read them, even when in a different email application. ;)

Tell me if you need any further information or if you want someone to test mbox import with mail status flags. I have enough test material at hand ;-).

Regards, Martin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>383983</commentid>
    <comment_count>1</comment_count>
    <who name="Danny Kukawka">danny.kukawka</who>
    <bug_when>2005-10-23 23:23:31 +0000</bug_when>
    <thetext>could you provide all possible Flags for Status/X-Status used by YAM and the mean of the Flag? Please also send me (direct) a testbox with some messages in all known Flags.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>464287</commentid>
    <comment_count>2</comment_count>
    <who name="Danny Kukawka">danny.kukawka</who>
    <bug_when>2006-08-29 18:40:24 +0000</bug_when>
    <thetext>SVN commit 578568 by dkukawka:

Added support to read X-Status from mails while import mbox 
and set correct state back to the imported mails in KMail

CCBUG:114923



 M  +18 -10    filter_mbox.cxx  


--- branches/KDE/3.5/kdepim/kmailcvt/filter_mbox.cxx #578567:578568
@@ -77,6 +77,7 @@
                 * get Unicode/UTF-email but KMail can&apos;t detect the correct charset.
                 */
                 QCString seperate;
+		QString x_status_flag = &quot;&quot;;
 
 		/* check if the first line start with &quot;From &quot; (and not &quot;From: &quot;) and discard the line 
 		 * in this case because some IMAP servers (e.g. Cyrus) don&apos;t accept this header line */
@@ -89,14 +90,21 @@
 	                tmp.file()-&gt;writeBlock( input, l );
 
                 while ( ! mbox.atEnd() &amp;&amp;  (l = mbox.readLine(input.data(),MAX_LINE)) &amp;&amp; ((seperate = input.data()).left(5) != &quot;From &quot;)) {
-                       tmp.file()-&gt;writeBlock( input, l );
-                       
-                       // workaround to fix hang if a corrupted mbox contains some 
-                       // binary data, for more see bug #106796
-                       if (mbox.at() == filepos)
-                           mbox.at(mbox.size());
-                       else 
-                           filepos = mbox.at();
+			tmp.file()-&gt;writeBlock( input, l );
+
+			if ((seperate = input.data()).left(10) == &quot;X-Status: &quot;) {
+				x_status_flag = seperate;
+				x_status_flag.remove(&quot;X-Status: &quot;);
+				x_status_flag = x_status_flag.stripWhiteSpace();
+				// qDebug(&quot;x_status_flag: %s&quot;, x_status_flag.latin1() );		
+			}
+
+			// workaround to fix hang if a corrupted mbox contains some 
+			// binary data, for more see bug #106796
+			if (mbox.at() == filepos)
+			   mbox.at(mbox.size());
+			else 
+			   filepos = mbox.at();
                 }
                 tmp.close();
                 first_msg = false;
@@ -106,9 +114,9 @@
                 * addMessage_fastImport == new function, faster and no check for duplicates
                 */
                 if(info-&gt;removeDupMsg)
-                    addMessage( info, folderName, tmp.name() );
+                    addMessage( info, folderName, tmp.name(), x_status_flag );
                 else
-                    addMessage_fastImport( info, folderName, tmp.name() );
+                    addMessage_fastImport( info, folderName, tmp.name(), x_status_flag );
 
                 tmp.unlink();
                 int currentPercentage = (int) ( ( (float) mbox.at() / filenameInfo.size() ) * 100 );
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>467893</commentid>
    <comment_count>3</comment_count>
    <who name="Danny Kukawka">danny.kukawka</who>
    <bug_when>2006-09-08 12:52:15 +0000</bug_when>
    <thetext>*** Bug has been marked as fixed ***.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>589986</commentid>
    <comment_count>4</comment_count>
    <who name="Martin Steigerwald">Martin</who>
    <bug_when>2008-03-28 13:42:16 +0000</bug_when>
    <thetext>I finally got around to test this. Appears to work nicely with YAM 2.5 and KMail 1.9.9! Thanks a lot.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>