Summary: | mbox import doesn't seem to respect mail status flags of YAM mbox | ||
---|---|---|---|
Product: | [Unmaintained] kmail | Reporter: | Martin Steigerwald <Martin> |
Component: | kmailcvt | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | FreeBSD | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Martin Steigerwald
2005-10-23 12:04:06 UTC
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. 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't detect the correct charset. */ QCString seperate; + QString x_status_flag = ""; /* check if the first line start with "From " (and not "From: ") and discard the line * in this case because some IMAP servers (e.g. Cyrus) don't accept this header line */ @@ -89,14 +90,21 @@ tmp.file()->writeBlock( input, l ); while ( ! mbox.atEnd() && (l = mbox.readLine(input.data(),MAX_LINE)) && ((seperate = input.data()).left(5) != "From ")) { - tmp.file()->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()->writeBlock( input, l ); + + if ((seperate = input.data()).left(10) == "X-Status: ") { + x_status_flag = seperate; + x_status_flag.remove("X-Status: "); + x_status_flag = x_status_flag.stripWhiteSpace(); + // qDebug("x_status_flag: %s", 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->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 ); *** Bug has been marked as fixed ***. I finally got around to test this. Appears to work nicely with YAM 2.5 and KMail 1.9.9! Thanks a lot. |