summaryrefslogtreecommitdiffstats
path: root/kmailcvt
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /kmailcvt
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmailcvt')
-rw-r--r--kmailcvt/Makefile.am51
-rw-r--r--kmailcvt/README46
-rw-r--r--kmailcvt/cr16-app-kmailcvt.pngbin0 -> 1128 bytes
-rw-r--r--kmailcvt/cr32-app-kmailcvt.pngbin0 -> 2481 bytes
-rw-r--r--kmailcvt/cr48-app-kmailcvt.pngbin0 -> 6035 bytes
-rw-r--r--kmailcvt/filter_evolution.cxx201
-rw-r--r--kmailcvt/filter_evolution.hxx45
-rw-r--r--kmailcvt/filter_evolution_v2.cxx231
-rw-r--r--kmailcvt/filter_evolution_v2.hxx43
-rw-r--r--kmailcvt/filter_kmail_maildir.cxx218
-rw-r--r--kmailcvt/filter_kmail_maildir.hxx43
-rw-r--r--kmailcvt/filter_lnotes.cxx158
-rw-r--r--kmailcvt/filter_lnotes.hxx53
-rw-r--r--kmailcvt/filter_mailapp.cxx169
-rw-r--r--kmailcvt/filter_mailapp.hxx36
-rw-r--r--kmailcvt/filter_mbox.cxx145
-rw-r--r--kmailcvt/filter_mbox.hxx37
-rw-r--r--kmailcvt/filter_oe.cxx430
-rw-r--r--kmailcvt/filter_oe.hxx84
-rw-r--r--kmailcvt/filter_opera.cxx158
-rw-r--r--kmailcvt/filter_opera.hxx37
-rw-r--r--kmailcvt/filter_outlook.cxx62
-rw-r--r--kmailcvt/filter_outlook.hxx38
-rw-r--r--kmailcvt/filter_plain.cxx88
-rw-r--r--kmailcvt/filter_plain.hxx37
-rw-r--r--kmailcvt/filter_pmail.cxx346
-rw-r--r--kmailcvt/filter_pmail.hxx76
-rw-r--r--kmailcvt/filter_sylpheed.cxx228
-rw-r--r--kmailcvt/filter_sylpheed.hxx47
-rw-r--r--kmailcvt/filter_thebat.cxx231
-rw-r--r--kmailcvt/filter_thebat.hxx42
-rw-r--r--kmailcvt/filter_thunderbird.cxx234
-rw-r--r--kmailcvt/filter_thunderbird.hxx42
-rw-r--r--kmailcvt/filters.cxx213
-rw-r--r--kmailcvt/filters.hxx143
-rw-r--r--kmailcvt/kimportpage.cpp33
-rw-r--r--kmailcvt/kimportpage.h30
-rw-r--r--kmailcvt/kimportpagedlg.ui207
-rw-r--r--kmailcvt/kmailcvt.cpp76
-rw-r--r--kmailcvt/kmailcvt.h43
-rw-r--r--kmailcvt/kselfilterpage.cpp98
-rw-r--r--kmailcvt/kselfilterpage.h41
-rw-r--r--kmailcvt/kselfilterpagedlg.ui144
-rw-r--r--kmailcvt/main.cpp55
-rw-r--r--kmailcvt/pics/Makefile.am3
-rw-r--r--kmailcvt/pics/step1.pngbin0 -> 30045 bytes
-rw-r--r--kmailcvt/samples/cygwin.mbox1140
-rw-r--r--kmailcvt/samples/evolution/evolution_1.4.x.tar.bz2bin0 -> 87779 bytes
-rw-r--r--kmailcvt/samples/evolution/evolution_2.2.x.tar.bz2bin0 -> 77480 bytes
-rw-r--r--kmailcvt/samples/oe/CREDITS1
-rw-r--r--kmailcvt/samples/oe/test1.mbxbin0 -> 713 bytes
-rw-r--r--kmailcvt/samples/oe/test2.dbxbin0 -> 3578 bytes
-rw-r--r--kmailcvt/samples/oe/test3.mbxbin0 -> 3578 bytes
-rw-r--r--kmailcvt/samples/oe/test4.dbxbin0 -> 142036 bytes
-rw-r--r--kmailcvt/samples/oe/test5.mbxbin0 -> 142036 bytes
-rw-r--r--kmailcvt/samples/oe6/OutlookExpress6.tar.bz2bin0 -> 36547 bytes
-rw-r--r--kmailcvt/samples/pmail/pmail.tar.bz2bin0 -> 53024 bytes
-rw-r--r--kmailcvt/samples/sylpheed/sylpheed.tar.bz2bin0 -> 58534 bytes
-rw-r--r--kmailcvt/samples/thebat/the_bat-Inbox.tar.bz2bin0 -> 11775 bytes
-rw-r--r--kmailcvt/uninstall.desktop2
60 files changed, 5885 insertions, 0 deletions
diff --git a/kmailcvt/Makefile.am b/kmailcvt/Makefile.am
new file mode 100644
index 000000000..2ae9b9169
--- /dev/null
+++ b/kmailcvt/Makefile.am
@@ -0,0 +1,51 @@
+
+bin_PROGRAMS = kmailcvt
+kmailcvt_SOURCES = kimportpagedlg.ui kimportpage.cpp kselfilterpagedlg.ui \
+ kselfilterpage.cpp filters.cxx filter_oe.cxx kmailcvt.cpp \
+ main.cpp filter_pmail.cxx filter_plain.cxx filter_outlook.cxx \
+ filter_mbox.cxx filter_evolution.cxx filter_mailapp.cxx \
+ filter_evolution_v2.cxx filter_opera.cxx filter_thunderbird.cxx \
+ filter_kmail_maildir.cxx filter_sylpheed.cxx filter_thebat.cxx \
+ filter_lnotes.cxx
+
+kmailcvt_LDADD = $(LIB_KFILE)
+
+EXTRA_DIST = main.cpp kmailcvt.cpp kimportpage.cpp kimportpage.h \
+ kselfilterpage.cpp kselfilterpage.h kmailcvt.h \
+ kmailcvt.desktop filter_oe.cxx filter_oe.hxx \
+ filters.cxx filters.hxx \
+ PAB_format.html sv9429424.gif \
+ filter_pmail.cxx filter_pmail.hxx \
+ filter_plain.cxx filter_plain.hxx \
+ filter_mbox.cxx filter_mbox.hxx \
+ filter_evolution.cxx filter_evolution.hxx \
+ filter_mailapp.hxx filter_mailapp.cxx \
+ filter_opera.hxx filter_opera.cxx \
+ filter_evolution_v2.hxx filter_evolution_v2.cxx \
+ filter_thunderbird.hxx filter_thunderbird.cxx \
+ filter_kmail_maildir.hxx filter_kmail_maildir.cxx \
+ filter_sylpheed.hxx filter_sylpheed.cxx \
+ filter_thebat.hxx filter_thebat.cxx filter_lnotes.hxx filter_lnotes.cxx
+
+install-data-local: uninstall.desktop
+ $(mkinstalldirs) $(DESTDIR)$(kde_appsdir)/Utilities
+ $(INSTALL_DATA) $(srcdir)/uninstall.desktop $(DESTDIR)$(kde_appsdir)/Utilities/kmailcvt.desktop
+
+SUBDIRS = pics
+
+# set the include path for X, qt and KDE
+INCLUDES= $(all_includes)
+
+kmailcvt_METASOURCES = AUTO
+
+# the library search path.
+kmailcvt_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+
+KDE_ICON=AUTO
+
+messages: rc.cpp
+ LIST=`find . -name \*.h -o -name \*.hh -o -name \*.H -o -name \*.hxx -o -name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name \*.cxx -o -name \*.ecpp -o -name \*.C`; \
+ if test -n "$$LIST"; then \
+ $(XGETTEXT) $$LIST -o $(podir)/kmailcvt.pot; \
+ fi
+
diff --git a/kmailcvt/README b/kmailcvt/README
new file mode 100644
index 000000000..dbdf247a8
--- /dev/null
+++ b/kmailcvt/README
@@ -0,0 +1,46 @@
+The KDE Mail Import tool - KMailCVT
+===================================
+
+This directory contains the sources for the kmailcvt program. It communicates
+with KMail via its DCOP interface to add messages.
+
+Writing a filter
+----------------
+
+...is very easy. Create two files filter_myformat.cxx and filter_myformat.hxx
+and add "filter_myformat.cxx" to the end of the kmailcvt_SOURCES line in
+Makefile.am and "filter_myformat.cxx filter_myformat.hxx" to the end of the
+EXTRA_DIST line in Makefile.am. Now run "make -f Makefile.cvs; ./configure" in
+your kdepim source directory.
+
+In the import method of your filter you are passed a FilterInfo object. This has
+the following methods that you may want to use:
+
+ void setFrom( const QString& from ); // Set to file importing from
+ void setTo( const QString& to ); // Set to folder importing into
+ void setCurrent( const QString& current ); // What we are doing
+ void setCurrent( int percent = 0 ); // Set percentage of current file
+ void setOverall( int percent = 0 ); // Set overall percentage
+ void addLog( const QString& log ); // Add a message for the user to see
+ void alert( const QString& message ); // Tell user something has gone wrong
+ QWidget *parent(); // The parent widget
+
+ bool removeDupMsg; // true, if user selected 'remove duplicated messages'
+
+Also, every now and again you should check to see if the shouldTerminate method
+returns true, if it does the user has pressed cancel and your import method
+should return.
+
+To add messages, extract the email (including all headers) into a KTempFile.
+Then use the following:
+
+if(info->removeDupMsg) addMessage( info, folderName, tempfilepath );
+else addMessage_fastImport( info, folderName, tempfilepath );
+
+For a simple example, look at filter_plain
+
+Finally for the filter to appear in the combo box in the wizard you need to edit
+kselfilterpage.cpp and add an appropriate addFilter() function call.
+
+Danny Kukawka, February 2005
+Laurence Anderson, April 2003.
diff --git a/kmailcvt/cr16-app-kmailcvt.png b/kmailcvt/cr16-app-kmailcvt.png
new file mode 100644
index 000000000..167b4b3cd
--- /dev/null
+++ b/kmailcvt/cr16-app-kmailcvt.png
Binary files differ
diff --git a/kmailcvt/cr32-app-kmailcvt.png b/kmailcvt/cr32-app-kmailcvt.png
new file mode 100644
index 000000000..e6595ea0a
--- /dev/null
+++ b/kmailcvt/cr32-app-kmailcvt.png
Binary files differ
diff --git a/kmailcvt/cr48-app-kmailcvt.png b/kmailcvt/cr48-app-kmailcvt.png
new file mode 100644
index 000000000..2a24ce63f
--- /dev/null
+++ b/kmailcvt/cr48-app-kmailcvt.png
Binary files differ
diff --git a/kmailcvt/filter_evolution.cxx b/kmailcvt/filter_evolution.cxx
new file mode 100644
index 000000000..20a68d0b4
--- /dev/null
+++ b/kmailcvt/filter_evolution.cxx
@@ -0,0 +1,201 @@
+/*
+ * filter_evolution.cxx
+ * Author : Simon MARTIN <simartin@users.sourceforge.net>
+ * Copyright (c) 2004 Simon MARTIN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "filter_evolution.hxx"
+
+#include <config.h>
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <ktempfile.h>
+
+
+/** Default constructor. */
+FilterEvolution::FilterEvolution(void) :
+ Filter(i18n("Import Evolution 1.x Local Mails and Folder Structure"),
+ "Simon MARTIN<br /><br />( Filter accelerated by Danny Kukawka )",
+ i18n("<p><b>Evolution 1.x import filter</b></p>"
+ "<p>Select the base directory of Evolution's mails (usually ~/evolution/local).</p>"
+ "<p>Since it is possible to recreate the folder structure, the folders "
+ "will be stored under: \"Evolution-Import\".</p>"))
+{}
+
+/** Destructor. */
+FilterEvolution::~FilterEvolution(void)
+{
+ endImport();
+}
+
+/** Recursive import of Evolution's mboxes. */
+void FilterEvolution::import(FilterInfo *info)
+{
+ // We ask the user to choose Evolution's root directory.
+ QString evolDir = QDir::homeDirPath() + "/evolution/local";
+ QDir d( evolDir );
+ if ( !d.exists() ) {
+ evolDir = QDir::homeDirPath();
+ }
+
+ mailDir = KFileDialog::getExistingDirectory(evolDir, info->parent());
+
+ if (mailDir.isEmpty()) {
+ info->alert(i18n("No directory selected."));
+ }
+ /**
+ * If the user only select homedir no import needed because
+ * there should be no files and we surely import wrong files.
+ */
+ else if ( mailDir == QDir::homeDirPath() || mailDir == (QDir::homeDirPath() + "/")) {
+ info->addLog(i18n("No files found for import."));
+ } else {
+ info->setOverall(0);
+ // Recursive import of the MBoxes.
+ QDir dir(mailDir);
+ QStringList rootSubDirs = dir.entryList("[^\\.]*", QDir::Dirs, QDir::Name); // Removal of . and ..
+ int currentDir = 1, numSubDirs = rootSubDirs.size();
+ for(QStringList::Iterator filename = rootSubDirs.begin() ; filename != rootSubDirs.end() ; ++filename, ++currentDir) {
+ importDirContents(info, dir.filePath(*filename), *filename, QString::null);
+ info->setOverall((int) ((float) currentDir / numSubDirs * 100));
+ }
+ }
+ info->addLog( i18n("Finished importing emails from %1").arg( mailDir ));
+ info->setCurrent(100);
+ info->setOverall(100);
+}
+
+/**
+ * Import of a directory contents.
+ * @param info Information storage for the operation.
+ * @param dirName The name of the directory to import.
+ * @param KMailRootDir The directory's root directory in KMail's folder structure.
+ * @param KMailSubDir The directory's direct ancestor in KMail's folder structure.
+ */
+void FilterEvolution::importDirContents(FilterInfo *info, const QString& dirName, const QString& KMailRootDir, const QString& KMailSubDir)
+{
+ // If there is a mbox, we import it
+ QDir dir(dirName);
+ if(dir.exists("mbox")) {
+ importMBox(info, dirName + "/mbox", KMailRootDir, KMailSubDir);
+ }
+ // If there are subfolders, we import them one by one
+ if(dir.exists("subfolders")) {
+ QDir subfolders(dirName + "/subfolders");
+ QStringList subDirs = subfolders.entryList("[^\\.]*", QDir::Dirs, QDir::Name);
+ for(QStringList::Iterator filename = subDirs.begin() ; filename != subDirs.end() ; ++filename) {
+ QString kSubDir;
+ if(!KMailSubDir.isNull()) {
+ kSubDir = KMailSubDir + "/" + *filename;
+ } else {
+ kSubDir = *filename;
+ }
+ importDirContents(info, subfolders.filePath(*filename), KMailRootDir, kSubDir);
+ }
+ }
+}
+
+/**
+ * Import of a MBox file.
+ * @param info Information storage for the operation.
+ * @param dirName The MBox's name.
+ * @param KMailRootDir The directory's root directory in KMail's folder structure.
+ * @param KMailSubDir The directory's equivalent in KMail's folder structure. *
+ */
+void FilterEvolution::importMBox(FilterInfo *info, const QString& mboxName, const QString& rootDir, const QString& targetDir)
+{
+ QFile mbox(mboxName);
+ bool first_msg = true;
+ QString tmp_from = mboxName;
+ if (!mbox.open(IO_ReadOnly)) {
+ info->alert(i18n("Unable to open %1, skipping").arg(mboxName));
+ } else {
+ QFileInfo filenameInfo(mboxName);
+
+ info->setCurrent(0);
+ if( mboxName.length() > 20 ) {
+ QString tmp_info = mboxName;
+ tmp_info = tmp_info.replace( mailDir, ".." );
+ if (tmp_info.contains("subfolders/"))
+ tmp_info.remove("subfolders/");
+ info->setFrom( tmp_info );
+ tmp_from = tmp_info;
+ } else
+ info->setFrom(mboxName);
+ if(targetDir.contains("subfolders/")) {
+ QString tmp_info = targetDir;
+ tmp_info.remove("subfolders/");
+ info->setTo(tmp_info);
+ } else
+ info->setTo(targetDir);
+
+ info->addLog(i18n("Importing emails from %1...").arg(tmp_from));
+
+ QByteArray input(MAX_LINE);
+ long l = 0;
+
+ while (!mbox.atEnd()) {
+ KTempFile tmp;
+ /* comment by Danny:
+ * Don't use QTextStream to read from mbox, etter use QDataStream. QTextStream only
+ * support Unicode/Latin1/Locale. So you lost information from emails with
+ * charset!=Unicode/Latin1/Locale (e.g. KOI8-R) and Content-Transfer-Encoding != base64
+ * (e.g. 8Bit). It also not help to convert the QTextStream to Unicode. By this you
+ * get Unicode/UTF-email but KMail can't detect the correct charset.
+ */
+ QCString seperate;
+
+ if(!first_msg)
+ tmp.file()->writeBlock( input, l );
+ l = mbox.readLine( input.data(),MAX_LINE); // read the first line, prevent "From "
+ 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 );
+ }
+ tmp.close();
+ first_msg = false;
+
+ QString destFolder = rootDir;
+ if(!targetDir.isNull()) {
+ destFolder = "Evolution-Import/" + destFolder + "/" + targetDir;
+ } else {
+ destFolder = "Evolution-Import/" + destFolder;
+ }
+
+ /* comment by Danny Kukawka:
+ * addMessage() == old function, need more time and check for duplicates
+ * addMessage_fastImport == new function, faster and no check for duplicates
+ */
+ if(info->removeDupMsg)
+ addMessage( info, destFolder, tmp.name() );
+ else
+ addMessage_fastImport( info, destFolder, tmp.name() );
+
+ tmp.unlink();
+ int currentPercentage = (int) (((float) mbox.at() / filenameInfo.size()) * 100);
+ info->setCurrent(currentPercentage);
+ if (info->shouldTerminate()) return;
+ }
+
+ if (count_duplicates > 0) {
+ info->addLog( i18n("1 duplicate message not imported", "%n duplicate messages not imported", count_duplicates));
+ }
+ count_duplicates = 0;
+ mbox.close();
+ }
+}
diff --git a/kmailcvt/filter_evolution.hxx b/kmailcvt/filter_evolution.hxx
new file mode 100644
index 000000000..159332d29
--- /dev/null
+++ b/kmailcvt/filter_evolution.hxx
@@ -0,0 +1,45 @@
+/*
+ * filter_evolution.hxx
+ * Author : Simon MARTIN <simartin@users.sourceforge.net>
+ * Copyright (c) 2004 Simon MARTIN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FILTER_EVOLUTION_HXX
+#define FILTER_EVOLUTION_HXX
+
+#include "filters.hxx"
+
+/**
+ * Imports Evolution mboxes recursively, keeping the folder structure.
+ * @author Simon MARTIN
+ */
+class FilterEvolution : public Filter
+{
+public:
+ FilterEvolution(void);
+ ~FilterEvolution(void);
+
+ void import(FilterInfo *info);
+
+private:
+ QString mailDir;
+
+ void importDirContents(FilterInfo*, const QString&, const QString&, const QString&);
+ void importMBox(FilterInfo*, const QString&, const QString&, const QString&);
+};
+
+#endif
diff --git a/kmailcvt/filter_evolution_v2.cxx b/kmailcvt/filter_evolution_v2.cxx
new file mode 100644
index 000000000..51ae798f2
--- /dev/null
+++ b/kmailcvt/filter_evolution_v2.cxx
@@ -0,0 +1,231 @@
+/***************************************************************************
+ filter_evolution_v2.cxx - Evolution 2.0.x mail import
+ -------------------
+ begin : Januar 26 2005
+ copyright : (C) 2005 by Danny Kukawka
+ (inspired and partly copied from filter_evolution)
+ email : danny.kukawka@web.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "filter_evolution_v2.hxx"
+
+#include <config.h>
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <ktempfile.h>
+
+
+/** Default constructor. */
+FilterEvolution_v2::FilterEvolution_v2(void) :
+ Filter(i18n("Import Evolution 2.x Local Mails and Folder Structure"),
+ "Danny Kukawka",
+ i18n("<p><b>Evolution 2.x import filter</b></p>"
+ "<p>Select the base directory of your local Evolution mailfolder (usually ~/.evolution/mail/local/).</p>"
+ "<p><b>Note:</b> Never choose a Folder which <u>does not</u> contain mbox-files (for example "
+ "a maildir): if you do, you will get many new folders.</p>"
+ "<p>Since it is possible to recreate the folder structure, the folders "
+ "will be stored under: \"Evolution-Import\".</p>"))
+{}
+
+/** Destructor. */
+FilterEvolution_v2::~FilterEvolution_v2(void)
+{
+ endImport();
+}
+
+/** Recursive import of Evolution's mboxes. */
+void FilterEvolution_v2::import(FilterInfo *info)
+{
+ /**
+ * We ask the user to choose Evolution's root directory.
+ * This should be usually ~/.evolution/mail/local/
+ */
+ QString evolDir = QDir::homeDirPath() + "/.evolution/mail/local";
+ QDir d( evolDir );
+ if ( !d.exists() ) {
+ evolDir = QDir::homeDirPath();
+ }
+
+ //QString mailDir = KFileDialog::getExistingDirectory(QDir::homeDirPath(), info->parent());
+ KFileDialog *kfd;
+ kfd = new KFileDialog( evolDir, "", 0, "kfiledialog", true );
+ kfd->setMode(KFile::Directory | KFile::LocalOnly);
+ kfd->exec();
+ mailDir = kfd->selectedFile();
+
+ if (mailDir.isEmpty()) {
+ info->alert(i18n("No directory selected."));
+ }
+ /**
+ * If the user only select homedir no import needed because
+ * there should be no files and we surely import wrong files.
+ */
+ else if ( mailDir == QDir::homeDirPath() || mailDir == (QDir::homeDirPath() + "/")) {
+ info->addLog(i18n("No files found for import."));
+ } else {
+ info->setOverall(0);
+
+ /** Recursive import of the MailArchives */
+ QDir dir(mailDir);
+ QStringList rootSubDirs = dir.entryList("[^\\.]*", QDir::Dirs, QDir::Name); // Removal of . and ..
+ int currentDir = 1, numSubDirs = rootSubDirs.size();
+ for(QStringList::Iterator dirname = rootSubDirs.begin() ; dirname != rootSubDirs.end() ; ++dirname, ++currentDir) {
+ if (info->shouldTerminate()) break;
+ importDirContents(info, false, dir.filePath(*dirname), *dirname, *dirname);
+ info->setOverall((int) ((float) currentDir / numSubDirs * 100));
+ }
+
+ /** import last but not least all archives from the root-dir */
+ importDirContents(info, true, mailDir, QString::null, QString::null);
+
+ info->addLog( i18n("Finished importing emails from %1").arg( mailDir ));
+ if(count_duplicates > 0) {
+ info->addLog( i18n("1 duplicate message not imported", "%n duplicate messages not imported", count_duplicates));
+ }
+ if (info->shouldTerminate()) info->addLog( i18n("Finished import, canceled by user."));
+ }
+ info->setCurrent(100);
+ info->setOverall(100);
+}
+
+/**
+ * Import of a directory contents.
+ * @param info Information storage for the operation.
+ * @param root if this is the rootdir or not
+ * @param dirName The name of the directory to import.
+ * @param KMailRootDir The directory's root directory in KMail's folder structure.
+ * @param KMailSubDir The directory's direct ancestor in KMail's folder structure.
+ */
+void FilterEvolution_v2::importDirContents(FilterInfo *info, bool root,
+ const QString& dirName, const QString& KMailRootDir, const QString& KMailSubDir)
+{
+ if (info->shouldTerminate()) return;
+
+ /** Here Import all archives in the current dir */
+ QDir dir(dirName);
+
+ QDir importDir (dirName);
+ QStringList files = importDir.entryList("[^\\.]*", QDir::Files, QDir::Name);
+ for ( QStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile) {
+ if (info->shouldTerminate()) break;
+ QString temp_mailfile = *mailFile;
+ if (temp_mailfile.endsWith(".cmeta") || temp_mailfile.endsWith(".ev-summary") || temp_mailfile.endsWith(".ev-summary-meta") ||
+ temp_mailfile.endsWith(".ibex.index") || temp_mailfile.endsWith(".ibex.index.data") ) {}
+ else {
+ info->addLog( i18n("Start import file %1...").arg( temp_mailfile ) );
+ if (!root)
+ importMBox(info, (dirName + "/" + temp_mailfile) , KMailRootDir, KMailSubDir);
+ else
+ importMBox(info, dirName + temp_mailfile , temp_mailfile, QString::null);
+ }
+ }
+
+ if (!root) {
+ /** If there are subfolders, we import them one by one */
+ QDir subfolders(dirName);
+ QStringList subDirs = subfolders.entryList("[^\\.]*", QDir::Dirs, QDir::Name);
+ for(QStringList::Iterator filename = subDirs.begin() ; filename != subDirs.end() ; ++filename) {
+ QString kSubDir;
+ if(!KMailSubDir.isNull()) {
+ kSubDir = KMailSubDir + "/" + *filename;
+ } else {
+ kSubDir = *filename;
+ }
+ importDirContents(info, false, subfolders.filePath(*filename), KMailRootDir, kSubDir);
+ }
+ }
+}
+
+/**
+ * Import of a MBox file.
+ * @param info Information storage for the operation.
+ * @param dirName The MBox's name.
+ * @param KMailRootDir The directory's root directory in KMail's folder structure.
+ * @param KMailSubDir The directory's equivalent in KMail's folder structure. *
+ */
+void FilterEvolution_v2::importMBox(FilterInfo *info, const QString& mboxName, const QString& rootDir, const QString& targetDir)
+{
+ QFile mbox(mboxName);
+ bool first_msg = true;
+ if (!mbox.open(IO_ReadOnly)) {
+ info->alert(i18n("Unable to open %1, skipping").arg(mboxName));
+ } else {
+ QFileInfo filenameInfo(mboxName);
+
+ info->setCurrent(0);
+ if( mboxName.length() > 20 ) {
+ QString tmp_info = mboxName;
+ tmp_info = tmp_info.replace( mailDir, "../" );
+ if (tmp_info.contains(".sbd"))
+ tmp_info.remove(".sbd");
+ info->setFrom( tmp_info );
+ } else
+ info->setFrom(mboxName);
+ if(targetDir.contains(".sbd")) {
+ QString tmp_info = targetDir;
+ tmp_info.remove(".sbd");
+ info->setTo(tmp_info);
+ } else
+ info->setTo(targetDir);
+
+ QByteArray input(MAX_LINE);
+ long l = 0;
+
+ while (!mbox.atEnd()) {
+ KTempFile tmp;
+ /** @todo check if the file is really a mbox, maybe search for 'from' string at start */
+ /* comment by Danny:
+ * Don't use QTextStream to read from mbox, etter use QDataStream. QTextStream only
+ * support Unicode/Latin1/Locale. So you lost information from emails with
+ * charset!=Unicode/Latin1/Locale (e.g. KOI8-R) and Content-Transfer-Encoding != base64
+ * (e.g. 8Bit). It also not help to convert the QTextStream to Unicode. By this you
+ * get Unicode/UTF-email but KMail can't detect the correct charset.
+ */
+ QCString seperate;
+
+ if(!first_msg)
+ tmp.file()->writeBlock( input, l );
+ l = mbox.readLine( input.data(),MAX_LINE); // read the first line, prevent "From "
+ 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 );
+ }
+ tmp.close();
+ first_msg = false;
+
+ QString destFolder;
+ QString _targetDir = targetDir;
+ if(!targetDir.isNull()) {
+ if(_targetDir.contains(".sbd"))
+ _targetDir.remove(".sbd");
+ destFolder += "Evolution-Import/" + _targetDir + "/" + filenameInfo.baseName(TRUE); // mboxName;
+ } else {
+ destFolder = "Evolution-Import/" + rootDir;
+ if(destFolder.contains(".sbd"))
+ destFolder.remove(".sbd");
+ }
+
+
+ if(info->removeDupMsg)
+ addMessage( info, destFolder, tmp.name() );
+ else
+ addMessage_fastImport( info, destFolder, tmp.name() );
+
+ tmp.unlink();
+ int currentPercentage = (int) (((float) mbox.at() / filenameInfo.size()) * 100);
+ info->setCurrent(currentPercentage);
+ if (info->shouldTerminate()) break;
+ }
+ mbox.close();
+ }
+}
diff --git a/kmailcvt/filter_evolution_v2.hxx b/kmailcvt/filter_evolution_v2.hxx
new file mode 100644
index 000000000..a0e297959
--- /dev/null
+++ b/kmailcvt/filter_evolution_v2.hxx
@@ -0,0 +1,43 @@
+/***************************************************************************
+ filter_evolution_v2.hxx - Evolution 2.0.x mail import
+ -------------------
+ begin : Januar 26 2005
+ copyright : (C) 2005 by Danny Kukawka
+ (inspired and partly copied from filter_evolution)
+ email : danny.kukawka@web.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef FILTER_EVOLUTION_V2_HXX
+#define FILTER_EVOLUTION_V2_HXX
+
+#include "filters.hxx"
+
+/**
+ * Imports Evolution v2.x mail folder recursively, keeping the folder structure.
+ * @author Danny Kukawka
+ */
+class FilterEvolution_v2 : public Filter
+{
+public:
+ FilterEvolution_v2(void);
+ ~FilterEvolution_v2(void);
+
+ void import(FilterInfo *info);
+
+private:
+ QString mailDir;
+
+ void importDirContents(FilterInfo*, bool, const QString&, const QString&, const QString&);
+ void importMBox(FilterInfo*, const QString&, const QString&, const QString&);
+};
+
+#endif
diff --git a/kmailcvt/filter_kmail_maildir.cxx b/kmailcvt/filter_kmail_maildir.cxx
new file mode 100644
index 000000000..02b21f600
--- /dev/null
+++ b/kmailcvt/filter_kmail_maildir.cxx
@@ -0,0 +1,218 @@
+/***************************************************************************
+ filter_kmail_maildir.cxx - Kmail maildir mail import
+ -------------------
+ begin : April 06 2005
+ copyright : (C) 2005 by Danny Kukawka
+ email : danny.kukawka@web.de
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "filter_kmail_maildir.hxx"
+
+#include <config.h>
+#include <klocale.h>
+#include <kfiledialog.h>
+
+/** Default constructor. */
+FilterKMail_maildir::FilterKMail_maildir( void ) :
+ Filter( i18n( "Import KMail Maildirs and Folder Structure" ),
+ "Danny Kukawka",
+ i18n( "<p><b>KMail import filter</b></p>"
+ "<p>Select the base directory of the KMail mailfolder you want to import.</p>"
+ "<p><b>Note:</b> Never select your current local KMail maildir (usually "
+ "~/Mail or ~/.kde/share/apps/kmail/mail ): in this case, KMailCVT may become stuck "
+ "in a continuous loop. </p>"
+ "<p>This filter does not import KMail mailfolders with mbox files.</p>"
+ "<p>Since it is possible to recreate the folder structure, the folders "
+ "will be stored under: \"KMail-Import\" in your local folder.</p>" ) )
+{}
+
+/** Destructor. */
+FilterKMail_maildir::~FilterKMail_maildir( void )
+{
+ endImport();
+}
+
+/** Recursive import of KMail maildir. */
+void FilterKMail_maildir::import( FilterInfo *info )
+{
+
+ QString _homeDir = QDir::homeDirPath();
+
+ KFileDialog *kfd;
+ kfd = new KFileDialog( _homeDir, "", 0, "kfiledialog", true );
+ kfd->setMode( KFile::Directory | KFile::LocalOnly );
+ kfd->exec();
+ mailDir = kfd->selectedFile();
+
+ if ( mailDir.isEmpty() ) {
+ info->alert( i18n( "No directory selected." ) );
+ }
+ /**
+ * If the user only select homedir no import needed because
+ * there should be no files and we surely import wrong files.
+ */
+ else if ( mailDir == QDir::homeDirPath() || mailDir == ( QDir::homeDirPath() + "/" ) ) {
+ info->addLog( i18n( "No files found for import." ) );
+ } else {
+ info->setOverall(0);
+
+ /** Recursive import of the MailArchives */
+ QDir dir(mailDir);
+ QStringList rootSubDirs = dir.entryList("*", QDir::Dirs | QDir::Hidden, QDir::Name);
+ int currentDir = 1, numSubDirs = rootSubDirs.size();
+ for(QStringList::Iterator filename = rootSubDirs.begin() ; filename != rootSubDirs.end() ; ++filename, ++currentDir) {
+ if(info->shouldTerminate()) break;
+ if(!(*filename == "." || *filename == "..")) {
+ info->setCurrent(0);
+ importDirContents(info, dir.filePath(*filename));
+ info->setOverall((int) ((float) currentDir / numSubDirs * 100));
+ info->setCurrent(100);
+ }
+ }
+ }
+
+ info->addLog( i18n("Finished importing emails from %1").arg( mailDir ));
+ if (count_duplicates > 0) {
+ info->addLog( i18n("1 duplicate message not imported", "%n duplicate messages not imported", count_duplicates));
+ }
+ if (info->shouldTerminate()) info->addLog( i18n("Finished import, canceled by user."));
+ count_duplicates = 0;
+ info->setCurrent(100);
+ info->setOverall(100);
+}
+
+/**
+ * Import of a directory contents.
+ * @param info Information storage for the operation.
+ * @param dirName The name of the directory to import.
+ */
+void FilterKMail_maildir::importDirContents( FilterInfo *info, const QString& dirName)
+{
+
+ /** Here Import all archives in the current dir */
+ importFiles(info, dirName);
+
+ /** If there are subfolders, we import them one by one */
+
+ QDir subfolders(dirName);
+ QStringList subDirs = subfolders.entryList("*", QDir::Dirs | QDir::Hidden, QDir::Name);
+ for(QStringList::Iterator filename = subDirs.begin() ; filename != subDirs.end() ; ++filename) {
+ if(info->shouldTerminate()) return;
+ if(!(*filename == "." || *filename == "..")) {
+ importDirContents(info, subfolders.filePath(*filename));
+ }
+ }
+}
+
+
+/**
+ * Extract the X-Status flag from a mailfile
+ * @param info Information storage for the operation.
+ * @param fileName The full path to the file to import
+ */
+QString FilterKMail_maildir::getMessageFlags( FilterInfo *info, const QString& fileName ) {
+
+ QString status_flag = "";
+
+ QFile mailfile( fileName );
+ if (! mailfile.open( IO_ReadOnly ) ) {
+ info->alert( i18n("Unable to open %1, skipping").arg( fileName ) );
+ return status_flag;
+ } else {
+
+ QByteArray input(MAX_LINE);
+
+ while ( !mailfile.atEnd() && status_flag.isEmpty()) {
+ QCString seperate;
+
+ while ( ! mailfile.atEnd() && mailfile.readLine(input.data(),MAX_LINE) ) {
+
+ if ((seperate = input.data()).left(10) == "X-Status: ") {
+ status_flag = seperate;
+ status_flag.remove("X-Status: ");
+ status_flag = status_flag.stripWhiteSpace();
+ // qDebug("status_flag: %s", status_flag.latin1() );
+ break;
+ }
+ }
+ }
+ mailfile.close();
+ }
+ return status_flag;
+}
+
+
+/**
+ * Import the files within a Folder.
+ * @param info Information storage for the operation.
+ * @param dirName The name of the directory to import.
+ */
+void FilterKMail_maildir::importFiles( FilterInfo *info, const QString& dirName)
+{
+
+ QDir dir(dirName);
+ QString _path;
+ bool generatedPath = false;
+
+ QDir importDir (dirName);
+ QStringList files = importDir.entryList("[^\\.]*", QDir::Files, QDir::Name);
+ int currentFile = 1, numFiles = files.size();
+ for ( QStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile, ++currentFile) {
+ if(info->shouldTerminate()) return;
+
+ QString temp_mailfile = *mailFile;
+
+ if (!(temp_mailfile.endsWith(".index") || temp_mailfile.endsWith(".index.ids") ||
+ temp_mailfile.endsWith(".index.sorted") || temp_mailfile.endsWith(".uidcache") )) {
+ if(!generatedPath) {
+ _path = "KMail-Import";
+ QString _tmp = dir.filePath(*mailFile);
+ _tmp = _tmp.remove( mailDir ,TRUE);
+ QStringList subFList = QStringList::split("/",_tmp,FALSE);
+ for ( QStringList::Iterator it = subFList.begin(); it != subFList.end(); ++it ) {
+ QString _cat = *it;
+ if(!(_cat == *mailFile)) {
+ if(_cat.startsWith(".") && _cat.endsWith(".directory")) {
+ _cat.remove(0,1);
+ _cat.remove((_cat.length() - 10), 10);
+ } else if (_cat.startsWith(".")) {
+ _cat = _cat.remove(0 , 1);
+ }
+ _path += "/" + _cat;
+ }
+ }
+ if(_path.endsWith("cur"))
+ _path.remove(_path.length() - 4 , 4);
+ QString _info = _path;
+ info->addLog(i18n("Import folder %1...").arg(_info.remove(0,12)));
+ info->setFrom(_info);
+ info->setTo(_path);
+ generatedPath = true;
+ }
+
+ QString msg_flag = getMessageFlags(info, dir.filePath(*mailFile));
+
+ if(info->removeDupMsg) {
+ if(! addMessage( info, _path, dir.filePath(*mailFile), msg_flag )) {
+ info->addLog( i18n("Could not import %1").arg( *mailFile ) );
+ }
+ info->setCurrent((int) ((float) currentFile / numFiles * 100));
+ } else {
+ if(! addMessage_fastImport( info, _path, dir.filePath(*mailFile), msg_flag )) {
+ info->addLog( i18n("Could not import %1").arg( *mailFile ) );
+ }
+ info->setCurrent((int) ((float) currentFile / numFiles * 100));
+ }
+ }
+ }
+}
+
diff --git a/kmailcvt/filter_kmail_maildir.hxx b/kmailcvt/filter_kmail_maildir.hxx
new file mode 100644
index 000000000..3ab082b4c
--- /dev/null
+++ b/kmailcvt/filter_kmail_maildir.hxx
@@ -0,0 +1,43 @@
+/***************************************************************************
+ filter_kmail_maildir.hxx - Kmail maildir mail import
+ -------------------
+ begin : April 06 2005
+ copyright : (C) 2005 by Danny Kukawka
+ email : danny.kukawka@web.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifndef FILTER_KMAIL_MAILDIR_HXX
+#define FILTER_KMAIL_MAILDIR_HXX
+
+#include "filters.hxx"
+
+/**
+ * Imports KMail mail folder with maildir format recursively, recreating the folder structure.
+ * @author Danny Kukawka
+ */
+class FilterKMail_maildir : public Filter
+{
+public:
+ FilterKMail_maildir(void);
+ ~FilterKMail_maildir(void);
+
+ void import(FilterInfo *info);
+
+private:
+ QString mailDir;
+
+ QString getMessageFlags(FilterInfo*, const QString&);
+
+ void importDirContents(FilterInfo*, const QString&);
+ void importFiles(FilterInfo*, const QString&);
+};
+
+#endif
diff --git a/kmailcvt/filter_lnotes.cxx b/kmailcvt/filter_lnotes.cxx
new file mode 100644
index 000000000..3ded11abf
--- /dev/null
+++ b/kmailcvt/filter_lnotes.cxx
@@ -0,0 +1,158 @@
+/***************************************************************************
+ filter_lnotes.cxx - Lotus Notes Structured Text mail import
+ -------------------
+ begin : Wed Feb 16, 2005
+ copyright : (C) 2005 by Robert Rockers
+ email : kconfigure@rockerssoft.com
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <config.h>
+
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <ktempfile.h>
+#include <kdebug.h>
+#include <qfileinfo.h>
+
+#include "filter_lnotes.hxx"
+
+/** Default constructor. */
+FilterLNotes::FilterLNotes() :
+ Filter( i18n("Import Lotus Notes Emails"),
+ "Robert Rockers",
+ i18n("<p><b>Lotus Notes Structured Text mail import filter</b></p>"
+ "<p>This filter will import Structured Text files from an exported Lotus Notes email "
+ "client into KMail. Use this filter if you want to import mails from Lotus or other "
+ "mailers that use the Lotus Notes Structured Text format.</p>"
+ "<p><b>Note:</b> Since it is possible to recreate the folder structure, the imported "
+ "messages will be stored in subfolders under: \"LNotes-Import\", in your local folder, "
+ "named using the names of the files the messages came from.</p>"))
+{}
+
+/** Destructor. */
+FilterLNotes::~FilterLNotes() {
+ endImport();
+}
+
+/**
+ * Recursive import of The Bat! maildir.
+ * @param info Information storage for the operation.
+ */
+void FilterLNotes::import(FilterInfo *info) {
+
+ inf = info;
+ currentFile = 1;
+ totalFiles = 0;
+
+ QStringList filenames = KFileDialog::getOpenFileNames( QDir::homeDirPath(), "*|" + i18n("All Files (*)"),
+ inf->parent() );
+ totalFiles = filenames.count();
+ inf->setOverall(0);
+
+ // See filter_mbox.cxx for better reference.
+ for ( QStringList::Iterator filename = filenames.begin(); filename != filenames.end(); ++filename ) {
+
+ ++currentFile;
+ info->addLog( i18n("Importing emails from %1").arg(*filename) );
+ ImportLNotes( *filename );
+ inf->setOverall( 100 * currentFile / totalFiles );
+ if ( info->shouldTerminate() )
+ break;
+ }
+}
+
+/**
+ * Import the files within a Folder.
+ * @param file The name of the file to import.
+ */
+void FilterLNotes::ImportLNotes(const QString& file) {
+
+ // See Filter_pmail.cxx for better reference
+
+ // Format of a Lotus Notes 5 Structured Text Document w form feed
+ // Each email begins with a custom Header Principal:
+ // The Message ends with a 0c character
+
+ // open the message
+ QFile f(file);
+
+ if (! f.open( IO_ReadOnly ) ) {
+ inf->alert( i18n("Unable to open %1, skipping").arg( file ) );
+ } else {
+
+ int ch = 0;
+ int state = 0;
+ int n = 0;
+ KTempFile *tempfile = 0;
+
+ // Get folder name
+ QFileInfo filenameInfo( file );
+ QString folder("LNotes-Import/" + filenameInfo.baseName(TRUE));
+ inf->setTo(folder);
+
+ // State machine to read the data in. The fgetc usage is probably terribly slow ...
+ while ((ch = f.getch()) >= 0) {
+ switch (state) {
+ // new message state
+ case 0:
+ // open temp output file
+ tempfile = new KTempFile;
+ state = 1;
+ inf->setCurrent(i18n("Message %1").arg(n++));
+ if ( inf->shouldTerminate() )
+ return;
+ // fall through
+
+ // inside a message state
+ case 1:
+ if (ch == 0x0c) {
+ // close file, send it
+ tempfile->close();
+
+ if(inf->removeDupMsg)
+ addMessage( inf, folder, tempfile->name() );
+ else
+ addMessage_fastImport( inf, folder, tempfile->name() );
+
+ tempfile->unlink();
+ state = 0;
+
+ int currentPercentage = (int) ( ( (float) f.at() / filenameInfo.size() ) * 100 );
+ inf->setCurrent( currentPercentage );
+ if ( inf->shouldTerminate() )
+ return;
+
+ break;
+ }
+ if (ch == 0x0d) {
+ break;
+ }
+ tempfile->file()->putch(ch);
+ break;
+ }
+ }
+
+ // did Folder end without 0x1a at the end?
+ if (state != 0) {
+ tempfile->close();
+
+ if(inf->removeDupMsg)
+ addMessage( inf, folder, tempfile->name() );
+ else
+ addMessage_fastImport( inf, folder, tempfile->name() );
+
+ tempfile->unlink();
+ delete tempfile;
+ }
+ f.close();
+ }
+}
diff --git a/kmailcvt/filter_lnotes.hxx b/kmailcvt/filter_lnotes.hxx
new file mode 100644
index 000000000..cb36273ea
--- /dev/null
+++ b/kmailcvt/filter_lnotes.hxx
@@ -0,0 +1,53 @@
+/***************************************************************************
+ filter_lnotes.hxx - Lotus Notes Structured Text mail import
+ -------------------
+ begin : Wed Feb 16, 2005
+ copyright : (C) 2005 by Robert Rockers
+ email : kconfigure@rockerssoft.com
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef FILTER_LNOTES_HXX
+#define FILTER_LNOTES_HXX
+
+#include "filters.hxx"
+
+/**imports Lotus Notes Structured Text Archives and archvies messages into KMail
+ *@author Robert Rockers
+ */
+
+class FilterLNotes : public Filter {
+
+public:
+ FilterLNotes();
+ ~FilterLNotes();
+ /** Standard import filter... starting line for our import */
+ void import(FilterInfo *info);
+
+private:
+ /** the working directory */
+ QDir dir;
+ /** Our Filterinfo stuff... important methods for getting the email imported */
+ FilterInfo * inf;
+ /** which file (of totalFiles) is now in the work? */
+ int currentFile;
+ /** total number of files that get imported */
+ int totalFiles;
+
+ /**
+ * This is were all the real action is gonna be handled.
+ * Gets called once for EACH file imported
+ */
+ void ImportLNotes(const QString& file);
+
+};
+
+#endif
diff --git a/kmailcvt/filter_mailapp.cxx b/kmailcvt/filter_mailapp.cxx
new file mode 100644
index 000000000..c6f45ced0
--- /dev/null
+++ b/kmailcvt/filter_mailapp.cxx
@@ -0,0 +1,169 @@
+/***************************************************************************
+ filter_mailapp.cxx - OS X Mail App import
+ -------------------
+ copyright : (C) 2004 by Chris Howells
+ email : howells@kde.org
+
+ Derived from code by:
+ copyright : (C) 2003 by Laurence Anderson
+ email : l.d.anderson@warwick.ac.uk
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include <config.h>
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <ktempfile.h>
+#include <kdebug.h>
+
+#include "filter_mailapp.hxx"
+
+FilterMailApp::FilterMailApp() :
+ Filter( i18n("Import From OS X Mail"),
+ "Chris Howells<br /><br />Filter accelerated by Danny Kukawka )",
+ i18n("<p><b>OS X Mail Import Filter</b></p>"
+ "<p>This filter imports e-mails from the Mail client in Apple Mac OS X.</p>"))
+{}
+
+FilterMailApp::~FilterMailApp()
+{
+ endImport();
+}
+
+void FilterMailApp::import(FilterInfo *info)
+{
+ int currentFile = 1;
+ int overall_status = 0;
+ bool first_msg = true;
+
+ QString directory = KFileDialog::getExistingDirectory( QDir::homeDirPath(), info->parent() );
+
+ //qDebug("starting by looking in directory: %s", directory.latin1());
+ if ( directory.isEmpty() ) {
+ info->addLog( i18n("No directory selected."));
+ info->addLog( i18n("No files found for import."));
+ } else {
+ info->setOverall(0);
+ traverseDirectory(info, directory);
+
+ for ( QStringList::Iterator filename = mMboxFiles.begin(); filename != mMboxFiles.end(); ++filename, ++currentFile) {
+ if ( info->shouldTerminate() ) break;
+ QFile mbox( *filename );
+ if (! mbox.open( IO_ReadOnly ) ) {
+ info->alert( i18n("Unable to open %1, skipping").arg( *filename ) );
+ } else {
+ QFileInfo filenameInfo( *filename );
+ kdDebug() << "importing filename " << *filename << endl;
+ QStringList name = QStringList::split("/", *filename);
+ QString folderName(name[name.count() - 2]);
+
+ info->setCurrent(0);
+ info->addLog( i18n("Importing emails from %1...").arg( *filename ) );
+ info->setFrom( *filename );
+ info->setTo( folderName );
+
+ QByteArray input(MAX_LINE);
+ long l = 0;
+
+ while ( ! mbox.atEnd() ) {
+ KTempFile tmp;
+ /* comment by Danny:
+ * Don't use QTextStream to read from mbox, etter use QDataStream. QTextStream only
+ * support Unicode/Latin1/Locale. So you lost information from emails with
+ * charset!=Unicode/Latin1/Locale (e.g. KOI8-R) and Content-Transfer-Encoding != base64
+ * (e.g. 8Bit). It also not help to convert the QTextStream to Unicode. By this you
+ * get Unicode/UTF-email but KMail can't detect the correct charset.
+ */
+ QCString seperate;
+
+ if(!first_msg)
+ tmp.file()->writeBlock( input, l );
+ l = mbox.readLine( input.data(),MAX_LINE); // read the first line, prevent "From "
+ 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 );
+ }
+ tmp.close();
+ first_msg = false;
+
+ // force stop if user chancel the import
+ if ( info->shouldTerminate() ) {
+ tmp.unlink();
+ break;
+ }
+
+ /* comment by Danny Kukawka:
+ * addMessage() == old function, need more time and check for duplicates
+ * addMessage_fastImport == new function, faster and no check for duplicates
+ */
+ if(info->removeDupMsg)
+ addMessage( info, folderName, tmp.name() );
+ else
+ addMessage_fastImport( info, folderName, tmp.name() );
+
+ tmp.unlink();
+
+ int currentPercentage = (int) ( ( (float) mbox.at() / filenameInfo.size() ) * 100 );
+ info->setCurrent( currentPercentage );
+ if (currentFile == 1)
+ overall_status = (int)( currentPercentage*((float)currentFile/mMboxFiles.count()));
+ else
+ overall_status = (int)(((currentFile-1)*(100.0/(float)mMboxFiles.count()))+(currentPercentage*(1.0/(float)mMboxFiles.count())));
+ info->setOverall( overall_status );
+ if ( info->shouldTerminate() ) break;
+ }
+
+ info->addLog( i18n("Finished importing emails from %1").arg( *filename ) );
+ if (count_duplicates > 0) {
+ info->addLog( i18n("1 duplicate message not imported to folder %1 in KMail",
+ "%n duplicate messages not imported to folder %1 in KMail", count_duplicates).arg(folderName));
+ }
+ count_duplicates = 0;
+ mbox.close();
+ }
+ }
+ }
+
+ if (info->shouldTerminate()) info->addLog( i18n("Finished import, canceled by user."));
+ info->setCurrent(100);
+ info->setOverall(100);
+}
+
+void FilterMailApp::traverseDirectory(FilterInfo *info, const QString &dirName)
+{
+ QDir dir(dirName);
+ dir.setFilter(QDir::Dirs | QDir::Files);
+
+ const QFileInfoList *fileinfolist = dir.entryInfoList();
+ QFileInfoListIterator it(*fileinfolist);
+ QFileInfo *fi;
+
+ if ( info->shouldTerminate() ) return;
+
+ while ((fi = it.current())) {
+ if (fi->fileName() == "." || fi->fileName() == "..") {
+ ++it;
+ continue;
+ }
+ if (fi->isDir() && fi->isReadable()) {
+ traverseDirectory(info, fi->filePath());
+ } else {
+ if (!fi->isDir() && fi->fileName() == "mbox") {
+ kdDebug() << "adding the file " << fi->filePath() << endl;
+ mMboxFiles.append(fi->filePath());
+ }
+ }
+ ++it;
+ }
+}
diff --git a/kmailcvt/filter_mailapp.hxx b/kmailcvt/filter_mailapp.hxx
new file mode 100644
index 000000000..83ad1937c
--- /dev/null
+++ b/kmailcvt/filter_mailapp.hxx
@@ -0,0 +1,36 @@
+/***************************************************************************
+ filter_mailapp.hxx - OS X Mail App import
+ -------------------
+ copyright : (C) 2004 by Chris Howells
+ email : howells@kde.org
+
+ Derived from code by:
+ copyright : (C) 2003 by Laurence Anderson
+ email : l.d.anderson@warwick.ac.uk
+
+ ***************************************************************************/
+
+#ifndef FILTER_MAILAPP_HXX
+#define FILTER_MAILAPP_HXX
+
+#include "filters.hxx"
+
+/**
+ *imports mbox archives messages into KMail
+ *@author Chris Howells
+ */
+
+class FilterMailApp : public Filter
+{
+public:
+ FilterMailApp();
+ ~FilterMailApp();
+
+ void import(FilterInfo *info);
+
+private:
+ QStringList mMboxFiles;
+ void traverseDirectory(FilterInfo *info, const QString &);
+};
+
+#endif
diff --git a/kmailcvt/filter_mbox.cxx b/kmailcvt/filter_mbox.cxx
new file mode 100644
index 000000000..4692f7fdc
--- /dev/null
+++ b/kmailcvt/filter_mbox.cxx
@@ -0,0 +1,145 @@
+/***************************************************************************
+ filter_mbox.cxx - mbox mail import
+ -------------------
+ begin : Sat Apr 5 2003
+ copyright : (C) 2003 by Laurence Anderson
+ email : l.d.anderson@warwick.ac.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <config.h>
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <ktempfile.h>
+#include <kdebug.h>
+
+#include "filter_mbox.hxx"
+
+
+FilterMBox::FilterMBox() :
+ Filter( i18n("Import mbox Files (UNIX, Evolution)"),
+ "Laurence Anderson <p>( Filter accelerated by Danny Kukawka )</p>",
+ i18n("<p><b>mbox import filter</b></p>"
+ "<p>This filter will import mbox files into KMail. Use this filter "
+ "if you want to import mails from Ximian Evolution or other mailers "
+ "that use this traditional UNIX format.</p>"
+ "<p><b>Note:</b> Emails will be imported into folders named after the "
+ "file they came from, prefixed with MBOX-</p>" ))
+{}
+
+FilterMBox::~FilterMBox()
+{
+ endImport();
+}
+
+void FilterMBox::import(FilterInfo *info)
+{
+ int currentFile = 1;
+ int overall_status = 0;
+ bool first_msg = true;
+
+ QStringList filenames = KFileDialog::getOpenFileNames( QDir::homeDirPath(), "*|" + i18n("mbox Files (*)"), info->parent() );
+ info->setOverall(0);
+
+ for ( QStringList::Iterator filename = filenames.begin(); filename != filenames.end(); ++filename, ++currentFile) {
+ QFile mbox( *filename );
+ if (! mbox.open( IO_ReadOnly ) ) {
+ info->alert( i18n("Unable to open %1, skipping").arg( *filename ) );
+ } else {
+ QFileInfo filenameInfo( *filename );
+ QString folderName( "MBOX-" + filenameInfo.baseName(TRUE) );
+
+ info->setCurrent(0);
+ info->addLog( i18n("Importing emails from %1...").arg( *filename ) );
+
+ info->setFrom( *filename );
+ info->setTo( folderName );
+
+ QByteArray input(MAX_LINE);
+ long l = 0;
+
+ while ( ! mbox.atEnd() ) {
+ KTempFile tmp;
+ QIODevice::Offset filepos = 0;
+ /* comment by Danny:
+ * Don't use QTextStream to read from mbox, better use QDataStream. QTextStream only
+ * support Unicode/Latin1/Locale. So you lost information from emails with
+ * charset!=Unicode/Latin1/Locale (e.g. KOI8-R) and Content-Transfer-Encoding != base64
+ * (e.g. 8Bit). It also not help to convert the QTextStream to Unicode. By this you
+ * 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 */
+ if(!first_msg && ((seperate = input.data()).left(5) != "From "))
+ tmp.file()->writeBlock( input, l );
+
+ l = mbox.readLine( input.data(),MAX_LINE); // read the first line, prevent "From "
+
+ if ((seperate = input.data()).left(5) != "From ")
+ 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 );
+
+ 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;
+
+ /* comment by Danny Kukawka:
+ * addMessage() == old function, need more time and check for duplicates
+ * addMessage_fastImport == new function, faster and no check for duplicates
+ */
+ if(info->removeDupMsg)
+ addMessage( info, folderName, tmp.name(), x_status_flag );
+ else
+ addMessage_fastImport( info, folderName, tmp.name(), x_status_flag );
+
+ tmp.unlink();
+ int currentPercentage = (int) ( ( (float) mbox.at() / filenameInfo.size() ) * 100 );
+ info->setCurrent( currentPercentage );
+ if (currentFile == 1)
+ overall_status = (int)( currentPercentage*((float)currentFile/filenames.count()));
+ else
+ overall_status = (int)(((currentFile-1)*(100.0/(float)filenames.count()))+(currentPercentage*(1.0/(float)filenames.count())));
+ info->setOverall( overall_status );
+
+ if ( info->shouldTerminate() ) break;
+ }
+
+ info->addLog( i18n("Finished importing emails from %1").arg( *filename ));
+ if (count_duplicates > 0) {
+ info->addLog( i18n("1 duplicate message not imported to folder %1 in KMail",
+ "%n duplicate messages not imported to folder %1 in KMail",
+ count_duplicates).arg(folderName));
+ }
+ if (info->shouldTerminate()) info->addLog( i18n("Finished import, canceled by user."));
+ count_duplicates = 0;
+ // don't forget to close the file !!!
+ mbox.close();
+ }
+ }
+}
diff --git a/kmailcvt/filter_mbox.hxx b/kmailcvt/filter_mbox.hxx
new file mode 100644
index 000000000..e1c5e9672
--- /dev/null
+++ b/kmailcvt/filter_mbox.hxx
@@ -0,0 +1,37 @@
+/***************************************************************************
+ filter_mbox.hxx - mbox mail import
+ -------------------
+ begin : Sat Apr 5 2003
+ copyright : (C) 2003 by Laurence Anderson
+ email : l.d.anderson@warwick.ac.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef FILTER_MBOX_HXX
+#define FILTER_MBOX_HXX
+
+#include "filters.hxx"
+
+/**
+ * imports mbox archives messages into KMail
+ * @author Laurence Anderson
+ */
+
+class FilterMBox : public Filter
+{
+public:
+ FilterMBox();
+ ~FilterMBox();
+
+ void import(FilterInfo *info);
+};
+
+#endif
diff --git a/kmailcvt/filter_oe.cxx b/kmailcvt/filter_oe.cxx
new file mode 100644
index 000000000..8092b299d
--- /dev/null
+++ b/kmailcvt/filter_oe.cxx
@@ -0,0 +1,430 @@
+/***************************************************************************
+ filter_oe.cxx - Outlook Express mail import
+ -------------------
+ begin : Sat Feb 1 2003
+ copyright : (C) 2003 by Laurence Anderson
+ (C) 2005 by Danny Kukawka
+ email : l.d.anderson@warwick.ac.uk
+ danny.Kukawka@web.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+// This filter was created by looking at libdbx & liboe
+
+#include <config.h>
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <ktempfile.h>
+#include <kdebug.h>
+
+#include "filter_oe.hxx"
+
+#define OE4_SIG_1 0x36464d4a
+#define OE4_SIG_2 0x00010003
+#define OE5_SIG_1 0xfe12adcf
+#define OE5_EMAIL_SIG_2 0x6f74fdc5
+#define OE5_FOLDER_SIG_2 0x6f74fdc6
+#define OE5_SIG_3 0x11d1e366
+#define OE5_SIG_4 0xc0004e9a
+#define MBX_MAILMAGIC 0x7F007F00
+
+FilterOE::FilterOE() :
+ Filter( i18n("Import Outlook Express Emails"),
+ "Laurence Anderson <br>( Filter enhanced by Danny Kukawka )</p>",
+ i18n("<p><b>Outlook Express 4/5/6 import filter</b></p>"
+ "<p>You will need to locate the folder where the mailbox has been "
+ "stored by searching for .dbx or .mbx files under "
+ "<ul><li><i>C:\\Windows\\Application Data</i> in Windows 9x"
+ "<li><i>Documents and Settings</i> in Windows 2000 or later</ul></p>"
+ "<p><b>Note:</b> Since it is possible to recreate the folder structure, the folders from "
+ "Outlook Express 5 and 6 will be stored under: \"OE-Import\" in your local folder.</p>" ))
+{}
+
+FilterOE::~FilterOE()
+{
+ endImport();
+}
+
+void FilterOE::import(FilterInfo *info)
+{
+ // Select directory containing plain text emails
+ mailDir = KFileDialog::getExistingDirectory(QDir::homeDirPath(),info->parent());
+ if (mailDir.isEmpty()) { // No directory selected
+ info->alert(i18n("No directory selected."));
+ return;
+ }
+
+ QDir dir (mailDir);
+ QStringList files = dir.entryList("*.[dDmM][bB][xX]", QDir::Files, QDir::Name);
+ if (files.isEmpty()) {
+ info->alert(i18n("No Outlook Express mailboxes found in directory %1.").arg(mailDir));
+ return;
+ }
+
+ totalFiles = files.count();
+ currentFile = 0;
+ count0x04 = 0;
+ count0x84 = 0;
+ parsedFolder = false;
+
+ info->setOverall(0);
+
+ /** search the folderfile to recreate folder struct */
+ for ( QStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile ) {
+ if(*mailFile == "Folders.dbx") {
+ info->addLog(i18n("Import folder structure..."));
+ importMailBox(info, dir.filePath(*mailFile));
+ if(!folderStructure.isEmpty()) parsedFolder = true;
+ // remove file from QStringList::files, no longer needed
+ files.remove(mailFile);
+ currentIsFolderFile = false;
+ break;
+ }
+ }
+
+ int n=0;
+ for ( QStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile ) {
+ if ( info->shouldTerminate() ) break;
+ importMailBox(info, dir.filePath(*mailFile));
+ info->setOverall(100 * ++n / files.count());
+ }
+
+ info->setOverall(100);
+ info->setCurrent(100);
+ info->addLog(i18n("Finished importing Outlook Express emails"));
+ if (info->shouldTerminate()) info->addLog( i18n("Finished import, canceled by user."));
+
+ kdDebug() << "\n" << "total emails in current file: " << totalEmails << endl;
+ kdDebug() << "0x84 Mails: " << count0x84 << endl;
+ kdDebug() << "0x04 Mails: " << count0x04 << endl;
+}
+
+void FilterOE::importMailBox( FilterInfo *info, const QString& fileName)
+{
+ QFile mailfile(fileName);
+ QFileInfo mailfileinfo(fileName);
+ QString _nameOfFile = fileName;
+ _nameOfFile.remove( mailDir );
+ _nameOfFile.remove( "/" );
+ info->setFrom(mailfileinfo.fileName());
+
+ if (!mailfile.open(IO_ReadOnly)) {
+ info->addLog(i18n("Unable to open mailbox %1").arg(fileName));
+ return;
+ }
+ QDataStream mailbox(&mailfile);
+ mailbox.setByteOrder(QDataStream::LittleEndian);
+
+ // Parse magic
+ Q_UINT32 sig_block1, sig_block2;
+ mailbox >> sig_block1 >> sig_block2;
+ if (sig_block1 == OE4_SIG_1 && sig_block2 == OE4_SIG_2) {
+ folderName = "OE-Import/" + mailfileinfo.baseName(TRUE);
+ info->addLog(i18n("Importing OE4 Mailbox %1").arg( "../" + _nameOfFile));
+ info->setTo(folderName);
+ mbxImport(info, mailbox);
+ return;
+ } else {
+ Q_UINT32 sig_block3, sig_block4;
+ mailbox >> sig_block3 >> sig_block4;
+ if (sig_block1 == OE5_SIG_1 && sig_block3 == OE5_SIG_3 && sig_block4 == OE5_SIG_4) {
+ if (sig_block2 == OE5_EMAIL_SIG_2) {
+ folderName = "OE-Import/" + mailfileinfo.baseName(TRUE);
+ if(parsedFolder) {
+ QString _tmpFolder = getFolderName(_nameOfFile);
+ if(!_tmpFolder.isEmpty()) folderName = "OE-Import/" + _tmpFolder;
+ }
+ info->addLog(i18n("Importing OE5+ Mailbox %1").arg( "../" + _nameOfFile));
+ info->setTo(folderName);
+ dbxImport(info, mailbox);
+ return;
+ } else if (sig_block2 == OE5_FOLDER_SIG_2) {
+ if(!parsedFolder) {
+ info->addLog(i18n("Importing OE5+ Folder file %1").arg( "../" + _nameOfFile));
+ currentIsFolderFile = true;
+ dbxImport(info, mailbox);
+ currentIsFolderFile = false;
+ }
+ return;
+ }
+ }
+ }
+ // info->addLog(i18n("File %1 does not seem to be an Outlook Express mailbox").arg("../" + _nameOfFile));
+}
+
+/* ------------------- MBX support ------------------- */
+
+void FilterOE::mbxImport( FilterInfo *info, QDataStream& ds)
+{
+ Q_UINT32 msgCount, lastMsgNum, fileSize;
+
+ // Read the header
+ ds >> msgCount >> lastMsgNum >> fileSize;
+ ds.device()->at( ds.device()->at() + 64 ); // Skip 0's
+ kdDebug() << "This mailbox has " << msgCount << " messages" << endl;
+ if (msgCount == 0)
+ return; // Don't import empty mailbox
+
+ Q_UINT32 msgMagic;
+ ds >> msgMagic; // Read first magic
+
+ while (!ds.atEnd()) {
+ Q_UINT32 msgNumber, msgSize, msgTextSize;
+ KTempFile tmp;
+ tmp.dataStream()->setByteOrder(QDataStream::LittleEndian);
+
+ // Read the messages
+ ds >> msgNumber >> msgSize >> msgTextSize; // All seem to be lies...?
+
+ do {
+ ds >> msgMagic;
+ if (msgMagic != MBX_MAILMAGIC)
+ *tmp.dataStream() << msgMagic;
+ else
+ break;
+ } while ( !ds.atEnd() );
+
+ tmp.close();
+ /* comment by Danny Kukawka:
+ * addMessage() == old function, need more time and check for duplicates
+ * addMessage_fastImport == new function, faster and no check for duplicates
+ */
+ if(info->removeDupMsg)
+ addMessage( info, folderName, tmp.name() );
+ else
+ addMessage_fastImport( info, folderName, tmp.name() );
+
+ tmp.unlink();
+ if(info->shouldTerminate()) return;
+ }
+}
+
+/* ------------------- DBX support ------------------- */
+
+void FilterOE::dbxImport( FilterInfo *info, QDataStream& ds)
+{
+ // Get item count & offset of index
+ Q_UINT32 itemCount, indexPtr;
+ ds.device()->at(0xc4);
+ ds >> itemCount;
+ ds.device()->at(0xe4);
+ ds >> indexPtr;
+ kdDebug() << "Item count is " << itemCount << ", Index at " << indexPtr << endl;
+
+ if (itemCount == 0)
+ return; // Empty file
+ totalEmails = itemCount;
+ currentEmail = 0;
+ // Parse the indexes
+ ds.device()->at(indexPtr);
+ dbxReadIndex(info, ds, indexPtr);
+}
+
+void FilterOE::dbxReadIndex( FilterInfo *info, QDataStream& ds, int filePos)
+{
+
+ if(info->shouldTerminate()) return;
+ Q_UINT32 self, unknown, nextIndexPtr, parent, indexCount;
+ Q_UINT8 unknown2, ptrCount;
+ Q_UINT16 unknown3;
+ int wasAt = ds.device()->at();
+ ds.device()->at(filePos);
+
+
+ kdDebug() << "Reading index of file " << folderName << endl;
+ ds >> self >> unknown >> nextIndexPtr >> parent >> unknown2 >> ptrCount >> unknown3 >> indexCount; // _dbx_tableindexstruct
+
+ kdDebug() << "This index has " << (int) ptrCount << " data pointers" << endl;
+ for (int count = 0; count < ptrCount; count++) {
+ if(info->shouldTerminate()) return;
+ Q_UINT32 dataIndexPtr, anotherIndexPtr, anotherIndexCount; // _dbx_indexstruct
+ ds >> dataIndexPtr >> anotherIndexPtr >> anotherIndexCount;
+
+ if (anotherIndexCount > 0) {
+ kdDebug() << "Recursing to another table @ " << anotherIndexPtr << endl;
+ dbxReadIndex(info, ds, anotherIndexPtr);
+ }
+ kdDebug() << "Data index @ " << dataIndexPtr << endl;
+ dbxReadDataBlock(info, ds, dataIndexPtr);
+ }
+
+ if (indexCount > 0) { // deal with nextTablePtr
+ kdDebug() << "Recuring to next table @ " << nextIndexPtr << endl;
+ dbxReadIndex(info, ds, nextIndexPtr);
+ }
+
+ ds.device()->at(wasAt); // Restore file position to same as when function called
+}
+
+void FilterOE::dbxReadDataBlock( FilterInfo *info, QDataStream& ds, int filePos)
+{
+ Q_UINT32 curOffset, blockSize;
+ Q_UINT16 unknown;
+ Q_UINT8 count, unknown2;
+ int wasAt = ds.device()->at();
+
+ QString folderEntry[4];
+
+ ds.device()->at(filePos);
+
+ ds >> curOffset >> blockSize >> unknown >> count >> unknown2; // _dbx_email_headerstruct
+ kdDebug() << "Data block has " << (int) count << " elements" << endl;
+
+ for (int c = 0; c < count; c++) {
+ if(info->shouldTerminate()) return;
+ Q_UINT8 type; // _dbx_email_pointerstruct
+ Q_UINT32 value; // Actually 24 bit
+
+ ds >> type >> value;
+ value &= 0xffffff;
+ ds.device()->at(ds.device()->at() - 1); // We only wanted 3 bytes
+
+ if(!currentIsFolderFile) {
+ if (type == 0x84) { // It's an email!
+ kdDebug() << "**** Offset of emaildata (0x84) " << value << " ****" << endl;
+ dbxReadEmail(info, ds, value);
+ ++count0x84;
+ } else if( type == 0x04) {
+ int currentFilePos = ds.device()->at();
+ ds.device()->at(filePos + 12 + value + (count*4) );
+ Q_UINT32 newOFF;
+ ds >> newOFF;
+ kdDebug() << "**** Offset of emaildata (0x04) " << newOFF << endl;
+ ds.device()->at(currentFilePos);
+ dbxReadEmail(info, ds, newOFF);
+ ++count0x04;
+ }
+ }
+ else {
+ // this is a folderfile
+ if(type == 0x02) {
+ // kdDebug() << "**** FOLDER: descriptive name ****" << endl;
+ folderEntry[0] = parseFolderString(ds, filePos + 12 + value + (count*4) );
+ } else if (type == 0x03) {
+ // kdDebug() << "**** FOLDER: filename ****" << endl;
+ folderEntry[1] = parseFolderString(ds, filePos + 12 + value + (count*4) );
+
+ } else if (type == 0x80) {
+ // kdDebug() << "**** FOLDER: current ID ****" << endl;
+ folderEntry[2] = QString::number(value);
+
+ } else if (type == 0x81) {
+ // kdDebug() << "**** FOLDER: parent ID ****" << endl;
+ folderEntry[3] = QString::number(value);
+ }
+ }
+ }
+ if(currentIsFolderFile) {
+ folderStructure.append(folderEntry);
+ }
+ ds.device()->at(wasAt); // Restore file position to same as when function called
+}
+
+void FilterOE::dbxReadEmail( FilterInfo *info, QDataStream& ds, int filePos)
+{
+ if(info->shouldTerminate()) return;
+ Q_UINT32 self, nextAddressOffset, nextAddress=0;
+ Q_UINT16 blockSize;
+ Q_UINT8 intCount, unknown;
+ KTempFile tmp;
+ bool _break = false;
+ int wasAt = ds.device()->at();
+ ds.device()->at(filePos);
+
+ do {
+ ds >> self >> nextAddressOffset >> blockSize >> intCount >> unknown >> nextAddress; // _dbx_block_hdrstruct
+ QByteArray blockBuffer(blockSize);
+ ds.readRawBytes(blockBuffer.data(), blockSize);
+ tmp.dataStream()->writeRawBytes(blockBuffer.data(), blockSize);
+ // to detect incomplete mails or corrupted archives. See Bug #86119
+ if(ds.atEnd()) {
+ _break = true;
+ break;
+ }
+ ds.device()->at(nextAddress);
+ } while (nextAddress != 0);
+ tmp.close();
+
+ if(!_break) {
+ if(info->removeDupMsg)
+ addMessage( info, folderName, tmp.name() );
+ else
+ addMessage_fastImport( info, folderName, tmp.name() );
+
+ currentEmail++;
+ int currentPercentage = (int) ( ( (float) currentEmail / totalEmails ) * 100 );
+ info->setCurrent(currentPercentage);
+ ds.device()->at(wasAt);
+ }
+ tmp.unlink();
+}
+
+/* ------------------- FolderFile support ------------------- */
+QString FilterOE::parseFolderString( QDataStream& ds, int filePos )
+{
+ char tmp;
+ QString returnString;
+ int wasAt = ds.device()->at();
+ ds.device()->at(filePos);
+
+ // read while != 0x00
+ while( !ds.device()->atEnd() ) {
+ tmp = ds.device()->getch();
+ if( tmp != 0x00) {
+ returnString += tmp;
+ }
+ else break;
+ }
+ ds.device()->at(wasAt);
+ return returnString;
+}
+
+/** get the foldername for a given file ID from folderMatrix */
+QString FilterOE::getFolderName(QString filename)
+{
+ bool found = false;
+ bool foundFilename = false;
+ QString folder;
+ // we must do this because folder with more than one upper letter
+ // at start have maybe not a file named like the folder !!!
+ QString search = filename.lower();
+
+ while (!found)
+ {
+ for ( FolderStructureIterator it = folderStructure.begin(); it != folderStructure.end(); it++) {
+ FolderStructure tmp = *it;
+ if(foundFilename == false) {
+ QString _tmpFileName = tmp[1];
+ _tmpFileName = _tmpFileName.lower();
+ if(_tmpFileName == search) {
+ folder.prepend( tmp[0] + QString::fromLatin1("/") );
+ search = tmp[3];
+ foundFilename = true;
+ }
+ } else {
+ QString _currentID = tmp[2];
+ QString _parentID = tmp[3];
+ if(_currentID == search) {
+ if(_parentID.isEmpty()) { // this is the root of the folder
+ found = true;
+ break;
+ } else {
+ folder.prepend( tmp[0] + QString::fromLatin1("/") );
+ search = tmp[3];
+ }
+ }
+ }
+ }
+ // need to break the while loop maybe in some cases
+ if((foundFilename == false) && (folder.isEmpty())) return folder;
+ }
+ return folder;
+}
diff --git a/kmailcvt/filter_oe.hxx b/kmailcvt/filter_oe.hxx
new file mode 100644
index 000000000..348b29ff4
--- /dev/null
+++ b/kmailcvt/filter_oe.hxx
@@ -0,0 +1,84 @@
+/***************************************************************************
+ filter_oe.hxx - Outlook Express mail import
+ -------------------
+ begin : Sat Feb 1 2003
+ copyright : (C) 2003 by Laurence Anderson
+ email : l.d.anderson@warwick.ac.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef FILTER_OE_HXX
+#define FILTER_OE_HXX
+
+#include "filters.hxx"
+
+/**
+ *imports outlook text messages into KMail
+ *@author Laurence Anderson
+ */
+
+class FilterOE : public Filter
+{
+public:
+ FilterOE();
+ ~FilterOE();
+
+ void import(FilterInfo *info);
+
+protected:
+ void importMailBox( FilterInfo *info, const QString& fileName);
+ void mbxImport( FilterInfo *info, QDataStream& ds);
+ void dbxImport( FilterInfo *info, QDataStream& ds);
+ void dbxReadIndex( FilterInfo *info, QDataStream& ds, int filePos);
+ void dbxReadDataBlock( FilterInfo *info, QDataStream& ds, int filePos);
+ void dbxReadEmail( FilterInfo *info, QDataStream& ds, int filePos);
+
+ /** helperfunctions for folder structure support */
+ QString parseFolderString( QDataStream& ds, int filePos);
+ QString getFolderName(QString filename);
+
+private: // Private methods
+ /** which file (of totalFiles) is now in the work? */
+ int currentFile;
+ /** total number of files that get imported */
+ int totalFiles;
+ /** total emails in current file */
+ int totalEmails;
+ /** which email (of totalFiles) is now in the work? */
+ int currentEmail;
+ /** number of imported mails with flag 0x04 */
+ int count0x04;
+ /** number of imported mails with flag 0x84 */
+ int count0x84;
+
+ /** true if the folderstructure is parsed */
+ bool parsedFolder;
+ /** true if the current parsing file is the folder file */
+ bool currentIsFolderFile;
+
+ /** Folder structure with following 4 entries:
+ 1. descriptive folder name
+ 2. filename
+ 3. ID of current folder
+ 4. ID of parent folder
+ */
+ typedef FolderStructureBase<4> FolderStructure;
+ /** matrix with information about the folder structure*/
+ QValueList<FolderStructure> folderStructure;
+ typedef QValueList<FolderStructure>::Iterator FolderStructureIterator;
+
+ /** name of the current folder */
+ QString folderName;
+ /** name of the chosen folder */
+ QString mailDir;
+};
+
+#endif
diff --git a/kmailcvt/filter_opera.cxx b/kmailcvt/filter_opera.cxx
new file mode 100644
index 000000000..5d0882d9b
--- /dev/null
+++ b/kmailcvt/filter_opera.cxx
@@ -0,0 +1,158 @@
+/***************************************************************************
+ filter_opera.cxx - Opera mail import
+ -------------------
+ begin : Januar 26 2005
+ copyright : (C) 2005 by Danny Kukawka
+ email : danny.kukawka@web.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <config.h>
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <ktempfile.h>
+#include <kdebug.h>
+
+#include "filter_opera.hxx"
+
+
+FilterOpera::FilterOpera() :
+ Filter( i18n("Import Opera Emails"),
+ "Danny Kukawka",
+ i18n("<p><b>Opera email import filter</b></p>"
+ "<p>This filter will import mails from Opera mail folder. Use this filter "
+ "if you want to import all mails within a account in the Opera maildir.</p>"
+ "<p>Select the directory of the account (usually ~/.opera/mail/store/account*).</p>"
+ "<p><b>Note:</b> Emails will be imported into a folder named after the account "
+ "they came from, prefixed with OPERA-</p>" ))
+{}
+
+FilterOpera::~FilterOpera()
+{
+ endImport();
+}
+
+void FilterOpera::import(FilterInfo *info)
+{
+ /** try to go to opera mailfolder in the home of the user */
+ QString startdir = QDir::homeDirPath() + "/.opera/mail/store/";
+ QDir d( startdir );
+ if ( !d.exists() ) {
+ startdir = QDir::homeDirPath();
+ }
+
+ //QString mailDir = KFileDialog::getExistingDirectory(QDir::homeDirPath(), info->parent());
+ KFileDialog *kfd;
+ kfd = new KFileDialog( startdir, "", 0, "kfiledialog", true );
+ kfd->setMode(KFile::Directory | KFile::LocalOnly);
+ kfd->exec();
+ QString operaDir = kfd->selectedFile();
+
+ if (operaDir.isEmpty()) {
+ info->alert(i18n("No directory selected."));
+ }
+ /**
+ * If the user only select homedir no import needed because
+ * there should be no files and we surely import wrong files.
+ */
+ else if ( operaDir == QDir::homeDirPath() || operaDir == (QDir::homeDirPath() + "/")) {
+ info->addLog(i18n("No files found for import."));
+ } else {
+ info->setOverall(0);
+
+ QDir importDir (operaDir);
+ QStringList files = importDir.entryList("*.[mM][bB][sS]", QDir::Files, QDir::Name);
+
+ // Count total number of files to be processed
+ info->addLog(i18n("Counting files..."));
+ int totalFiles = files.count();
+ int currentFile = 1;
+
+ if(totalFiles > 0) {
+ int overall_status = 0;
+
+ info->addLog(i18n("Importing new mail files..."));
+ for ( QStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile) {
+ info->setCurrent(0);
+ QFile operaArchiv( importDir.filePath(*mailFile) );
+ if (! operaArchiv.open( IO_ReadOnly ) ) {
+ info->alert( i18n("Unable to open %1, skipping").arg( *mailFile ) );
+ } else {
+ info->addLog( i18n("Importing emails from %1...").arg( *mailFile ) );
+ QFileInfo filenameInfo( importDir.filePath(*mailFile) );
+ QString folderName( "OPERA-" + importDir.dirName() );
+
+ info->setFrom( *mailFile );
+ info->setTo( folderName );
+
+ QByteArray input(MAX_LINE);
+ long l = 0;
+ bool first_msg = true;
+
+ while ( !operaArchiv.atEnd() ) {
+ KTempFile tmp;
+ /* comment by Danny:
+ * Don't use QTextStream to read from mbox, etter use QDataStream. QTextStream only
+ * support Unicode/Latin1/Locale. So you lost information from emails with
+ * charset!=Unicode/Latin1/Locale (e.g. KOI8-R) and Content-Transfer-Encoding != base64
+ * (e.g. 8Bit). It also not help to convert the QTextStream to Unicode. By this you
+ * get Unicode/UTF-email but KMail can't detect the correct charset.
+ */
+ QCString seperate;
+
+ if(!first_msg)
+ tmp.file()->writeBlock( input, l );
+ l = operaArchiv.readLine( input.data(),MAX_LINE); // read the first line, prevent "From "
+ tmp.file()->writeBlock( input, l );
+
+ while ( ! operaArchiv.atEnd() && (l = operaArchiv.readLine(input.data(),MAX_LINE)) && ((seperate = input.data()).left(5) != "From ")) {
+ /** remove in KMail unneeded Flags from Opera (for example: X-Opera-Status)*/
+ if(seperate.left(8) != "X-Opera-")
+ tmp.file()->writeBlock( input, l );
+ }
+ tmp.close();
+ first_msg = false;
+
+ if(info->removeDupMsg)
+ addMessage( info, folderName, tmp.name() );
+ else
+ addMessage_fastImport( info, folderName, tmp.name() );
+ tmp.unlink();
+ int currentPercentage = (int) ( ( (float) operaArchiv.at() / filenameInfo.size() ) * 100 );
+ info->setCurrent( currentPercentage );
+
+ if (currentFile == 1)
+ overall_status = (int) ( currentPercentage * ( (float) currentFile / totalFiles ) );
+ else
+ overall_status = (int)(((currentFile-1)*(100.0/(float)totalFiles))+(currentPercentage*(1.0/(float)totalFiles)));
+
+ info->setOverall( overall_status );
+ if ( info->shouldTerminate() ) break;
+ }
+
+ info->addLog( i18n("Finished importing emails from %1").arg( *mailFile ));
+ if (count_duplicates > 0) {
+ info->addLog( i18n("1 duplicate message not imported", "%n duplicate messages not imported", count_duplicates));
+ }
+ currentFile++;
+ count_duplicates = 0;
+ operaArchiv.close();
+ }
+ if ( info->shouldTerminate() ) break;
+ }
+ } else {
+ info->addLog(i18n("No files found for import."));
+ }
+ }
+ if (info->shouldTerminate()) info->addLog( i18n("Finished import, canceled by user."));
+ info->setCurrent(100);
+ info->setOverall(100);
+}
diff --git a/kmailcvt/filter_opera.hxx b/kmailcvt/filter_opera.hxx
new file mode 100644
index 000000000..27ded4ccd
--- /dev/null
+++ b/kmailcvt/filter_opera.hxx
@@ -0,0 +1,37 @@
+/***************************************************************************
+ filter_opera.hxx - Opera mail import
+ -------------------
+ begin : Januar 26 2005
+ copyright : (C) 2005 by Danny Kukawka
+ email : danny.kukawka@web.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef FILTER_OPERA_HXX
+#define FILTER_OPERA_HXX
+
+#include "filters.hxx"
+
+/**
+ *imports opera account-archives into KMail
+ *@author Danny Kukawka
+ */
+
+class FilterOpera : public Filter
+{
+public:
+ FilterOpera();
+ ~FilterOpera();
+
+ void import(FilterInfo *info);
+};
+
+#endif
diff --git a/kmailcvt/filter_outlook.cxx b/kmailcvt/filter_outlook.cxx
new file mode 100644
index 000000000..e9c53a82c
--- /dev/null
+++ b/kmailcvt/filter_outlook.cxx
@@ -0,0 +1,62 @@
+/***************************************************************************
+ filter_opera.cxx - Outlook mail import
+ -------------------
+ begin : February 01 2005
+ copyright : (C) 2005 by Danny Kukawka
+ email : danny.kukawka@web.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include <config.h>
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <ktempfile.h>
+#include <kdebug.h>
+
+#include "filter_outlook.hxx"
+
+FilterOutlook::FilterOutlook() :
+ Filter( i18n("Import Outlook Emails"),
+ "Danny Kukawka",
+ i18n("<p><b>Outlook email import filter</b></p>"
+ "<p>This filter will import mails from a Outlook pst-file. You will need to locate "
+ "the folder where the pst-file has been stored by searching for .pst files under: "
+ "<i>C:\\Documents and Settings</i> in Windows 2000 or later</p>"
+ "<p><b>Note:</b> Emails will be imported into a folder named after the "
+ "account they came from, prefixed with OUTLOOK-</p>" ))
+{}
+
+FilterOutlook::~FilterOutlook()
+{
+ endImport();
+}
+
+void FilterOutlook::import(FilterInfo *info)
+{
+ info->alert(i18n("No directory selected."));
+ info->addLog(i18n("Counting files..."));
+ info->addLog(i18n("Counting mail..."));
+ info->addLog(i18n("Counting directories..."));
+ info->addLog(i18n("Counting folders..."));
+ info->addLog(i18n("Importing new mail files..."));
+ info->addLog(i18n("No files found for import."));
+
+ QString outlookDir;
+ outlookDir = KFileDialog::getExistingDirectory(QDir::homeDirPath(), info->parent());
+ QDir importDir (outlookDir);
+ QStringList files = importDir.entryList("*.[pP][sS][tT]", QDir::Files, QDir::Name);
+ for ( QStringList::Iterator pstFile = files.begin(); pstFile != files.end(); ++pstFile) {
+ info->addLog( i18n("Importing emails from %1...").arg( *pstFile ) );
+ info->addLog( i18n("1 duplicate message not imported", "%n duplicate messages not imported", count_duplicates));
+ info->alert( i18n("Unable to open %1, skipping").arg( *pstFile ) );
+ }
+}
diff --git a/kmailcvt/filter_outlook.hxx b/kmailcvt/filter_outlook.hxx
new file mode 100644
index 000000000..bad7d5ee1
--- /dev/null
+++ b/kmailcvt/filter_outlook.hxx
@@ -0,0 +1,38 @@
+/***************************************************************************
+ filter_opera.hxx - Outlook mail import
+ -------------------
+ begin : Januar 26 2005
+ copyright : (C) 2005 by Danny Kukawka
+ email : danny.kukawka@web.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef FILTER_OUTLOOK_HXX
+#define FILTER_OUTLOOK_HXX
+
+#include "filters.hxx"
+
+/**
+ * imports mails from Outlook pst-files into KMail
+ * NOTE: This is a dummy at the moment
+ * @author Danny Kukawka
+ */
+
+class FilterOutlook : public Filter
+{
+public:
+ FilterOutlook();
+ ~FilterOutlook();
+
+ void import(FilterInfo *info);
+};
+
+#endif
diff --git a/kmailcvt/filter_plain.cxx b/kmailcvt/filter_plain.cxx
new file mode 100644
index 000000000..7dc0bda50
--- /dev/null
+++ b/kmailcvt/filter_plain.cxx
@@ -0,0 +1,88 @@
+/***************************************************************************
+ FilterPlain.cxx - Plain mail import
+ -------------------
+ begin : Fri Jun 14 2002
+ copyright : (C) 2002 by Laurence Anderson
+ email : l.d.anderson@warwick.ac.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <config.h>
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <libgen.h>
+
+#include "filter_plain.hxx"
+
+
+FilterPlain::FilterPlain() :
+ Filter(i18n("Import Plain Text Emails"),
+ "Laurence Anderson <p>( Filter accelerated by Danny Kukawka )</p>",
+ i18n("<p>Select the directory containing the emails on your system. "
+ "The emails are placed in a folder with the same name as the "
+ "directory they were in, prefixed by PLAIN-</p>"
+ "<p>This filter will import all .msg, .eml and .txt emails.</p>"))
+{}
+
+FilterPlain::~FilterPlain()
+{
+ endImport();
+}
+
+void FilterPlain::import(FilterInfo *info)
+{
+ // Select directory containing plain text emails
+ QString mailDir = KFileDialog::getExistingDirectory(QDir::homeDirPath(),info->parent());
+ if (mailDir.isEmpty()) { // No directory selected
+ info->alert(i18n("No directory selected."));
+ return;
+ }
+ QDir dir (mailDir);
+ QStringList files = dir.entryList("*.[eE][mM][lL]; *.[tT][xX][tT]; *.[mM][sS][gG]", QDir::Files, QDir::Name);
+
+ // Count total number of files to be processed
+ info->addLog(i18n("Counting files..."));
+ int totalFiles = files.count();
+ int currentFile = 0;
+
+ info->addLog(i18n("Importing new mail files..."));
+ for ( QStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile ) {
+ info->setFrom(*mailFile);
+ info->setTo(dir.dirName());
+ info->setCurrent(0);
+
+ /* comment by Danny Kukawka:
+ * addMessage() == old function, need more time and check for duplicates
+ * addMessage_fastImport == new function, faster and no check for duplicates
+ */
+ if(info->removeDupMsg) {
+ if(! addMessage( info, "PLAIN-" + dir.dirName(), dir.filePath(*mailFile) )) {
+ info->addLog( i18n("Could not import %1").arg( *mailFile ) );
+ }
+ } else {
+ if( ! addMessage_fastImport( info, "PLAIN-" + dir.dirName(), dir.filePath(*mailFile) )) {
+ info->addLog( i18n("Could not import %1").arg( *mailFile ) );
+ }
+ }
+
+ info->setCurrent(100);
+ info->setOverall(100 * ++currentFile/ totalFiles);
+ if ( info->shouldTerminate() ) break;
+ }
+
+ info->addLog( i18n("Finished importing emails from %1").arg( mailDir ));
+ if (count_duplicates > 0) {
+ info->addLog( i18n("1 duplicate message not imported", "%n duplicate messages not imported", count_duplicates));
+ }
+ if (info->shouldTerminate()) info->addLog( i18n("Finished import, canceled by user."));
+
+ count_duplicates = 0;
+}
diff --git a/kmailcvt/filter_plain.hxx b/kmailcvt/filter_plain.hxx
new file mode 100644
index 000000000..ddd9d494f
--- /dev/null
+++ b/kmailcvt/filter_plain.hxx
@@ -0,0 +1,37 @@
+/***************************************************************************
+ FilterPlain.hxx - Plain mail import
+ -------------------
+ begin : Fri Jun 24 2002
+ copyright : (C) 2002 by Laurence Anderson
+ email : l.d.anderson@warwick.ac.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef FILTER_PLAIN_HXX
+#define FILTER_PLAIN_HXX
+
+#include "filters.hxx"
+
+/**
+ *imports Plain text messages into KMail
+ *@author laurence
+ */
+
+class FilterPlain : public Filter
+{
+public:
+ FilterPlain();
+ ~FilterPlain();
+
+ void import(FilterInfo *info);
+};
+
+#endif
diff --git a/kmailcvt/filter_pmail.cxx b/kmailcvt/filter_pmail.cxx
new file mode 100644
index 000000000..2eafb7f7e
--- /dev/null
+++ b/kmailcvt/filter_pmail.cxx
@@ -0,0 +1,346 @@
+/***************************************************************************
+ FilterPMail.cxx - Pegasus-Mail import
+ -------------------
+ begin : Sat Jan 6 2001
+ copyright : (C) 2001 by Holger Schurig
+ (C) 2005 by Danny Kukawka
+ email : holgerschurig@gmx.de
+ danny.kukawka@web.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <config.h>
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <qregexp.h>
+#include <ktempfile.h>
+#include <kdebug.h>
+
+#include "filter_pmail.hxx"
+
+
+FilterPMail::FilterPMail() :
+ Filter(i18n("Import Folders From Pegasus-Mail"),
+ "Holger Schurig <br>( rewritten by Danny Kukawka )",
+ i18n("<p>Select the Pegasus-Mail directory on your system (containing *.CNM, *.PMM and *.MBX files). "
+ "On many systems this is stored in C:\\pmail\\mail or C:\\pmail\\mail\\admin</p>"
+ "<p><b>Note:</b> Since it is possible to recreate the folder structure, the folders "
+ "will be stored under: \"PegasusMail-Import\".</p>"))
+{}
+
+FilterPMail::~FilterPMail()
+{
+ endImport();
+}
+
+void FilterPMail::import(FilterInfo *info)
+{
+ inf = info;
+
+ // Select directory from where I have to import files
+ KFileDialog *kfd;
+ kfd = new KFileDialog( QDir::homeDirPath(), "", 0, "kfiledialog", true );
+ kfd->setMode(KFile::Directory | KFile::LocalOnly);
+ kfd->exec();
+ chosenDir = kfd->selectedFile();
+
+ if (chosenDir.isEmpty()) {
+ info->alert(i18n("No directory selected."));
+ return;
+ }
+
+ // Count total number of files to be processed
+ info->addLog(i18n("Counting files..."));
+ dir.setPath (chosenDir);
+ QStringList files = dir.entryList("*.[cC][nN][mM]; *.[pP][mM][mM]; *.[mM][bB][xX]", QDir::Files, QDir::Name);
+ totalFiles = files.count();
+ currentFile = 0;
+ kdDebug() << "Count is " << totalFiles << endl;
+
+ if(!(folderParsed = parseFolderMatrix())) {
+ info->addLog(i18n("Cannot parse the folder structure; continuing import without subfolder support."));
+ }
+
+ info->addLog(i18n("Importing new mail files ('.cnm')..."));
+ processFiles("*.[cC][nN][mM]", &FilterPMail::importNewMessage);
+ info->addLog(i18n("Importing mail folders ('.pmm')..."));
+ processFiles("*.[pP][mM][mM]", &FilterPMail::importMailFolder);
+ info->addLog(i18n("Importing 'UNIX' mail folders ('.mbx')..."));
+ processFiles("*.[mM][bB][xX]", &FilterPMail::importUnixMailFolder);
+
+ info->addLog( i18n("Finished importing emails from %1").arg( chosenDir ));
+ info->setCurrent(100);
+ info->setOverall(100);
+}
+
+/** this looks for all files with the filemask 'mask' and calls the 'workFunc' on each of them */
+void FilterPMail::processFiles(const QString& mask, void(FilterPMail::* workFunc)(const QString&) )
+{
+ if (inf->shouldTerminate()) return;
+
+ QStringList files = dir.entryList(mask, QDir::Files, QDir::Name);
+ //kdDebug() << "Mask is " << mask << " count is " << files.count() << endl;
+ for ( QStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile ) {
+ // Notify current file
+ QFileInfo mailfileinfo(*mailFile);
+ inf->setFrom(mailfileinfo.fileName());
+
+ // Clear the other fields
+ inf->setTo(QString::null);
+ inf->setCurrent(QString::null);
+ inf->setCurrent(-1);
+
+ // call worker function, increase progressbar
+ (this->*workFunc)(dir.filePath(*mailFile));
+ ++currentFile;
+ inf->setOverall( (int) ((float) currentFile / totalFiles * 100));
+ inf->setCurrent( 100 );
+ if (inf->shouldTerminate()) return;
+ }
+}
+
+
+/** this function imports one *.CNM message */
+void FilterPMail::importNewMessage(const QString& file)
+{
+ QString destFolder("PegasusMail-Import/New Messages");
+ inf->setTo(destFolder);
+
+ /* comment by Danny Kukawka:
+ * addMessage() == old function, need more time and check for duplicates
+ * addMessage_fastImport == new function, faster and no check for duplicates
+ */
+ if(inf->removeDupMsg)
+ addMessage( inf, destFolder, file );
+ else
+ addMessage_fastImport( inf, destFolder, file );
+}
+
+
+/** this function imports one mail folder file (*.PMM) */
+void FilterPMail::importMailFolder(const QString& file)
+{
+ // Format of a PMM file:
+ // First comes a header with 128 bytes. At the beginning is the name of
+ // the folder. Then there are some unknown bytes (strings). At offset 128
+ // the first message starts.
+ //
+ // Each message is terminated by a 0x1A byte. The next message follows
+ // immediately.
+ //
+ // The last message is followed by a 0x1A, too.
+ //
+ // 000000 6d 61 69 6c 73 65 72 76 65 72 2d 70 72 6f 6a 65 mailserver-proje
+ // 000010 63 74 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ct..............
+ // 000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ // 000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ // 000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ // 000050 00 00 00 00 00 00 36 30 34 37 35 37 32 45 3a 36 ......6047572E:6
+ // 000060 46 34 39 3a 46 4f 4c 30 31 33 35 35 00 00 00 00 F49:FOL01355....
+ // 000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ // 000080 52 65 74 75 72 6e 2d 50 61 74 68 3a 20 3c 75 72 Return-Path: <ur
+ // ...
+ // 000cb0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d 0a 1a 52 65 74 ---------+...Ret
+ // 000cc0 75 72 6e 2d 50 61 74 68 3a 20 3c 62 6f 75 6e 63 urn-Path: <bounc
+ // ...
+ // 04dc50 46 30 33 38 44 2e 36 31 35 44 37 34 44 30 2d 2d F038D.615D74D0--
+ // 04dc60 0d 0a 1a
+
+ struct {
+ char folder[86];
+ char id[42];
+ } pmm_head;
+
+ long l = 0;
+ QFile f(file);
+ if (!f.open(IO_ReadOnly)) {
+ inf->alert(i18n("Unable to open %1, skipping").arg(file));
+ } else {
+ // Get folder name
+ l = f.readBlock((char *) &pmm_head, sizeof(pmm_head));
+ QString folder("PegasusMail-Import/");
+ if(folderParsed)
+ folder.append(getFolderName((QString)pmm_head.id));
+ else
+ folder.append(pmm_head.folder);
+ inf->setTo(folder);
+ inf->addLog(i18n("Importing %1").arg("../" + QString(pmm_head.folder)));
+
+ QByteArray input(MAX_LINE);
+ bool first_msg = true;
+
+ while (!f.atEnd()) {
+ KTempFile tempfile;
+ inf->setCurrent( (int) ( ( (float) f.at() / f.size() ) * 100 ) );
+
+ if(!first_msg) {
+ // set the filepos back to last line minus the seperate char (0x1a)
+ f.at(f.at() - l + 1);
+ }
+
+ // no problem to loose the last line in file. This only contains a seperate char
+ while ( ! f.atEnd() && (l = f.readLine(input.data(),MAX_LINE))) {
+ if (inf->shouldTerminate()){
+ tempfile.close();
+ tempfile.unlink();
+ return;
+ }
+ if(input[0] == 0x1a ) {
+ break;
+ } else {
+ tempfile.file()->writeBlock( input, l );
+ }
+ }
+ tempfile.close();
+
+ if(inf->removeDupMsg)
+ addMessage( inf, folder, tempfile.name() );
+ else
+ addMessage_fastImport( inf, folder, tempfile.name() );
+
+ first_msg = false;
+ tempfile.unlink();
+ }
+ }
+ f.close();
+}
+
+
+/** imports a 'unix' format mail folder (*.MBX) */
+void FilterPMail::importUnixMailFolder(const QString& file)
+{
+ struct {
+ char folder[58];
+ char id[31];
+ } pmg_head;
+
+ QFile f;
+ QString folder("PegasusMail-Import/"), s(file), seperate;
+ QByteArray line(MAX_LINE);
+ int n = 0, l = 0;
+
+ /** Get the folder name */
+ s.replace( QRegExp("mbx$"), "pmg");
+ s.replace( QRegExp("MBX$"), "PMG");
+ f.setName(s);
+ if (! f.open( IO_ReadOnly ) ) {
+ inf->alert( i18n("Unable to open %1, skipping").arg( s ) );
+ return;
+ } else {
+ f.readBlock((char *) &pmg_head, sizeof(pmg_head));
+ f.close();
+
+ if(folderParsed)
+ folder.append(getFolderName((QString)pmg_head.id));
+ else
+ folder.append(pmg_head.folder);
+
+ inf->setTo(folder);
+ inf->setTo(folder);
+ }
+
+ /** Read in the mbox */
+ f.setName(file);
+ if (! f.open( IO_ReadOnly ) ) {
+ inf->alert( i18n("Unable to open %1, skipping").arg( s ) );
+ } else {
+ inf->addLog(i18n("Importing %1").arg("../" + QString(pmg_head.folder)));
+ l = f.readLine( line.data(),MAX_LINE); // read the first line which is unneeded
+ while ( ! f.atEnd() ) {
+ KTempFile tempfile;
+
+ // we lost the last line, which is the first line of the new message in
+ // this lopp, but this is ok, because this is the seperate line with
+ // "From ???@???" and we can forget them
+ while ( ! f.atEnd() && (l = f.readLine(line.data(),MAX_LINE)) && ((seperate = line.data()).left(5) != "From ")) {
+ tempfile.file()->writeBlock(line.data(), l);
+ if (inf->shouldTerminate()){
+ tempfile.close();
+ tempfile.unlink();
+ return;
+ }
+ }
+ tempfile.close();
+ if(inf->removeDupMsg)
+ addMessage( inf, folder, tempfile.name() );
+ else
+ addMessage_fastImport( inf, folder, tempfile.name() );
+ tempfile.unlink();
+
+ n++;
+ inf->setCurrent(i18n("Message %1").arg(n));
+ inf->setCurrent( (int) ( ( (float) f.at() / f.size() ) * 100 ) );
+ }
+ }
+ f.close();
+}
+
+/** Parse the information about folderstructure to folderMatrix */
+bool FilterPMail::parseFolderMatrix()
+{
+ kdDebug() << "Start parsing the foldermatrix." << endl;
+ inf->addLog(i18n("Parsing the folder structure..."));
+
+ QFile hierarch(chosenDir + "/hierarch.pm");
+ if (! hierarch.open( IO_ReadOnly ) ) {
+ inf->alert( i18n("Unable to open %1, skipping").arg( chosenDir + "hierarch.pm" ) );
+ return false;
+ } else {
+ QStringList tmpList;
+ QString tmpRead;
+ while ( !hierarch.atEnd() && hierarch.readLine(tmpRead,100)) {
+ QString tmpArray[5];
+ tmpRead.remove(tmpRead.length() -2,2);
+ QStringList tmpList = QStringList::split(",", tmpRead, false);
+ int i = 0;
+ for ( QStringList::Iterator it = tmpList.begin(); it != tmpList.end(); ++it, i++) {
+ QString _tmp = *it;
+ if(i < 5) tmpArray[i] = _tmp.remove("\"");
+ else {
+ hierarch.close();
+ return false;
+ }
+ }
+ folderMatrix.append(tmpArray);
+ }
+ }
+ hierarch.close();
+ return true;
+}
+
+/** get the foldername for a given file ID from folderMatrix */
+QString FilterPMail::getFolderName(QString ID)
+{
+ bool found = false;
+ QString folder;
+ QString search = ID;
+
+ while (!found)
+ {
+ for ( FolderStructureIterator it = folderMatrix.begin(); it != folderMatrix.end(); it++) {
+ FolderStructure tmp = *it;
+
+ QString _ID = tmp[2];
+ if(_ID == search) {
+ QString _type = tmp[0] + tmp[1];
+ if(( _type == "21")) {
+ found = true;
+ break;
+ }
+ else {
+ folder.prepend((tmp[4] + "/"));
+ search = tmp[3];
+ }
+ }
+ }
+ }
+ return folder;
+}
diff --git a/kmailcvt/filter_pmail.hxx b/kmailcvt/filter_pmail.hxx
new file mode 100644
index 000000000..9db76d11f
--- /dev/null
+++ b/kmailcvt/filter_pmail.hxx
@@ -0,0 +1,76 @@
+/***************************************************************************
+ FilterPMail.hxx - Pegasus-Mail import
+ -------------------
+ begin : Sat Jan 6 2001
+ copyright : (C) 2001 by Holger Schurig
+ email : holgerschurig@gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef FILTER_PMAIL_HXX
+#define FILTER_PMAIL_HXX
+
+#include <qdir.h>
+#include <qvaluelist.h>
+
+#include "filters.hxx"
+
+class FilterPMail : public Filter
+{
+public:
+ FilterPMail();
+ ~FilterPMail();
+
+ void import(FilterInfo *info);
+
+protected:
+ /** this looks for all files with the filemask 'mask' and calls the 'workFunc' on each of them */
+ void processFiles(const QString& mask, void(FilterPMail::* workFunc)(const QString&) );
+ /** this function imports one *.CNM message */
+ void importNewMessage(const QString& file);
+ /** this function imports one mail folder file (*.PMM) */
+ void importMailFolder(const QString& file);
+ /** imports a 'unix' format mail folder (*.MBX) */
+ void importUnixMailFolder(const QString& file);
+ /** this function recreate the folder structure */
+ bool parseFolderMatrix();
+ /** this function parse the folder structure */
+ QString getFolderName(QString ID);
+
+private:
+ /** the working directory */
+ QDir dir;
+ /** pointer to the info */
+ FilterInfo * inf;
+
+ /** Folder structure here has 5 entries. */
+ typedef FolderStructureBase<5> FolderStructure;
+ /** List with the folder matrix, which contains following strings:
+ 1. type (2 for root-folder, 1 for folder, 0 for mailarchiv)
+ 2. type (1 for root-folder, 3 for folder, 0 for mailarchiv)
+ 3. "ID:flag:filename" of folder/archiv
+ 4. "ID:name" of parent folder
+ 5. name of folder/archiv
+ */
+ QValueList<FolderStructure> folderMatrix;
+ typedef QValueList<FolderStructure>::Iterator FolderStructureIterator;
+
+ bool folderParsed;
+
+ QString chosenDir;
+
+ /** which file (of totalFiles) is now in the work? */
+ int currentFile;
+ /** total number of files that get imported */
+ int totalFiles;
+
+};
+#endif
diff --git a/kmailcvt/filter_sylpheed.cxx b/kmailcvt/filter_sylpheed.cxx
new file mode 100644
index 000000000..5edda926e
--- /dev/null
+++ b/kmailcvt/filter_sylpheed.cxx
@@ -0,0 +1,228 @@
+/***************************************************************************
+ filter_sylpheed.hxx - Sylpheed maildir mail import
+ -------------------
+ begin : April 07 2005
+ copyright : (C) 2005 by Danny Kukawka
+ email : danny.kukawka@web.de
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "filter_sylpheed.hxx"
+
+#include <config.h>
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <kdebug.h>
+
+/** Default constructor. */
+FilterSylpheed::FilterSylpheed( void ) :
+ Filter( i18n( "Import Sylpheed Maildirs and Folder Structure" ),
+ "Danny Kukawka",
+ i18n( "<p><b>Sylpheed import filter</b></p>"
+ "<p>Select the base directory of the Sylpheed mailfolder you want to import "
+ "(usually: ~/Mail ).</p>"
+ "<p>Since it is possible to recreate the folder structure, the folders "
+ "will be stored under: \"Sylpheed-Import\" in your local folder.</p>"
+ "<p>This filter also recreates the status of message, e.g. new or forwarded.") )
+{}
+
+/** Destructor. */
+FilterSylpheed::~FilterSylpheed( void )
+{
+ endImport();
+}
+
+/** Recursive import of Sylpheed maildir. */
+void FilterSylpheed::import( FilterInfo *info )
+{
+
+ QString _homeDir = QDir::homeDirPath();
+
+ KFileDialog *kfd;
+ kfd = new KFileDialog( _homeDir, "", 0, "kfiledialog", true );
+ kfd->setMode( KFile::Directory | KFile::LocalOnly );
+ kfd->exec();
+ mailDir = kfd->selectedFile();
+
+ if ( mailDir.isEmpty() ) {
+ info->alert( i18n( "No directory selected." ) );
+ }
+ /**
+ * If the user only select homedir no import needed because
+ * there should be no files and we surely import wrong files.
+ */
+ else if ( mailDir == QDir::homeDirPath() || mailDir == ( QDir::homeDirPath() + "/" ) ) {
+ info->addLog( i18n( "No files found for import." ) );
+ } else {
+ info->setOverall(0);
+
+ /** Recursive import of the MailFolders */
+ QDir dir(mailDir);
+ QStringList rootSubDirs = dir.entryList("[^\\.]*", QDir::Dirs , QDir::Name);
+ int currentDir = 1, numSubDirs = rootSubDirs.size();
+ for(QStringList::Iterator filename = rootSubDirs.begin() ; filename != rootSubDirs.end() ; ++filename, ++currentDir) {
+ if(info->shouldTerminate()) break;
+ importDirContents(info, dir.filePath(*filename));
+ info->setOverall((int) ((float) currentDir / numSubDirs * 100));
+ }
+ }
+
+ info->addLog( i18n("Finished importing emails from %1").arg( mailDir ));
+ if (count_duplicates > 0) {
+ info->addLog( i18n("1 duplicate message not imported", "%n duplicate messages not imported", count_duplicates));
+ }
+ if (info->shouldTerminate()) info->addLog( i18n("Finished import, canceled by user."));
+ count_duplicates = 0;
+ info->setCurrent(100);
+ info->setOverall(100);
+}
+
+/**
+ * Import of a directory contents.
+ * @param info Information storage for the operation.
+ * @param dirName The name of the directory to import.
+ */
+void FilterSylpheed::importDirContents( FilterInfo *info, const QString& dirName)
+{
+ if(info->shouldTerminate()) return;
+
+ /** Here Import all archives in the current dir */
+ importFiles(info, dirName);
+
+ /** If there are subfolders, we import them one by one */
+ QDir subfolders(dirName);
+ QStringList subDirs = subfolders.entryList("[^\\.]*", QDir::Dirs , QDir::Name);
+ for(QStringList::Iterator filename = subDirs.begin() ; filename != subDirs.end() ; ++filename) {
+ if(info->shouldTerminate()) return;
+ importDirContents(info, subfolders.filePath(*filename));
+ }
+}
+
+
+/**
+ * Import the files within a Folder.
+ * @param info Information storage for the operation.
+ * @param dirName The name of the directory to import.
+ */
+void FilterSylpheed::importFiles( FilterInfo *info, const QString& dirName)
+{
+ QDir dir(dirName);
+ QString _path;
+ bool generatedPath = false;
+
+ QDict<unsigned long> msgflags;
+ msgflags.setAutoDelete(true);
+
+ QDir importDir (dirName);
+ QStringList files = importDir.entryList("[^\\.]*", QDir::Files, QDir::Name);
+ int currentFile = 1, numFiles = files.size();
+
+ readMarkFile(info, dir.filePath(".sylpheed_mark"), msgflags);
+
+ for ( QStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile, ++currentFile) {
+ if(info->shouldTerminate()) return;
+ QString _mfile = *mailFile;
+ if (!(_mfile.endsWith(".sylpheed_cache") || _mfile.endsWith(".sylpheed_mark") || _mfile.endsWith(".mh_sequences") )) {
+ if(!generatedPath) {
+ _path = "Sylpheed-Import/";
+ QString _tmp = dir.filePath(*mailFile);
+ _tmp = _tmp.remove(_tmp.length() - _mfile.length() -1, _mfile.length()+1);
+ _path += _tmp.remove( mailDir ,TRUE);
+ QString _info = _path;
+ info->addLog(i18n("Import folder %1...").arg(_info.remove(0,15)));
+
+ info->setFrom(_info);
+ info->setTo(_path);
+ generatedPath = true;
+ }
+
+ QString flags;
+ if (msgflags[_mfile])
+ flags = msgFlagsToString(*(msgflags[_mfile]));
+
+ if(info->removeDupMsg) {
+ if(! addMessage( info, _path, dir.filePath(*mailFile), flags )) {
+ info->addLog( i18n("Could not import %1").arg( *mailFile ) );
+ }
+ info->setCurrent((int) ((float) currentFile / numFiles * 100));
+ } else {
+ if(! addMessage_fastImport( info, _path, dir.filePath(*mailFile), flags )) {
+ info->addLog( i18n("Could not import %1").arg( *mailFile ) );
+ }
+ info->setCurrent((int) ((float) currentFile / numFiles * 100));
+ }
+ }
+ }
+}
+
+
+void FilterSylpheed::readMarkFile( FilterInfo *info, const QString &path, QDict<unsigned long> &dict )
+{
+ /* Each sylpheed mail directory contains a .sylpheed_mark file which
+ * contains all the flags for each messages. The layout of this file
+ * is documented in the source code of sylpheed: in procmsg.h for
+ * the flag bits, and procmsg.c.
+ *
+ * Note that the mark file stores 32 bit unsigned integers in the
+ * platform's native "endianness".
+ *
+ * The mark file starts with a 32 bit unsigned integer with a version
+ * number. It is then followed by pairs of 32 bit unsigned integers,
+ * the first one with the message file name (which is a number),
+ * and the second one with the actual message flags */
+
+ Q_UINT32 in, flags;
+ QFile file(path);
+
+ if (!file.open(IO_ReadOnly))
+ return;
+
+ QDataStream stream(&file);
+
+ if (Q_BYTE_ORDER == Q_LITTLE_ENDIAN)
+ stream.setByteOrder(QDataStream::LittleEndian);
+
+
+
+ /* Read version; if the value is reasonably too big, we're looking
+ * at a file created on another platform. I don't have any test
+ * marks/folders, so just ignoring this case */
+ stream >> in;
+ if (in > (Q_UINT32) 0xffff)
+ return;
+
+ while (!stream.atEnd()) {
+ if(info->shouldTerminate()){
+ file.close();
+ return;
+ }
+ stream >> in;
+ stream >> flags;
+ QString s;
+ s.setNum((uint) in);
+ dict.insert(s, new unsigned long(flags));
+ }
+}
+
+QString FilterSylpheed::msgFlagsToString(unsigned long flags)
+{
+ QString status;
+
+ /* see sylpheed's procmsg.h */
+ if (flags & 1UL) status += 'N';
+ if (flags & 2UL) status += 'U';
+ if ((flags & 3UL) == 0UL) status += 'R';
+ if (flags & 8UL) status += 'D';
+ if (flags & 16UL) status += 'A';
+ if (flags & 32UL) status += 'F';
+
+ return status;
+}
diff --git a/kmailcvt/filter_sylpheed.hxx b/kmailcvt/filter_sylpheed.hxx
new file mode 100644
index 000000000..c18f8bd8f
--- /dev/null
+++ b/kmailcvt/filter_sylpheed.hxx
@@ -0,0 +1,47 @@
+/***************************************************************************
+ filter_sylpheed.hxx - Sylpheed maildir mail import
+ -------------------
+ begin : April 07 2005
+ copyright : (C) 2005 by Danny Kukawka
+ email : danny.kukawka@web.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifndef FILTER_SYLPHEED_HXX
+#define FILTER_SYLPHEED_HXX
+
+#include <qdict.h>
+
+#include "filters.hxx"
+
+/**
+ * Imports Sylpheed mail folder with maildir format recursively, recreating the folder structure.
+ * @author Danny Kukawka
+ */
+class FilterSylpheed : public Filter
+{
+
+public:
+ FilterSylpheed(void);
+ ~FilterSylpheed(void);
+
+ void import(FilterInfo *info);
+
+private:
+ QString mailDir;
+
+ void importDirContents(FilterInfo*, const QString&);
+ void importFiles(FilterInfo*, const QString&);
+
+ void readMarkFile( FilterInfo*, const QString&, QDict<unsigned long>&);
+ QString msgFlagsToString(unsigned long);
+};
+
+#endif
diff --git a/kmailcvt/filter_thebat.cxx b/kmailcvt/filter_thebat.cxx
new file mode 100644
index 000000000..0e634e784
--- /dev/null
+++ b/kmailcvt/filter_thebat.cxx
@@ -0,0 +1,231 @@
+/***************************************************************************
+ filter_thebat.hxx - TheBat! mail import
+ -------------------
+ begin : April 07 2005
+ copyright : (C) 2005 by Danny Kukawka
+ email : danny.kukawka@web.de
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "filter_thebat.hxx"
+
+#include <config.h>
+
+#include <qregexp.h>
+#include <qvaluelist.h>
+
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <ktempfile.h>
+
+#include <kmessagebox.h>
+
+/** Default constructor. */
+FilterTheBat::FilterTheBat( void ) :
+ Filter( i18n( "Import The Bat! Mails and Folder Structure" ),
+ "Danny Kukawka",
+ i18n( "<p><b>The Bat! import filter</b></p>"
+ "<p>Select the base directory of the \'The Bat!\' local mailfolder you "
+ "want to import.</p>"
+ "<p><b>Note:</b> This filter imports the *.tbb-files from \'The Bat!\' "
+ "local folder, e.g. from POP accounts, and not from IMAP/DIMAP accounts.</p>"
+ "<p>Since it is possible to recreate the folder structure, the folders "
+ "will be stored under: \"TheBat-Import\" in your local account.</p>" ) )
+{}
+
+/** Destructor. */
+FilterTheBat::~FilterTheBat( void )
+{
+ endImport();
+}
+
+/** Recursive import of The Bat! maildir. */
+void FilterTheBat::import( FilterInfo *info )
+{
+ QString _homeDir = QDir::homeDirPath();
+
+ KFileDialog *kfd;
+ kfd = new KFileDialog( _homeDir, "", 0, "kfiledialog", true );
+ kfd->setMode( KFile::Directory | KFile::LocalOnly );
+ kfd->exec();
+ mailDir = kfd->selectedFile();
+
+ if ( mailDir.isEmpty() ) {
+ info->alert( i18n( "No directory selected." ) );
+ }
+ /**
+ * If the user only select homedir no import needed because
+ * there should be no files and we surely import wrong files.
+ */
+ else if ( mailDir == QDir::homeDirPath() || mailDir == ( QDir::homeDirPath() + "/" ) ) {
+ info->addLog( i18n( "No files found for import." ) );
+ } else {
+ info->setOverall(0);
+
+ /** Recursive import of the MailFolders */
+ QDir dir(mailDir);
+ QStringList rootSubDirs = dir.entryList("[^\\.]*", QDir::Dirs , QDir::Name);
+ int currentDir = 1, numSubDirs = rootSubDirs.size();
+ for(QStringList::Iterator filename = rootSubDirs.begin() ; filename != rootSubDirs.end() ; ++filename, ++currentDir) {
+ importDirContents(info, dir.filePath(*filename));
+ info->setOverall((int) ((float) currentDir / numSubDirs * 100));
+ if(info->shouldTerminate()) break;
+ }
+ }
+
+ info->addLog( i18n("Finished importing emails from %1").arg( mailDir ));
+ if (count_duplicates > 0) {
+ info->addLog( i18n("1 duplicate message not imported", "%n duplicate messages not imported", count_duplicates));
+ }
+ if (info->shouldTerminate()) info->addLog( i18n("Finished import, canceled by user."));
+
+ count_duplicates = 0;
+ info->setCurrent(100);
+ info->setOverall(100);
+}
+
+/**
+ * Import of a directory contents.
+ * @param info Information storage for the operation.
+ * @param dirName The name of the directory to import.
+ */
+void FilterTheBat::importDirContents( FilterInfo *info, const QString& dirName)
+{
+ if(info->shouldTerminate()) return;
+
+ /** Here Import all archives in the current dir */
+ QDir dir(dirName);
+ QDir importDir (dirName);
+ QStringList files = importDir.entryList("*.[tT][bB][bB]", QDir::Files, QDir::Name);
+ for ( QStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile) {
+ QString temp_mailfile = *mailFile;
+ importFiles(info, (dirName + "/" + temp_mailfile));
+ if(info->shouldTerminate()) return;
+ }
+
+ /** If there are subfolders, we import them one by one */
+ QDir subfolders(dirName);
+ QStringList subDirs = subfolders.entryList("[^\\.]*", QDir::Dirs , QDir::Name);
+ for(QStringList::Iterator filename = subDirs.begin() ; filename != subDirs.end() ; ++filename) {
+ importDirContents(info, subfolders.filePath(*filename));
+ if(info->shouldTerminate()) return;
+ }
+}
+
+/**
+ * Import the files within a Folder.
+ * @param info Information storage for the operation.
+ * @param dirName The name of the directory to import.
+ */
+void FilterTheBat::importFiles( FilterInfo *info, const QString& FileName)
+{
+
+ // Format of a tbb-file from The Bat! 3.x
+ // ----------------------------------------
+ // First comes a header of 3K (3128 byte/ 0x00000c38), which we can forget.
+ // The byte 3129 is the first character of the first message.
+ //
+ // The end of a message is marked trough "! p 0" and 43 following characters.
+ // (within: "_UB", blanks and some other chars.) Together are 48 characters as
+ // separator.
+ // ----------------------------------------
+
+ long l = 0;
+ QByteArray input(50);
+ QRegExp regexp("!.p.0");
+ QFile tbb(FileName);
+ int iFound = 0;
+ int count = 0;
+ long endOfEmail = 0;
+ QValueList<long> offsets;
+
+ if (!tbb.open(IO_ReadOnly)) {
+ info->alert(i18n("Unable to open %1, skipping").arg(FileName));
+ } else {
+ // BUILD the index of messages :
+ // We need this really ugly way, because read with tbb.readLine()
+ // does not work correct. Maybe in come in a continuous loop !!!
+ // Reason:
+ // if you use readLine() to read from a file with binary data
+ // QFile::at() and QFile::atEnd() return wrong value. So we
+ // never get QFile::atEnd() == true in some cases. This looks
+ // like a bug in Qt3 maybe fixed in Qt4.
+ //
+ while((l = tbb.readBlock(input.data(),50)) ) {
+ if(info->shouldTerminate()) {
+ tbb.close();
+ return;
+ }
+ QString _tmp = input.data();
+
+ if (tbb.atEnd())
+ break;
+
+ iFound = _tmp.contains(regexp);
+ if(!iFound) {
+ iFound = _tmp.findRev("!");
+ if (iFound >= 0 && ((l-iFound) < 5) ) {
+ int _i = tbb.at();
+ tbb.at((_i - iFound));
+ }
+ } else {
+ ++count;
+ endOfEmail = (tbb.at() - l + _tmp.find(regexp));
+ offsets.append(endOfEmail);
+ }
+ }
+ // info->addLog(i18n("--COUNTED: %1").arg(count));
+
+ // IMPORT the messages:
+ if(!offsets.empty() || (offsets.empty() && (tbb.size() > 3128))) {
+ offsets.append(tbb.size());
+ tbb.at(3128);
+ long lastPos = 3128;
+ long endPos = 0;
+
+ QString _path = "TheBat-Import/";
+ QString _tmp = FileName;
+ _tmp = _tmp.remove(_tmp.length() - 13, 13);
+ _path += _tmp.remove( mailDir ,TRUE);
+ QString _info = _path;
+ info->addLog(i18n("Import folder %1...").arg(_info.remove(0,14)));
+ info->setTo(_path);
+ info->setFrom("../" + _info + "/messages.tbb");
+
+ for(QValueList<long>::Iterator it = offsets.begin() ; it != offsets.end() ; ++it) {
+ if(info->shouldTerminate()) {
+ tbb.close();
+ return;
+ }
+ endPos = *it;
+ QByteArray input(endPos-lastPos);
+ tbb.readBlock(input.data(), endPos-lastPos);
+
+ KTempFile tmp;
+ tmp.file()->writeBlock( input, endPos-lastPos );
+ tmp.close();
+
+ //KMessageBox::warningContinueCancel(info->parent(), "");
+ if(info->removeDupMsg)
+ addMessage( info, _path, tmp.name() );
+ else
+ addMessage_fastImport( info, _path, tmp.name() );
+
+ tmp.unlink();
+ lastPos = endPos + 48;
+ tbb.at(lastPos);
+ info->setCurrent( (int) ( ( (float) tbb.at() / tbb.size() ) * 100 ));
+ }
+
+ }
+ }
+ tbb.close();
+}
diff --git a/kmailcvt/filter_thebat.hxx b/kmailcvt/filter_thebat.hxx
new file mode 100644
index 000000000..4dd80fa3f
--- /dev/null
+++ b/kmailcvt/filter_thebat.hxx
@@ -0,0 +1,42 @@
+/***************************************************************************
+ filter_thebat.hxx - TheBat! mail import
+ -------------------
+ begin : April 07 2005
+ copyright : (C) 2005 by Danny Kukawka
+ email : danny.kukawka@web.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifndef FILTER_THEBAT_HXX
+#define FILTER_THEBAT_HXX
+
+#include "filters.hxx"
+
+/**
+ * Imports The Bat! mail folder recursively, recreating the folder structure.
+ * @author Danny Kukawka
+ */
+class FilterTheBat : public Filter
+{
+
+public:
+ FilterTheBat(void);
+ ~FilterTheBat(void);
+
+ void import(FilterInfo *info);
+
+private:
+ QString mailDir;
+
+ void importDirContents(FilterInfo*, const QString&);
+ void importFiles(FilterInfo*, const QString&);
+};
+
+#endif
diff --git a/kmailcvt/filter_thunderbird.cxx b/kmailcvt/filter_thunderbird.cxx
new file mode 100644
index 000000000..e5d71564c
--- /dev/null
+++ b/kmailcvt/filter_thunderbird.cxx
@@ -0,0 +1,234 @@
+/***************************************************************************
+ filter_thunderbird.cxx - Thunderbird mail import
+ -------------------
+ begin : Januar 26 2005
+ copyright : (C) 2005 by Danny Kukawka
+ email : danny.kukawka@web.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "filter_thunderbird.hxx"
+
+#include <config.h>
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <ktempfile.h>
+
+
+/** Default constructor. */
+FilterThunderbird::FilterThunderbird(void) :
+ Filter(i18n("Import Thunderbird/Mozilla Local Mails and Folder Structure"),
+ "Danny Kukawka",
+ i18n("<p><b>Thunderbird/Mozilla import filter</b></p>"
+ "<p>Select your base Thunderbird/Mozilla mailfolder"
+ " (usually ~/.thunderbird/*.default/Mail/Local Folders/).</p>"
+ "<p><b>Note:</b> Never choose a Folder which <u>does not</u> contain mbox-files (for example,"
+ " a maildir): if you do, you will get many new folders.</p>"
+ "<p>Since it is possible to recreate the folder structure, the folders "
+ "will be stored under: \"Thunderbird-Import\".</p>"))
+{}
+
+/** Destructor. */
+FilterThunderbird::~FilterThunderbird(void)
+{
+ endImport();
+}
+
+/** Recursive import of Evolution's mboxes. */
+void FilterThunderbird::import(FilterInfo *info)
+{
+ /**
+ * We ask the user to choose Evolution's root directory.
+ * This should be usually ~/.thunderbird/xxxx.default/Mail/Local Folders/
+ */
+ QString thunderDir = QDir::homeDirPath() + "/.thunderbird/";
+ QDir d( thunderDir );
+ if ( !d.exists() ) {
+ thunderDir = QDir::homeDirPath();
+ }
+
+ KFileDialog *kfd;
+ kfd = new KFileDialog( thunderDir, "", 0, "kfiledialog", true );
+ kfd->setMode(KFile::Directory | KFile::LocalOnly);
+ kfd->exec();
+ mailDir = kfd->selectedFile();
+
+ if (mailDir.isEmpty()) {
+ info->alert(i18n("No directory selected."));
+ }
+ /**
+ * If the user only select homedir no import needed because
+ * there should be no files and we surely import wrong files.
+ */
+ else if ( mailDir == QDir::homeDirPath() || mailDir == (QDir::homeDirPath() + "/")) {
+ info->addLog(i18n("No files found for import."));
+ } else {
+ info->setOverall(0);
+
+ /** Recursive import of the MailArchives */
+ QDir dir(mailDir);
+ QStringList rootSubDirs = dir.entryList("[^\\.]*", QDir::Dirs, QDir::Name); // Removal of . and ..
+ int currentDir = 1, numSubDirs = rootSubDirs.size();
+ for(QStringList::Iterator filename = rootSubDirs.begin() ; filename != rootSubDirs.end() ; ++filename, ++currentDir) {
+ if(info->shouldTerminate()) break;
+ importDirContents(info, dir.filePath(*filename), *filename, *filename);
+ info->setOverall((int) ((float) currentDir / numSubDirs * 100));
+ }
+
+ /** import last but not least all archives from the root-dir */
+ QDir importDir (mailDir);
+ QStringList files = importDir.entryList("[^\\.]*", QDir::Files, QDir::Name);
+ for ( QStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile) {
+ if(info->shouldTerminate()) break;
+ QString temp_mailfile = *mailFile;
+ if (temp_mailfile.endsWith(".msf") || temp_mailfile.endsWith("msgFilterRules.dat")) {}
+ else {
+ info->addLog( i18n("Start import file %1...").arg( temp_mailfile ) );
+ importMBox(info, mailDir + temp_mailfile , temp_mailfile, QString::null);
+ }
+ }
+
+ info->addLog( i18n("Finished importing emails from %1").arg( mailDir ));
+ if(count_duplicates > 0) {
+ info->addLog( i18n("1 duplicate message not imported", "%n duplicate messages not imported", count_duplicates));
+ }
+ }
+ if (info->shouldTerminate()) info->addLog( i18n("Finished import, canceled by user."));
+ info->setCurrent(100);
+ info->setOverall(100);
+}
+
+/**
+ * Import of a directory contents.
+ * @param info Information storage for the operation.
+ * @param dirName The name of the directory to import.
+ * @param KMailRootDir The directory's root directory in KMail's folder structure.
+ * @param KMailSubDir The directory's direct ancestor in KMail's folder structure.
+ */
+void FilterThunderbird::importDirContents(FilterInfo *info, const QString& dirName, const QString& KMailRootDir, const QString& KMailSubDir)
+{
+ if(info->shouldTerminate()) return;
+ /** Here Import all archives in the current dir */
+ QDir dir(dirName);
+
+ QDir importDir (dirName);
+ QStringList files = importDir.entryList("[^\\.]*", QDir::Files, QDir::Name);
+ for ( QStringList::Iterator mailFile = files.begin(); mailFile != files.end(); ++mailFile) {
+ if(info->shouldTerminate()) break;
+ QString temp_mailfile = *mailFile;
+ if (temp_mailfile.endsWith(".msf") || temp_mailfile.endsWith("msgFilterRules.dat")) {}
+ else {
+ info->addLog( i18n("Start import file %1...").arg( temp_mailfile ) );
+ importMBox(info, (dirName + "/" + temp_mailfile) , KMailRootDir, KMailSubDir);
+ }
+ }
+
+ /** If there are subfolders, we import them one by one */
+ QDir subfolders(dirName);
+ QStringList subDirs = subfolders.entryList("[^\\.]*", QDir::Dirs, QDir::Name);
+ for(QStringList::Iterator filename = subDirs.begin() ; filename != subDirs.end() ; ++filename) {
+ if(info->shouldTerminate()) break;
+ QString kSubDir;
+ if(!KMailSubDir.isNull()) {
+ kSubDir = KMailSubDir + "/" + *filename;
+ } else {
+ kSubDir = *filename;
+ }
+ importDirContents(info, subfolders.filePath(*filename), KMailRootDir, kSubDir);
+ }
+}
+
+/**
+ * Import of a MBox file.
+ * @param info Information storage for the operation.
+ * @param dirName The MBox's name.
+ * @param KMailRootDir The directory's root directory in KMail's folder structure.
+ * @param KMailSubDir The directory's equivalent in KMail's folder structure. *
+ */
+void FilterThunderbird::importMBox(FilterInfo *info, const QString& mboxName, const QString& rootDir, const QString& targetDir)
+{
+ QFile mbox(mboxName);
+ bool first_msg = true;
+ if (!mbox.open(IO_ReadOnly)) {
+ info->alert(i18n("Unable to open %1, skipping").arg(mboxName));
+ } else {
+ QFileInfo filenameInfo(mboxName);
+
+ info->setCurrent(0);
+ if( mboxName.length() > 20 ) {
+ QString tmp_info = mboxName;
+ tmp_info = tmp_info.replace( mailDir, "../" );
+ if (tmp_info.contains(".sbd"))
+ tmp_info.remove(".sbd");
+ info->setFrom( tmp_info );
+ } else
+ info->setFrom(mboxName);
+ if(targetDir.contains(".sbd")) {
+ QString tmp_info = targetDir;
+ tmp_info.remove(".sbd");
+ info->setTo(tmp_info);
+ } else
+ info->setTo(targetDir);
+
+ QByteArray input(MAX_LINE);
+ long l = 0;
+
+ while (!mbox.atEnd()) {
+ KTempFile tmp;
+ /** @todo check if the file is really a mbox, maybe search for 'from' string at start */
+ /* comment by Danny:
+ * Don't use QTextStream to read from mbox, etter use QDataStream. QTextStream only
+ * support Unicode/Latin1/Locale. So you lost information from emails with
+ * charset!=Unicode/Latin1/Locale (e.g. KOI8-R) and Content-Transfer-Encoding != base64
+ * (e.g. 8Bit). It also not help to convert the QTextStream to Unicode. By this you
+ * get Unicode/UTF-email but KMail can't detect the correct charset.
+ */
+ QCString seperate;
+
+ if(!first_msg)
+ tmp.file()->writeBlock( input, l );
+ l = mbox.readLine( input.data(),MAX_LINE); // read the first line, prevent "From "
+ 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 );
+ }
+ tmp.close();
+ first_msg = false;
+
+ QString destFolder;
+ QString _targetDir = targetDir;
+ if(!targetDir.isNull()) {
+ if(_targetDir.contains(".sbd"))
+ _targetDir.remove(".sbd");
+ destFolder += "Thunderbird-Import/" + _targetDir + "/" + filenameInfo.baseName(TRUE);// mboxName;
+ } else {
+ destFolder = "Thunderbird-Import/" + rootDir;
+ if(destFolder.contains(".sbd"))
+ destFolder.remove(".sbd");
+ }
+
+ if(info->removeDupMsg)
+ addMessage( info, destFolder, tmp.name() );
+ else
+ addMessage_fastImport( info, destFolder, tmp.name() );
+
+ tmp.unlink();
+ int currentPercentage = (int) (((float) mbox.at() / filenameInfo.size()) * 100);
+ info->setCurrent(currentPercentage);
+ if (info->shouldTerminate()) {
+ mbox.close();
+ return;
+ }
+ }
+ mbox.close();
+ }
+}
diff --git a/kmailcvt/filter_thunderbird.hxx b/kmailcvt/filter_thunderbird.hxx
new file mode 100644
index 000000000..438089b91
--- /dev/null
+++ b/kmailcvt/filter_thunderbird.hxx
@@ -0,0 +1,42 @@
+/***************************************************************************
+ filter_thunderbird.hxx - Thunderbird mail import
+ -------------------
+ begin : Januar 26 2005
+ copyright : (C) 2005 by Danny Kukawka
+ email : danny.kukawka@web.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef FILTER_THUNDERBIRD_HXX
+#define FILTER_THUNDERBIRD_HXX
+
+#include "filters.hxx"
+
+/**
+ * Imports Thinderbird mail folder recursively, keeping the folder structure.
+ * @author Danny Kukawka
+ */
+class FilterThunderbird : public Filter
+{
+public:
+ FilterThunderbird(void);
+ ~FilterThunderbird(void);
+
+ void import(FilterInfo *info);
+
+private:
+ QString mailDir;
+
+ void importDirContents(FilterInfo*, const QString&, const QString&, const QString&);
+ void importMBox(FilterInfo*, const QString&, const QString&, const QString&);
+};
+
+#endif
diff --git a/kmailcvt/filters.cxx b/kmailcvt/filters.cxx
new file mode 100644
index 000000000..02f869853
--- /dev/null
+++ b/kmailcvt/filters.cxx
@@ -0,0 +1,213 @@
+/***************************************************************************
+ filters.cxx - description
+ -------------------
+ begin : Fri Jun 30 2000
+ copyright : (C) 2000 by Hans Dijkema
+ email : kmailcvt@hum.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <dcopclient.h>
+#include <dcopref.h>
+#include <kurl.h>
+#include <kdebug.h>
+
+#include "filters.hxx"
+#include "kmailcvt.h"
+
+
+//////////////////////////////////////////////////////////////////////////////////
+//
+// The API to the kmailcvt dialog --> Gives the import filter access to
+// put information on the dialog.
+//
+//////////////////////////////////////////////////////////////////////////////////
+
+bool FilterInfo::s_terminateASAP = false;
+
+FilterInfo::FilterInfo( KImportPageDlg* dlg, QWidget* parent , bool _removeDupMsg)
+ : m_dlg( dlg ),
+ m_parent( parent )
+{
+ removeDupMsg = _removeDupMsg;
+ s_terminateASAP = false;
+}
+
+FilterInfo::~FilterInfo()
+{
+}
+
+void FilterInfo::setStatusMsg( const QString& status )
+{
+ m_dlg->_textStatus->setText( status );
+}
+
+void FilterInfo::setFrom( const QString& from )
+{
+ m_dlg->_from->setText( from );
+}
+
+void FilterInfo::setTo( const QString& to )
+{
+ m_dlg->_to->setText( to );
+}
+
+void FilterInfo::setCurrent( const QString& current )
+{
+ m_dlg->_current->setText( current );
+ kapp->processEvents();
+}
+
+void FilterInfo::setCurrent( int percent )
+{
+ m_dlg->_done_current->setProgress( percent );
+ kapp->processEvents(); // Be careful - back & finish buttons disabled, so only user event that can happen is cancel/close button
+}
+
+void FilterInfo::setOverall( int percent )
+{
+ m_dlg->_done_overall->setProgress( percent );
+}
+
+void FilterInfo::addLog( const QString& log )
+{
+ m_dlg->_log->insertItem( log );
+ m_dlg->_log->setCurrentItem( m_dlg->_log->count() - 1 );
+ m_dlg->_log->centerCurrentItem();
+ kapp->processEvents();
+}
+
+void FilterInfo::clear()
+{
+ m_dlg->_log->clear();
+ setCurrent();
+ setOverall();
+ setCurrent( QString::null );
+ setFrom( QString::null );
+ setTo( QString::null );
+}
+
+void FilterInfo::alert( const QString& message )
+{
+ KMessageBox::information( m_parent, message );
+}
+
+void FilterInfo::terminateASAP()
+{
+ s_terminateASAP = true;
+}
+
+bool FilterInfo::shouldTerminate()
+{
+ return s_terminateASAP;
+}
+
+//////////////////////////////////////////////////////////////////////////////////
+//
+// The generic filter class
+//
+//////////////////////////////////////////////////////////////////////////////////
+
+
+Filter::Filter( const QString& name, const QString& author,
+ const QString& info )
+ : m_name( name ),
+ m_author( author ),
+ m_info( info )
+{
+ //public
+ count_duplicates = 0;
+}
+
+bool Filter::addMessage( FilterInfo* info, const QString& folderName,
+ const QString& msgPath, const QString & msgStatusFlags)
+{
+ KURL msgURL;
+ msgURL.setPath( msgPath );
+
+ if ( !kapp->dcopClient()->isApplicationRegistered( "kmail" ) )
+ KApplication::startServiceByDesktopName( "kmail", QString::null ); // Will wait until kmail is started
+
+ DCOPReply reply = DCOPRef( "kmail", "KMailIface" ).call( "dcopAddMessage", folderName, msgURL, msgStatusFlags );
+
+ if ( !reply.isValid() )
+ {
+ info->alert( i18n( "<b>Fatal:</b> Unable to start KMail for DCOP communication. "
+ "Make sure <i>kmail</i> is installed." ) );
+ return false;
+ }
+
+ switch ( int( reply ) )
+ {
+ case -1:
+ info->alert( i18n( "Cannot make folder %1 in KMail" ).arg( folderName ) );
+ return false;
+ case -2:
+ info->alert( i18n( "Cannot add message to folder %1 in KMail" ).arg( folderName ) );
+ return false;
+ case -4:
+ count_duplicates++;
+ return false;
+ case 0:
+ info->alert( i18n( "Error while adding message to folder %1 in KMail" ).arg( folderName ) );
+ return false;
+ }
+ return true;
+}
+
+bool Filter::addMessage_fastImport( FilterInfo* info, const QString& folderName,
+ const QString& msgPath, const QString& msgStatusFlags )
+{
+ KURL msgURL;
+ msgURL.setPath( msgPath );
+
+ if ( !kapp->dcopClient()->isApplicationRegistered( "kmail" ) )
+ KApplication::startServiceByDesktopName( "kmail", QString::null ); // Will wait until kmail is started
+
+ DCOPReply reply = DCOPRef( "kmail", "KMailIface" ).call( "dcopAddMessage_fastImport", folderName, msgURL, msgStatusFlags );
+ if ( !reply.isValid() )
+ {
+ info->alert( i18n( "<b>Fatal:</b> Unable to start KMail for DCOP communication. "
+ "Make sure <i>kmail</i> is installed." ) );
+ return false;
+ }
+
+ switch ( int( reply ) )
+ {
+ case -1:
+ info->alert( i18n( "Cannot make folder %1 in KMail" ).arg( folderName ) );
+ return false;
+ case -2:
+ info->alert( i18n( "Cannot add message to folder %1 in KMail" ).arg( folderName ) );
+ return false;
+ case 0:
+ info->alert( i18n( "Error while adding message to folder %1 in KMail" ).arg( folderName ) );
+ return false;
+ }
+ return true;
+}
+
+bool Filter::endImport()
+{
+ if ( !kapp->dcopClient()->isApplicationRegistered( "kmail" ) )
+ KApplication::startServiceByDesktopName( "kmail", QString::null ); // Will wait until kmail is started
+
+ DCOPReply reply = DCOPRef( "kmail", "KMailIface" ).call( "dcopAddMessage", QString::null, QString::null);
+ if ( !reply.isValid() ) return false;
+
+ reply = DCOPRef( "kmail", "KMailIface" ).call( "dcopResetAddMessage" );
+ if ( !reply.isValid() ) return false;
+
+ return true;
+}
+// vim: ts=2 sw=2 et
diff --git a/kmailcvt/filters.hxx b/kmailcvt/filters.hxx
new file mode 100644
index 000000000..10bb5c30b
--- /dev/null
+++ b/kmailcvt/filters.hxx
@@ -0,0 +1,143 @@
+/***************************************************************************
+ filters.hxx - description
+ -------------------
+ begin : Fri Jun 30 2000
+ copyright : (C) 2000 by Hans Dijkema
+ email : kmailcvt@hum.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef FILTERS_HXX
+#define FILTERS_HXX
+
+#ifndef MAX_LINE
+#define MAX_LINE 4096
+#endif
+
+#include <qcombobox.h>
+#include <qprogressbar.h>
+#include <qptrlist.h>
+#include <qlistbox.h>
+#include <qlabel.h>
+
+#include "kimportpagedlg.h"
+
+class FilterInfo
+{
+ public:
+ FilterInfo(KImportPageDlg *dlg, QWidget *parent, bool _removeDupMsg);
+ ~FilterInfo();
+
+ void setStatusMsg( const QString& status );
+ void setFrom( const QString& from );
+ void setTo( const QString& to );
+ void setCurrent( const QString& current );
+ void setCurrent( int percent = 0 );
+ void setOverall( int percent = 0 );
+ void addLog( const QString& log );
+ void clear();
+ void alert( const QString& message );
+ static void terminateASAP();
+ bool shouldTerminate();
+
+ QWidget *parent() { return m_parent; }
+ bool removeDupMsg;
+
+ private:
+ KImportPageDlg *m_dlg;
+ QWidget *m_parent;
+ static bool s_terminateASAP;
+};
+
+class Filter
+{
+ public:
+ Filter( const QString& name, const QString& author,
+ const QString& info = QString::null );
+ virtual ~Filter() {}
+ virtual void import( FilterInfo* ) = 0;
+ QString author() const { return m_author; }
+ QString name() const { return m_name; }
+ QString info() const { return m_info; }
+
+ int count_duplicates; //to count all duplicate messages
+
+ protected:
+ bool addMessage( FilterInfo* info,
+ const QString& folder,
+ const QString& msgFile,
+ const QString& msgStatusFlags = QString());
+ bool addMessage_fastImport( FilterInfo* info,
+ const QString& folder,
+ const QString& msgFile,
+ const QString& msgStatusFlags = QString());
+ bool endImport();
+ private:
+ QString m_name;
+ QString m_author;
+ QString m_info;
+};
+
+
+
+/**
+* Glorified QString[N] for (a) understandability (b) older gcc compatibility.
+*/
+template <unsigned int size> class FolderStructureBase
+{
+public:
+ typedef QString NString[size];
+ /** Constructor. Need a default constructor for QValueList. */
+ FolderStructureBase() {} ;
+
+ /** Constructor. Turn N QStrings into a folder structure
+ * description.
+ */
+ FolderStructureBase(const NString &s)
+ {
+ for(unsigned int i=0; i<size; i++) d[i]=s[i];
+ } ;
+
+ /** Copy Constructor. */
+ FolderStructureBase(const FolderStructureBase &s)
+ {
+ for(unsigned int i=0; i<size; i++) d[i]=s[i];
+ } ;
+
+ /** Assignment operator. Does the same thing as
+ * the copy constructor.
+ */
+ FolderStructureBase &operator =(const FolderStructureBase &s)
+ {
+ for(unsigned int i=0; i<size; i++) d[i]=s[i];
+ return *this;
+ } ;
+
+ /** Access the different fields. There doesn't seem to
+ * be a real semantics for the fields.
+ */
+ const QString operator [](unsigned int i) const
+ {
+ if (i<size) return d[i]; else return QString::null;
+ } ;
+
+ /** Access the different fields, for writing. */
+ QString &operator [](unsigned int i)
+ {
+ Q_ASSERT(i<size);
+ if (i<size) return d[i]; else return d[0];
+ } ;
+private:
+ QString d[size];
+} ;
+
+#endif
+
diff --git a/kmailcvt/kimportpage.cpp b/kmailcvt/kimportpage.cpp
new file mode 100644
index 000000000..d82571769
--- /dev/null
+++ b/kmailcvt/kimportpage.cpp
@@ -0,0 +1,33 @@
+/***************************************************************************
+ kimportpage.cpp - description
+ -------------------
+ begin : Fri Jan 17 2003
+ copyright : (C) 2003 by Laurence Anderso
+ email : l.d.anderson@warwick.ac.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <kapplication.h>
+#include <kstandarddirs.h>
+#include <qlabel.h>
+
+#include "kimportpage.h"
+
+KImportPage::KImportPage(QWidget *parent, const char *name ) : KImportPageDlg(parent,name) {
+
+ mIntroSidebar->setPixmap(locate("data", "kmailcvt/pics/step1.png"));
+}
+
+KImportPage::~KImportPage() {
+}
+
+#include "kimportpage.moc"
+
diff --git a/kmailcvt/kimportpage.h b/kmailcvt/kimportpage.h
new file mode 100644
index 000000000..9ab402f8e
--- /dev/null
+++ b/kmailcvt/kimportpage.h
@@ -0,0 +1,30 @@
+/***************************************************************************
+ kimportpage.h - description
+ -------------------
+ begin : Fri Jan 17 2003
+ copyright : (C) 2003 by Laurence Anderson
+ email : l.d.anderson@warwick.ac.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KIMPORTPAGE_H
+#define KIMPORTPAGE_H
+
+#include "kimportpagedlg.h"
+
+class KImportPage : public KImportPageDlg {
+ Q_OBJECT
+public:
+ KImportPage(QWidget *parent=0, const char *name=0);
+ ~KImportPage();
+};
+
+#endif
diff --git a/kmailcvt/kimportpagedlg.ui b/kmailcvt/kimportpagedlg.ui
new file mode 100644
index 000000000..4a90be531
--- /dev/null
+++ b/kmailcvt/kimportpagedlg.ui
@@ -0,0 +1,207 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KImportPageDlg</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KImportPageDlg</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>586</width>
+ <height>452</height>
+ </rect>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>mIntroSidebar</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>170</width>
+ <height>430</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>Panel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ <property name="indent">
+ <number>0</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer54</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>10</width>
+ <height>10</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout16</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout90</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel1_3</cstring>
+ </property>
+ <property name="text">
+ <string>From:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>To:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Current:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>_textStatus</cstring>
+ </property>
+ <property name="text">
+ <string>Importing in progress...</string>
+ </property>
+ <property name="alignment">
+ <set>AlignTop</set>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="1">
+ <property name="name">
+ <cstring>_current</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="1">
+ <property name="name">
+ <cstring>_to</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="5" column="0">
+ <property name="name">
+ <cstring>textLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>Total:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="1">
+ <property name="name">
+ <cstring>_from</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ <widget class="QProgressBar" row="5" column="1">
+ <property name="name">
+ <cstring>_done_overall</cstring>
+ </property>
+ </widget>
+ <widget class="QProgressBar" row="4" column="1">
+ <property name="name">
+ <cstring>_done_current</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QListBox">
+ <property name="name">
+ <cstring>_log</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Click 'Back' to import more emails or contacts</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmailcvt/kmailcvt.cpp b/kmailcvt/kmailcvt.cpp
new file mode 100644
index 000000000..840715de0
--- /dev/null
+++ b/kmailcvt/kmailcvt.cpp
@@ -0,0 +1,76 @@
+/***************************************************************************
+ kmailcvt.cpp - description
+ -------------------
+ copyright : (C) 2003 by Laurence Anderson
+ email : l.d.anderson@warwick.ac.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kmailcvt.h"
+#include <kaboutapplication.h>
+#include <qpushbutton.h>
+
+#include "filters.hxx"
+
+KMailCVT::KMailCVT(QWidget *parent, const char *name)
+ : KWizard(parent, name, true) {
+
+ setCaption( i18n( "KMailCVT Import Tool" ) );
+
+ selfilterpage = new KSelFilterPage(this);
+ addPage( selfilterpage, i18n( "Step 1: Select Filter" ) );
+
+ importpage = new KImportPage(this);
+ addPage( importpage, i18n( "Step 2: Importing..." ) );
+
+}
+
+KMailCVT::~KMailCVT() {
+}
+
+void KMailCVT::next() {
+ if( currentPage() == selfilterpage ){
+ // Save selected filter
+ Filter *selectedFilter = selfilterpage->getSelectedFilter();
+ // without filter don't go next
+ if (!selectedFilter)
+ return;
+ // Goto next page
+ KWizard::next();
+ // Disable back & finish
+ setBackEnabled( currentPage(), false );
+ setFinishEnabled( currentPage(), false );
+ // Start import
+ FilterInfo *info = new FilterInfo(importpage, this, selfilterpage->removeDupMsg_checked());
+ info->setStatusMsg(i18n("Import in progress"));
+ info->clear(); // Clear info from last time
+ selectedFilter->import(info);
+ info->setStatusMsg(i18n("Import finished"));
+ // Cleanup
+ delete info;
+ // Enable finish & back buttons
+ setFinishEnabled( currentPage(), true );
+ setBackEnabled( currentPage(), true );
+ } else KWizard::next();
+}
+
+void KMailCVT::reject() {
+ if ( currentPage() == importpage && ! finishButton()->isEnabled() ) FilterInfo::terminateASAP(); // ie. import in progress
+ else KWizard::reject();
+}
+
+void KMailCVT::help()
+{
+ KAboutApplication a( this );
+ a.exec();
+}
+
+#include "kmailcvt.moc"
diff --git a/kmailcvt/kmailcvt.h b/kmailcvt/kmailcvt.h
new file mode 100644
index 000000000..1875fa5fc
--- /dev/null
+++ b/kmailcvt/kmailcvt.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+ kmailcvt.h - description
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KMAILCVT_H
+#define KMAILCVT_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <kapplication.h>
+#include <kwizard.h>
+
+#include "kimportpage.h"
+#include "kselfilterpage.h"
+
+/** KMailCVT is the base class of the project */
+class KMailCVT : public KWizard {
+ Q_OBJECT
+public:
+ KMailCVT(QWidget* parent=0, const char *name=0);
+ ~KMailCVT();
+
+ virtual void next();
+ virtual void reject();
+public slots:
+ void help();
+private:
+ KSelFilterPage* selfilterpage;
+ KImportPage* importpage;
+};
+
+#endif
diff --git a/kmailcvt/kselfilterpage.cpp b/kmailcvt/kselfilterpage.cpp
new file mode 100644
index 000000000..1fa13b139
--- /dev/null
+++ b/kmailcvt/kselfilterpage.cpp
@@ -0,0 +1,98 @@
+/***************************************************************************
+ kselfilterpage.cpp - description
+ -------------------
+ begin : Fri Jan 17 2003
+ copyright : (C) 2003 by Laurence Anderson
+ email : l.d.anderson@warwick.ac.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <kstandarddirs.h>
+#include <qtextedit.h>
+#include <qcheckbox.h>
+#include <klocale.h>
+#include "filters.hxx"
+
+#include "filter_mbox.hxx"
+#include "filter_oe.hxx"
+#include "filter_outlook.hxx"
+#include "filter_pmail.hxx"
+#include "filter_plain.hxx"
+#include "filter_evolution.hxx"
+#include "filter_mailapp.hxx"
+#include "filter_evolution_v2.hxx"
+#include "filter_opera.hxx"
+#include "filter_thunderbird.hxx"
+#include "filter_kmail_maildir.hxx"
+#include "filter_sylpheed.hxx"
+#include "filter_thebat.hxx"
+#include "filter_lnotes.hxx"
+
+#include "kselfilterpage.h"
+
+KSelFilterPage::KSelFilterPage(QWidget *parent, const char *name ) : KSelFilterPageDlg(parent,name) {
+
+ mIntroSidebar->setPixmap(locate("data", "kmailcvt/pics/step1.png"));
+ mFilterList.setAutoDelete( TRUE );
+ connect(mFilterCombo, SIGNAL(activated(int)), SLOT(filterSelected(int)));
+
+ // Add new filters below. If this annoys you, please rewrite the stuff to use a factory.
+ // The former approach was overengineered and only worked around problems in the design
+ // For now, we have to live without the warm and fuzzy feeling a refactoring might give.
+ // Patches appreciated. (danimo)
+
+ addFilter(new FilterEvolution);
+ addFilter(new FilterEvolution_v2);
+ addFilter(new FilterKMail_maildir);
+ addFilter(new FilterMailApp);
+ addFilter(new FilterOpera);
+ addFilter(new FilterSylpheed);
+ addFilter(new FilterThunderbird);
+ addFilter(new FilterTheBat);
+ addFilter(new FilterOE);
+// addFilter(new FilterOutlook);
+ addFilter(new FilterPMail);
+ addFilter(new FilterMBox);
+ addFilter(new FilterLNotes);
+ addFilter(new FilterPlain);
+}
+
+KSelFilterPage::~KSelFilterPage() {
+}
+
+void KSelFilterPage::filterSelected(int i)
+{
+ QString info = mFilterList.at(i)->info();
+ QString author = mFilterList.at(i)->author();
+ if(!author.isEmpty())
+ info += i18n("<p><i>Written by %1.</i></p>").arg(author);
+ mDesc->setText(info);
+}
+
+void KSelFilterPage::addFilter(Filter *f)
+{
+ mFilterList.append(f);
+ mFilterCombo->insertItem(f->name());
+ if (mFilterCombo->count() == 1) filterSelected(0); // Setup description box with fist filter selected
+}
+
+bool KSelFilterPage::removeDupMsg_checked()
+{
+ return remDupMsg->isChecked();
+}
+
+Filter * KSelFilterPage::getSelectedFilter(void)
+{
+ return mFilterList.at(mFilterCombo->currentItem());
+}
+
+#include "kselfilterpage.moc"
+
diff --git a/kmailcvt/kselfilterpage.h b/kmailcvt/kselfilterpage.h
new file mode 100644
index 000000000..a91360d5f
--- /dev/null
+++ b/kmailcvt/kselfilterpage.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+ kselfilterpage.h - description
+ -------------------
+ begin : Fri Jan 17 2003
+ copyright : (C) 2003 by Laurence Anderson
+ email : l.d.anderson@warwick.ac.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KSELFILTERPAGE_H
+#define KSELFILTERPAGE_H
+
+#include "kselfilterpagedlg.h"
+class Filter;
+
+template <class T> class QPtrList;
+
+class KSelFilterPage : public KSelFilterPageDlg {
+ Q_OBJECT
+public:
+ KSelFilterPage(QWidget *parent=0, const char *name=0);
+ ~KSelFilterPage();
+public:
+ void addFilter(Filter *f);
+ Filter *getSelectedFilter(void);
+ bool removeDupMsg_checked();
+private:
+ QPtrList<Filter> mFilterList;
+private slots:
+ void filterSelected(int i);
+};
+
+#endif
diff --git a/kmailcvt/kselfilterpagedlg.ui b/kmailcvt/kselfilterpagedlg.ui
new file mode 100644
index 000000000..3b483645c
--- /dev/null
+++ b/kmailcvt/kselfilterpagedlg.ui
@@ -0,0 +1,144 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KSelFilterPageDlg</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KSelFilterPageDlg</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>606</width>
+ <height>461</height>
+ </rect>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>mIntroSidebar</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>170</width>
+ <height>430</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>Panel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ <property name="indent">
+ <number>0</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer56</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>10</width>
+ <height>10</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout19</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel6</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Welcome to KMailCVT - The KMail Import Tool&lt;/b&gt;
+&lt;br&gt;&lt;br&gt;
+This program will help you import your email from your previous email program into KMail.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
+ Please select the program you would like to import from, then click 'Next'.</string>
+ </property>
+ <property name="textFormat">
+ <enum>RichText</enum>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop|AlignLeft</set>
+ </property>
+ <property name="vAlign" stdset="0">
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>mFilterCombo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QTextEdit">
+ <property name="name">
+ <cstring>mDesc</cstring>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>remDupMsg</cstring>
+ </property>
+ <property name="text">
+ <string>Remove &amp;duplicate messages during import</string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kmailcvt/main.cpp b/kmailcvt/main.cpp
new file mode 100644
index 000000000..aea1edde5
--- /dev/null
+++ b/kmailcvt/main.cpp
@@ -0,0 +1,55 @@
+/***************************************************************************
+ main.cpp - description
+ -------------------
+ begin : Wed Aug 2 11:23:04 CEST 2000
+ copyright : (C) 2000 by Hans Dijkema
+ email : kmailcvt@hum.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <kcmdlineargs.h>
+#include <kaboutdata.h>
+#include <dcopclient.h>
+
+#include "kmailcvt.h"
+
+static const KCmdLineOptions options[] =
+{
+ KCmdLineLastOption
+};
+
+int main(int argc, char *argv[])
+{
+ KLocale::setMainCatalogue("kmailcvt");
+
+ KAboutData aboutData( "kmailcvt", I18N_NOOP("KMailCVT"),
+ "3", I18N_NOOP("KMail Import Filters"), KAboutData::License_GPL_V2,
+ I18N_NOOP("(c) 2000-2005, The KMailCVT developers"));
+ aboutData.addAuthor("Hans Dijkema",I18N_NOOP("Original author"), "kmailcvt@hum.org");
+ aboutData.addAuthor("Danny Kukawka", I18N_NOOP("Maintainer & New filters"), "danny.kukawka@web.de");
+ aboutData.addAuthor("Laurence Anderson", I18N_NOOP("New GUI & cleanups"), "l.d.anderson@warwick.ac.uk");
+ aboutData.addCredit("Daniel Molkentin", I18N_NOOP("New GUI & cleanups"), "molkentin@kde.org");
+
+ KCmdLineArgs::init( argc, argv, &aboutData );
+ KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
+
+ KApplication a;
+ KMailCVT *kmailcvt = new KMailCVT();
+ a.setMainWidget(kmailcvt);
+ kmailcvt->show();
+
+ DCOPClient *client=a.dcopClient();
+ if (!client->attach()) {
+ return 1;
+ }
+
+ return a.exec();
+}
diff --git a/kmailcvt/pics/Makefile.am b/kmailcvt/pics/Makefile.am
new file mode 100644
index 000000000..1bc57cade
--- /dev/null
+++ b/kmailcvt/pics/Makefile.am
@@ -0,0 +1,3 @@
+pics_DATA = step1.png
+picsdir = $(kde_datadir)/kmailcvt/pics
+
diff --git a/kmailcvt/pics/step1.png b/kmailcvt/pics/step1.png
new file mode 100644
index 000000000..cd0c3c8e8
--- /dev/null
+++ b/kmailcvt/pics/step1.png
Binary files differ
diff --git a/kmailcvt/samples/cygwin.mbox b/kmailcvt/samples/cygwin.mbox
new file mode 100644
index 000000000..0a6565b05
--- /dev/null
+++ b/kmailcvt/samples/cygwin.mbox
@@ -0,0 +1,1140 @@
+From cygwin-return-12862-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com Sat Jul 01 19:33:02 2000
+Return-Path: <cygwin-return-12862-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com>
+Delivered-To: listarch-cygwin@sourceware.cygnus.com
+Received: (qmail 5314 invoked by alias); 1 Jul 2000 19:33:00 -0000
+Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
+Precedence: bulk
+List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
+List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
+List-Post: <mailto:cygwin@sourceware.cygnus.com>
+List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
+Sender: cygwin-owner@sourceware.cygnus.com
+Delivered-To: mailing list cygwin@sourceware.cygnus.com
+Received: (qmail 5292 invoked from network); 1 Jul 2000 19:32:58 -0000
+Received: from oe27.law3.hotmail.com (HELO hotmail.com) (209.185.240.20)
+ by sourceware.cygnus.com with SMTP; 1 Jul 2000 19:32:58 -0000
+Received: (qmail 64582 invoked by uid 65534); 1 Jul 2000 19:32:22 -0000
+Message-ID: <20000701193222.64581.qmail@hotmail.com>
+X-Originating-IP: [212.216.213.14]
+From: "Meffo Leoni" <mef73@hotmail.com>
+To: <cygwin@sourceware.cygnus.com>
+Subject: import libraries in VC environment
+Date: Sat, 1 Jul 2000 21:31:11 +0200
+MIME-Version: 1.0
+Content-Type: multipart/alternative;
+ boundary="----=_NextPart_000_0043_01BFE3A3.AD4C5AE0"
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 5.00.2615.200
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
+
+------=_NextPart_000_0043_01BFE3A3.AD4C5AE0
+Content-Type: text/plain;
+ charset="iso-8859-1"
+Content-Transfer-Encoding: quoted-printable
+
+With the help of the mailing list support I compiled with cygwin wget =
+and lapack (light version 1.1).
+Now I have a question may I include successfully a library compiled in a =
+VC project workspace renaming it *.lib
+I need some dll's as the executable wget???
+
+------=_NextPart_000_0043_01BFE3A3.AD4C5AE0
+Content-Type: text/html;
+ charset="iso-8859-1"
+Content-Transfer-Encoding: quoted-printable
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML><HEAD>
+<META content=3D"text/html; charset=3Diso-8859-1" =
+http-equiv=3DContent-Type>
+<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
+<STYLE></STYLE>
+</HEAD>
+<BODY bgColor=3D#c8e0d8>
+<DIV><FONT face=3DArial size=3D2>With the help of the mailing list =
+support I=20
+compiled with cygwin wget and lapack (light version 1.1).</FONT></DIV>
+<DIV><FONT face=3DArial size=3D2>Now I have a question may I include =
+successfully a=20
+library compiled in a VC project workspace renaming it =
+*.lib</FONT></DIV>
+<DIV><FONT face=3DArial size=3D2>I need some dll's as the executable=20
+wget???</FONT></DIV></BODY></HTML>
+
+------=_NextPart_000_0043_01BFE3A3.AD4C5AE0--
+
+From cygwin-return-12863-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com Sat Jul 01 20:52:21 2000
+Return-Path: <cygwin-return-12863-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com>
+Delivered-To: listarch-cygwin@sourceware.cygnus.com
+Received: (qmail 19697 invoked by alias); 1 Jul 2000 20:52:21 -0000
+Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
+Precedence: bulk
+List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
+List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
+List-Post: <mailto:cygwin@sourceware.cygnus.com>
+List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
+Sender: cygwin-owner@sourceware.cygnus.com
+Delivered-To: mailing list cygwin@sourceware.cygnus.com
+Received: (qmail 19675 invoked from network); 1 Jul 2000 20:52:20 -0000
+Received: from net047s.hetnet.nl (HELO hetnet.nl) (194.151.104.151)
+ by sourceware.cygnus.com with SMTP; 1 Jul 2000 20:52:20 -0000
+Received: from hetnet.nl ([195.121.138.40]) by hetnet.nl with Microsoft SMTPSVC(5.5.1877.387.38);
+ Sat, 1 Jul 2000 22:51:50 +0200
+Message-ID: <395E5C61.7087F25E@hetnet.nl>
+Date: Sat, 01 Jul 2000 23:02:25 +0200
+From: "A.R. Burgers" <arburgers@hetnet.nl>
+X-Mailer: Mozilla 4.72 [en] (Win98; I)
+X-Accept-Language: en
+MIME-Version: 1.0
+To: cygwin@sourceware.cygnus.com
+Subject: problem building dynamic perl 5.6.0 modules
+Content-Type: text/plain; charset=us-ascii
+Content-Transfer-Encoding: 7bit
+
+Hi,
+
+I can't build dynamic modules anymore with Chuck Wilson's
+perl 5.6.0. E.g. building Storable-0.6.11 (Compress:Zlib
+gives the same problem) results in the fatal
+errors quoted at the end of this message.
+
+I am using stock cygwin-1.1.2 with all archives from today
+on Windows 98SE
+
+Anyone else having this problem or is this specific to my
+setup?
+
+thanks
+
+Teun Burgers
+
+erh066#1(~/.cpan/build/Storable-0.6.11)$ make
+LD_RUN_PATH="" ld2 -o blib/arch/auto/Storable/Storable.dll
+-L/usr/local/lib Storable.o
+/usr/local/lib/perl5/5.6.0/cygwin/CORE/libperl5_6_0.a
+dllwrap --dllname Storable.dll --driver-name gcc --dlltool dlltool
+--export-all-
+symbols --as as --output-def libStorable.def --output-lib libStorable.a
+\
+ -L/usr/local/lib Storable.o
+/usr/local/lib/perl5/5.6.0/cygwin/CORE/libperl5_6_0.a
+dllwrap: no export definition file provided
+dllwrap: creating one, but that may not be what you want
+
+Cannot reallocate 1828716544 bytes after allocating 68577308 bytes
+perlld: *** system() failed to execute
+dllwrap --dllname Storable.dll --driver-name gcc --dlltool dlltool
+--export-all-symbols --as as --output-def libStorable.def --output-lib
+libStorable.a \
+ -L/usr/local/lib Storable.o
+/usr/local/lib/perl5/5.6.0/cygwin/CORE/libperl5_6_0.a
+
+make: *** [blib/arch/auto/Storable/Storable.dll] Error 1
+[exited with 2]
+
+--
+Want to unsubscribe from this list?
+Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+
+From cygwin-return-12864-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com Sat Jul 01 21:08:20 2000
+Return-Path: <cygwin-return-12864-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com>
+Delivered-To: listarch-cygwin@sourceware.cygnus.com
+Received: (qmail 22740 invoked by alias); 1 Jul 2000 21:08:20 -0000
+Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
+Precedence: bulk
+List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
+List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
+List-Post: <mailto:cygwin@sourceware.cygnus.com>
+List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
+Sender: cygwin-owner@sourceware.cygnus.com
+Delivered-To: mailing list cygwin@sourceware.cygnus.com
+Received: (qmail 22719 invoked from network); 1 Jul 2000 21:08:19 -0000
+Received: from unknown (HELO smtp3.ev1.net) (207.218.192.47)
+ by sourceware.cygnus.com with SMTP; 1 Jul 2000 21:08:19 -0000
+Received: from ttimo.ecl1999.ec-lyon.fr [207.218.236.114] by smtp3.ev1.net with ESMTP
+ (SMTPD32-5.05) id AE041A18007E; Sat, 01 Jul 2000 16:09:24 -0500
+Message-Id: <4.3.1.2.20000701160049.00b9fa70@cc03.cc.ec-lyon.fr>
+X-Sender: besset@cc03.cc.ec-lyon.fr
+X-Mailer: QUALCOMM Windows Eudora Version 4.3.1
+Date: Sat, 01 Jul 2000 16:05:03 -0500
+To: cygwin@sourceware.cygnus.com
+From: Timothee Besset <timothee.besset@ecl1999.ec-lyon.fr>
+Subject: arpa/nameser.h
+Mime-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"; format=flowed
+
+I'm trying to port a nice IRC client to cygwin, originally written on
+FreeBSD, works fine on every unixes I've tried (FreeBSD, linux, IRIX and
+solaris).
+
+But on cygwin it doesn't find the arpa/nameser.h header. Is there a reason
+why this one is missing? Is it replaced by another one? What should I do to
+work around the problem?
+
+I found this thread in the archive:
+http://sourceware.cygnus.com/ml/cygwin/2000-05/msg00676.html but it doesn't
+have any follow ups..
+
+regards
+
+TTimo
+
+
+--
+Want to unsubscribe from this list?
+Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+
+From cygwin-return-12865-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com Sat Jul 01 21:16:37 2000
+Return-Path: <cygwin-return-12865-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com>
+Delivered-To: listarch-cygwin@sourceware.cygnus.com
+Received: (qmail 24666 invoked by alias); 1 Jul 2000 21:16:36 -0000
+Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
+Precedence: bulk
+List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
+List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
+List-Post: <mailto:cygwin@sourceware.cygnus.com>
+List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
+Sender: cygwin-owner@sourceware.cygnus.com
+Delivered-To: mailing list cygwin@sourceware.cygnus.com
+Received: (qmail 24641 invoked from network); 1 Jul 2000 21:16:36 -0000
+Received: from runyon.cygnus.com (HELO cygnus.com) (205.180.230.5)
+ by sourceware.cygnus.com with SMTP; 1 Jul 2000 21:16:36 -0000
+Received: from rtl.cygnus.com (loony.cygnus.com [205.180.230.181])
+ by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id OAA18934
+ for <cygwin@sourceware.cygnus.com>; Sat, 1 Jul 2000 14:16:35 -0700 (PDT)
+Received: (from cgf@localhost)
+ by rtl.cygnus.com (8.9.3/8.8.7) id RAA18470
+ for cygwin@sourceware.cygnus.com; Sat, 1 Jul 2000 17:16:17 -0400
+From: Chris Faylor <cgf@cygnus.com>
+Date: Sat, 1 Jul 2000 17:16:17 -0400
+To: cygwin@sourceware.cygnus.com
+Subject: Re: arpa/nameser.h
+Message-ID: <20000701171617.A18419@cygnus.com>
+Reply-To: cygwin@sourceware.cygnus.com
+Mail-Followup-To: cygwin@sourceware.cygnus.com
+References: <4.3.1.2.20000701160049.00b9fa70@cc03.cc.ec-lyon.fr>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline
+User-Agent: Mutt/1.2i
+In-Reply-To: <4.3.1.2.20000701160049.00b9fa70@cc03.cc.ec-lyon.fr>; from timothee.besset@ecl1999.ec-lyon.fr on Sat, Jul 01, 2000 at 04:05:03PM -0500
+
+On Sat, Jul 01, 2000 at 04:05:03PM -0500, Timothee Besset wrote:
+>I'm trying to port a nice IRC client to cygwin, originally written on
+>FreeBSD, works fine on every unixes I've tried (FreeBSD, linux, IRIX
+>and solaris).
+>
+>But on cygwin it doesn't find the arpa/nameser.h header. Is there a
+>reason why this one is missing? Is it replaced by another one? What
+>should I do to work around the problem?
+>
+>I found this thread in the archive:
+>http://sourceware.cygnus.com/ml/cygwin/2000-05/msg00676.html but it
+>doesn't have any follow ups..
+
+Most of the time when someone says "Why isn't this header available?"
+the answer is pretty simple. It just isn't there because no one has
+contributed it.
+
+The standard method for determining if another header has the needed
+declarations would be to use "grep" to search for the declarations that
+you are missing.
+
+cgf
+
+--
+Want to unsubscribe from this list?
+Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+
+From cygwin-return-12866-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com Sat Jul 01 21:18:35 2000
+Return-Path: <cygwin-return-12866-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com>
+Delivered-To: listarch-cygwin@sourceware.cygnus.com
+Received: (qmail 25800 invoked by alias); 1 Jul 2000 21:18:35 -0000
+Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
+Precedence: bulk
+List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
+List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
+List-Post: <mailto:cygwin@sourceware.cygnus.com>
+List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
+Sender: cygwin-owner@sourceware.cygnus.com
+Delivered-To: mailing list cygwin@sourceware.cygnus.com
+Received: (qmail 25771 invoked from network); 1 Jul 2000 21:18:30 -0000
+Received: from runyon.cygnus.com (HELO cygnus.com) (205.180.230.5)
+ by sourceware.cygnus.com with SMTP; 1 Jul 2000 21:18:30 -0000
+Received: from rtl.cygnus.com (loony.cygnus.com [205.180.230.181])
+ by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id OAA19018
+ for <cygwin@sourceware.cygnus.com>; Sat, 1 Jul 2000 14:18:29 -0700 (PDT)
+Received: (from cgf@localhost)
+ by rtl.cygnus.com (8.9.3/8.8.7) id RAA18484
+ for cygwin@sourceware.cygnus.com; Sat, 1 Jul 2000 17:18:11 -0400
+From: Chris Faylor <cgf@cygnus.com>
+Date: Sat, 1 Jul 2000 17:18:11 -0400
+To: cygwin@sourceware.cygnus.com
+Subject: [ADMIN] cygwin@sourceware is now stripping html text
+Message-ID: <20000701171811.A18475@cygnus.com>
+Reply-To: cygwin@sourceware.cygnus.com
+Mail-Followup-To: cygwin@sourceware.cygnus.com
+Mime-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: inline
+User-Agent: Mutt/1.2i
+
+I've finally taken the step of stripping html/text attachments from any
+email sent to this mailing list.
+
+Hopefully this won't mean that we'll now be seeing a bunch of blank email
+messages here.
+
+cgf
+
+--
+Want to unsubscribe from this list?
+Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+
+From cygwin-return-12867-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com Sat Jul 01 21:22:10 2000
+Return-Path: <cygwin-return-12867-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com>
+Delivered-To: listarch-cygwin@sourceware.cygnus.com
+Received: (qmail 27332 invoked by alias); 1 Jul 2000 21:22:09 -0000
+Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
+Precedence: bulk
+List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
+List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
+List-Post: <mailto:cygwin@sourceware.cygnus.com>
+List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
+Sender: cygwin-owner@sourceware.cygnus.com
+Delivered-To: mailing list cygwin@sourceware.cygnus.com
+Received: (qmail 27304 invoked from network); 1 Jul 2000 21:22:04 -0000
+Received: from pallas.veritas.com (204.177.156.25)
+ by sourceware.cygnus.com with SMTP; 1 Jul 2000 21:22:04 -0000
+Received: from megami.veritas.com (megami.veritas.com [192.203.46.101])
+ by pallas.veritas.com (8.9.1a/8.9.1) with SMTP id OAA14779
+ for <cygwin@sourceware.cygnus.com>; Sat, 1 Jul 2000 14:26:55 -0700 (PDT)
+Received: from veritas.com([166.98.15.90]) (1148 bytes) by megami.veritas.com
+ via sendmail with P:esmtp/R:smart_host/T:smtp
+ (sender: <rmcgowan@veritas.com>)
+ id <m138UiB-00006bC@megami.veritas.com>
+ for <cygwin@sourceware.cygnus.com>; Sat, 1 Jul 2000 14:22:03 -0700 (PDT)
+ (Smail-3.2.0.101 1997-Dec-17 #4 built 1999-Aug-24)
+Message-ID: <395E613F.B20AA3D3@veritas.com>
+Date: Sat, 01 Jul 2000 14:23:11 -0700
+From: Bob McGowan <rmcgowan@veritas.com>
+Organization: VERITAS Software
+X-Mailer: Mozilla 4.73 [en] (WinNT; U)
+X-Accept-Language: en
+MIME-Version: 1.0
+To: Cygwin <cygwin@sourceware.cygnus.com>
+Subject: Win2000 mount points and Cygwin
+Content-Type: text/plain; charset=us-ascii
+Content-Transfer-Encoding: 7bit
+Content-Transfer-Encoding: 7bit
+
+Windows 2000 has introduced the idea of a "mount point" to handle large
+numbers of disk partitions (beyond the number handled by the alphabet).
+>From a command prompt, the DIR command shows these items as <JUNCTION>
+while Explorer shows a disk icon rather than a folder.
+
+Problem is that Cygwin (I'm using the CD v. 1.0, no updates) does not
+recognize this new thing. I have not seen any discussion of this
+Windows feature in the list yet. Is this a known issue, maybe even
+fixed in a recent snapshot?
+
+Thanks,
+
+--
+Bob McGowan
+Staff Software Quality Engineer
+VERITAS Software
+rmcgowan@veritas.com
+
+--
+Want to unsubscribe from this list?
+Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+
+From cygwin-return-12868-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com Sat Jul 01 21:29:55 2000
+Return-Path: <cygwin-return-12868-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com>
+Delivered-To: listarch-cygwin@sourceware.cygnus.com
+Received: (qmail 29411 invoked by alias); 1 Jul 2000 21:29:55 -0000
+Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
+Precedence: bulk
+List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
+List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
+List-Post: <mailto:cygwin@sourceware.cygnus.com>
+List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
+Sender: cygwin-owner@sourceware.cygnus.com
+Delivered-To: mailing list cygwin@sourceware.cygnus.com
+Received: (qmail 29373 invoked from network); 1 Jul 2000 21:29:54 -0000
+Received: from pallas.veritas.com (204.177.156.25)
+ by sourceware.cygnus.com with SMTP; 1 Jul 2000 21:29:54 -0000
+Received: from megami.veritas.com (megami.veritas.com [192.203.46.101])
+ by pallas.veritas.com (8.9.1a/8.9.1) with SMTP id OAA14951
+ for <cygwin@sourceware.cygnus.com>; Sat, 1 Jul 2000 14:34:45 -0700 (PDT)
+Received: from veritas.com([166.98.15.90]) (1627 bytes) by megami.veritas.com
+ via sendmail with P:esmtp/R:smart_host/T:smtp
+ (sender: <rmcgowan@veritas.com>)
+ id <m138Upl-00006dC@megami.veritas.com>
+ for <cygwin@sourceware.cygnus.com>; Sat, 1 Jul 2000 14:29:53 -0700 (PDT)
+ (Smail-3.2.0.101 1997-Dec-17 #4 built 1999-Aug-24)
+Message-ID: <395E6315.559713DD@veritas.com>
+Date: Sat, 01 Jul 2000 14:31:01 -0700
+From: Bob McGowan <rmcgowan@veritas.com>
+Organization: VERITAS Software
+X-Mailer: Mozilla 4.73 [en] (WinNT; U)
+X-Accept-Language: en
+MIME-Version: 1.0
+To: Cygwin <cygwin@sourceware.cygnus.com>
+Subject: Re: Win2000 mount points and Cygwin
+References: <395E613F.B20AA3D3@veritas.com>
+Content-Type: text/plain; charset=us-ascii
+Content-Transfer-Encoding: 7bit
+Content-Transfer-Encoding: 7bit
+
+Scratch that. I'm not sure what I was looking at a minute ago, but
+whatever it was ain't happening now. Everything is as would be
+expected.
+
+My apologies for the misleading post.
+
+Bob McGowan wrote:
+>
+> Windows 2000 has introduced the idea of a "mount point" to handle large
+> numbers of disk partitions (beyond the number handled by the alphabet).
+> >From a command prompt, the DIR command shows these items as <JUNCTION>
+> while Explorer shows a disk icon rather than a folder.
+>
+> Problem is that Cygwin (I'm using the CD v. 1.0, no updates) does not
+> recognize this new thing. I have not seen any discussion of this
+> Windows feature in the list yet. Is this a known issue, maybe even
+> fixed in a recent snapshot?
+>
+> Thanks,
+>
+> --
+> Bob McGowan
+> Staff Software Quality Engineer
+> VERITAS Software
+> rmcgowan@veritas.com
+>
+> --
+> Want to unsubscribe from this list?
+> Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+
+--
+Bob McGowan
+Staff Software Quality Engineer
+VERITAS Software
+rmcgowan@veritas.com
+
+--
+Want to unsubscribe from this list?
+Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+
+From cygwin-return-12869-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com Sat Jul 01 21:55:27 2000
+Return-Path: <cygwin-return-12869-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com>
+Delivered-To: listarch-cygwin@sourceware.cygnus.com
+Received: (qmail 7367 invoked by alias); 1 Jul 2000 21:55:27 -0000
+Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
+Precedence: bulk
+List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
+List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
+List-Post: <mailto:cygwin@sourceware.cygnus.com>
+List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
+Sender: cygwin-owner@sourceware.cygnus.com
+Delivered-To: mailing list cygwin@sourceware.cygnus.com
+Received: (qmail 7347 invoked from network); 1 Jul 2000 21:55:27 -0000
+Received: from unknown (HELO smtp3.ev1.net) (207.218.192.47)
+ by sourceware.cygnus.com with SMTP; 1 Jul 2000 21:55:27 -0000
+Received: from ttimo.ecl1999.ec-lyon.fr [207.218.236.114] by smtp3.ev1.net with ESMTP
+ (SMTPD32-5.05) id A9111ADA007E; Sat, 01 Jul 2000 16:56:33 -0500
+Message-Id: <4.3.1.2.20000701164844.00bac4d0@cc03.cc.ec-lyon.fr>
+X-Sender: besset@cc03.cc.ec-lyon.fr
+X-Mailer: QUALCOMM Windows Eudora Version 4.3.1
+Date: Sat, 01 Jul 2000 16:52:11 -0500
+To: cygwin@sourceware.cygnus.com
+From: Timothee Besset <timothee.besset@ecl1999.ec-lyon.fr>
+Subject: Re: arpa/nameser.h
+In-Reply-To: <20000701171617.A18419@cygnus.com>
+References: <4.3.1.2.20000701160049.00b9fa70@cc03.cc.ec-lyon.fr>
+ <4.3.1.2.20000701160049.00b9fa70@cc03.cc.ec-lyon.fr>
+Mime-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"; format=flowed
+
+At 05:16 PM 7/1/00 -0400, you wrote:
+
+>Most of the time when someone says "Why isn't this header available?"
+>the answer is pretty simple. It just isn't there because no one has
+>contributed it.
+
+I understand that .. I whish I had the skills and the time it takes to
+write that kind of headers. But I don't want to step into the nightmare of
+building cygwin from CVS .. I have enough trouble building my own apps
+without messing with the core of the system.
+
+>The standard method for determining if another header has the needed
+>declarations would be to use "grep" to search for the declarations that
+>you are missing.
+
+TTimo
+
+
+--
+Want to unsubscribe from this list?
+Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+
+From cygwin-return-12870-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com Sun Jul 02 00:23:42 2000
+Return-Path: <cygwin-return-12870-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com>
+Delivered-To: listarch-cygwin@sourceware.cygnus.com
+Received: (qmail 28582 invoked by alias); 2 Jul 2000 00:23:42 -0000
+Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
+Precedence: bulk
+List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
+List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
+List-Post: <mailto:cygwin@sourceware.cygnus.com>
+List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
+Sender: cygwin-owner@sourceware.cygnus.com
+Delivered-To: mailing list cygwin@sourceware.cygnus.com
+Received: (qmail 28561 invoked from network); 2 Jul 2000 00:23:41 -0000
+Received: from pop3.cinetic.de (HELO smtp.web.de) (194.45.170.160)
+ by sourceware.cygnus.com with SMTP; 2 Jul 2000 00:23:41 -0000
+Received: from desktop by smtp.web.de with smtp
+ (freemail 4.0.1 #1555) id m138XXt-003yBzC; Sun, 2 Jul 2000 02:23 +0200
+From: =?iso-8859-1?Q?Boris_Sch=E4ling?= <boriss@web.de>
+To: <cygwin@sourceware.cygnus.com>
+Subject: RE: dead end: http://sourceware.cygnus.com/cygwin/snapshots/
+Date: Sun, 2 Jul 2000 02:23:47 +0200
+Message-ID: <LOBBKDBPKEGJJFKNFHKBKEKNDEAA.boriss@web.de>
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="iso-8859-1"
+Content-Transfer-Encoding: 8bit
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+Importance: Normal
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
+In-Reply-To: <4.3.1.2.20000630203721.01d838e8@pop.ma.ultranet.com>
+
+I think my last message wasn't clear enough. Here again a short description
+of the problem with the dead links.
+
+> -----Original Message-----
+> From: Larry Hall (RFK Partners, Inc) [mailto:lhall@rfk.com]
+> Sent: Saturday, July 01, 2000 2:38 AM
+> To: Boris Schäling
+> Subject: RE: dead end: http://sourceware.cygnus.com/cygwin/snapshots/
+>
+>
+> I see what you mean. Looks like some scripts have gone awry somewhere...
+>
+> Larry
+>
+>
+> At 08:28 PM 6/30/2000, you wrote:
+> >Hehe, I don't want to download the source files I want to browse the
+files
+> >online! I did this some weeks ago and downloaded some files. As far as I
+> >remember I surfed to http://sourceware.cygnus.com/cygwin/snapshots/ and
+> >clicked on one of the links called "list" on the right side of the page.
+> >Then I could browse the code online and could download only the files I
+> >needed. But these links to browse the code online don't work anymore (404
+> >error)?
+> >
+> >Boris
+> [...]
+
+
+--
+Want to unsubscribe from this list?
+Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+
+From cygwin-return-12871-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com Sun Jul 02 00:45:52 2000
+Return-Path: <cygwin-return-12871-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com>
+Delivered-To: listarch-cygwin@sourceware.cygnus.com
+Received: (qmail 32595 invoked by alias); 2 Jul 2000 00:45:51 -0000
+Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
+Precedence: bulk
+List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
+List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
+List-Post: <mailto:cygwin@sourceware.cygnus.com>
+List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
+Sender: cygwin-owner@sourceware.cygnus.com
+Delivered-To: mailing list cygwin@sourceware.cygnus.com
+Received: (qmail 32568 invoked from network); 2 Jul 2000 00:45:50 -0000
+Received: from runyon.cygnus.com (HELO cygnus.com) (205.180.230.5)
+ by sourceware.cygnus.com with SMTP; 2 Jul 2000 00:45:50 -0000
+Received: from rtl.cygnus.com (loony.cygnus.com [205.180.230.181])
+ by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id RAA24157
+ for <cygwin@sourceware.cygnus.com>; Sat, 1 Jul 2000 17:45:49 -0700 (PDT)
+Received: (from cgf@localhost)
+ by rtl.cygnus.com (8.9.3/8.8.7) id UAA00910
+ for cygwin@sourceware.cygnus.com; Sat, 1 Jul 2000 20:45:43 -0400
+From: Chris Faylor <cgf@cygnus.com>
+Date: Sat, 1 Jul 2000 20:45:43 -0400
+To: cygwin@sourceware.cygnus.com
+Subject: Re: dead end: http://sourceware.cygnus.com/cygwin/snapshots/
+Message-ID: <20000701204543.B878@cygnus.com>
+Reply-To: cygwin@sourceware.cygnus.com
+Mail-Followup-To: cygwin@sourceware.cygnus.com
+References: <4.3.1.2.20000630203721.01d838e8@pop.ma.ultranet.com> <LOBBKDBPKEGJJFKNFHKBKEKNDEAA.boriss@web.de>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=iso-8859-1
+Content-Disposition: inline
+Content-Transfer-Encoding: 8bit
+User-Agent: Mutt/1.2i
+In-Reply-To: <LOBBKDBPKEGJJFKNFHKBKEKNDEAA.boriss@web.de>; from boriss@web.de on Sun, Jul 02, 2000 at 02:23:47AM +0200
+
+On Sun, Jul 02, 2000 at 02:23:47AM +0200, Boris Schäling wrote:
+>>>I don't want to download the source files I want to browse the files
+>>>online! ... But these links to browse the code online don't work
+>>>anymore (404 error)?
+
+We have recently switched to using .bz2 tar files and the web
+server hadn't caught up with the change.
+
+This should now be fixed. Thanks for reporting the problem.
+
+cgf
+
+--
+Want to unsubscribe from this list?
+Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+
+From cygwin-return-12872-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com Sun Jul 02 01:01:49 2000
+Return-Path: <cygwin-return-12872-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com>
+Delivered-To: listarch-cygwin@sourceware.cygnus.com
+Received: (qmail 5044 invoked by alias); 2 Jul 2000 01:01:49 -0000
+Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
+Precedence: bulk
+List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
+List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
+List-Post: <mailto:cygwin@sourceware.cygnus.com>
+List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
+Sender: cygwin-owner@sourceware.cygnus.com
+Delivered-To: mailing list cygwin@sourceware.cygnus.com
+Received: (qmail 5021 invoked from network); 2 Jul 2000 01:01:47 -0000
+Received: from taxismtp2.alchemy.net (HELO taxismtp2.alchemyfx.com) (209.132.220.152)
+ by sourceware.cygnus.com with SMTP; 2 Jul 2000 01:01:47 -0000
+Received: from homepc (PPPa61-ResaleFremont2-5R7275.saturn.bbn.com [4.16.191.218])
+ by taxismtp2.alchemyfx.com (8.9.3/8.9.3) with ESMTP id RAA20718;
+ Sat, 1 Jul 2000 17:53:37 -0700
+Message-ID: <000301bfe3c2$535e1ae0$dabf1004@homepc.freedsl.com>
+Reply-To: "Dave Arnold" <avr_fan@mailandnews.com>
+From: "Dave Arnold" <avr_fan@nettaxi.com>
+To: <cygwin@sourceware.cygnus.com>
+Cc: "mail and news" <avr_fan@mailandnews.com>
+Subject: looking for good hex dump utility...
+Date: Sat, 1 Jul 2000 18:10:31 -0700
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 4.72.3110.5
+X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
+
+hi,
+
+can anyone recommend a good, simple hex dump utility that's
+available with very portable source code in c/c++ or java which I can
+build and use on any of the variety of GNU supported platforms?
+
+I just want something that I can take with me from one computer
+to the next as needed without having to find one for each platform
+as I go.
+
+Just would like be able to dump file contents and see hex and ascii
+values line by line 16bytes at a time with byte address in hex next
+to each line.
+
+thanks,
+/dAVe
+
+
+
+--
+Want to unsubscribe from this list?
+Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+
+From cygwin-return-12873-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com Sun Jul 02 01:35:09 2000
+Return-Path: <cygwin-return-12873-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com>
+Delivered-To: listarch-cygwin@sourceware.cygnus.com
+Received: (qmail 10548 invoked by alias); 2 Jul 2000 01:35:08 -0000
+Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
+Precedence: bulk
+List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
+List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
+List-Post: <mailto:cygwin@sourceware.cygnus.com>
+List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
+Sender: cygwin-owner@sourceware.cygnus.com
+Delivered-To: mailing list cygwin@sourceware.cygnus.com
+Received: (qmail 10527 invoked from network); 2 Jul 2000 01:35:08 -0000
+Received: from granger.mail.mindspring.net (207.69.200.148)
+ by sourceware.cygnus.com with SMTP; 2 Jul 2000 01:35:08 -0000
+Received: from TIMYX18EWDT6RQ (user-38ldm8f.dialup.mindspring.com [209.86.217.15])
+ by granger.mail.mindspring.net (8.9.3/8.8.5) with SMTP id VAA24497;
+ Sat, 1 Jul 2000 21:35:04 -0400 (EDT)
+Message-ID: <002201bfe3c6$226b9990$0100000a@TIMYX18EWDT6RQ>
+From: "Tim Prince" <tprince@computer.org>
+To: "Dave Arnold" <avr_fan@mailandnews.com>, <cygwin@sourceware.cygnus.com>
+Cc: "mail and news" <avr_fan@mailandnews.com>
+References: <000301bfe3c2$535e1ae0$dabf1004@homepc.freedsl.com>
+Subject: Re: looking for good hex dump utility...
+Date: Sat, 1 Jul 2000 18:37:49 -0700
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 5.00.2919.5600
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.5600
+
+If od doesn't match your description, it might help if you would
+clarify.
+
+Tim Prince
+----- Original Message -----
+From: "Dave Arnold" <avr_fan@nettaxi.com>
+To: <cygwin@sourceware.cygnus.com>
+Cc: "mail and news" <avr_fan@mailandnews.com>
+Sent: Saturday, July 01, 2000 6:10 PM
+Subject: looking for good hex dump utility...
+
+
+> hi,
+>
+> can anyone recommend a good, simple hex dump utility that's
+> available with very portable source code in c/c++ or java which I can
+> build and use on any of the variety of GNU supported platforms?
+>
+> I just want something that I can take with me from one computer
+> to the next as needed without having to find one for each platform
+> as I go.
+>
+> Just would like be able to dump file contents and see hex and ascii
+> values line by line 16bytes at a time with byte address in hex next
+> to each line.
+>
+> thanks,
+> /dAVe
+>
+>
+
+
+
+--
+Want to unsubscribe from this list?
+Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+
+From cygwin-return-12874-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com Sun Jul 02 02:05:45 2000
+Return-Path: <cygwin-return-12874-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com>
+Delivered-To: listarch-cygwin@sourceware.cygnus.com
+Received: (qmail 18248 invoked by alias); 2 Jul 2000 02:05:45 -0000
+Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
+Precedence: bulk
+List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
+List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
+List-Post: <mailto:cygwin@sourceware.cygnus.com>
+List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
+Sender: cygwin-owner@sourceware.cygnus.com
+Delivered-To: mailing list cygwin@sourceware.cygnus.com
+Received: (qmail 18225 invoked from network); 2 Jul 2000 02:05:44 -0000
+Received: from taxismtp2.alchemy.net (HELO taxismtp2.alchemyfx.com) (209.132.220.152)
+ by sourceware.cygnus.com with SMTP; 2 Jul 2000 02:05:44 -0000
+Received: from homepc (PPPa61-ResaleFremont2-5R7275.saturn.bbn.com [4.16.191.218])
+ by taxismtp2.alchemyfx.com (8.9.3/8.9.3) with ESMTP id SAA21290;
+ Sat, 1 Jul 2000 18:57:55 -0700
+Message-ID: <004601bfe3cb$4f9e3da0$dabf1004@homepc.freedsl.com>
+Reply-To: "Dave Arnold" <avr_fan@mailandnews.com>
+From: "Dave Arnold" <avr_fan@nettaxi.com>
+To: "Tim Prince" <tprince@computer.org>, <cygwin@sourceware.cygnus.com>
+Subject: Re: looking for good hex dump utility...
+Date: Sat, 1 Jul 2000 19:14:51 -0700
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 4.72.3110.5
+X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
+
+hi Tim,
+
+od seems to do the job but if I want to just see numbers 0-9 and letters a-z
+in the ascii output, how
+do I tell od to do that? by default od outputs 3 letter names for non
+character ascii values like
+del, nul, esc...
+
+For what I'm doing I only need to see the ascii values for letters and
+numbers and otherwise just
+a period '.' for everything else in the ascii output, but the hexoutput I'd
+like to see for everything.
+
+Is there a way to do this? I could probably edit the source code and change
+the ascii output
+part to do this right?
+
+so far I'm using od like this:
+
+> od -txa -w16 -Ax <file to dump>
+
+/dAVe
+
+
+
+-----Original Message-----
+From: Tim Prince <tprince@computer.org>
+To: Dave Arnold <avr_fan@mailandnews.com>; cygwin@sourceware.cygnus.com
+<cygwin@sourceware.cygnus.com>
+Cc: mail and news <avr_fan@mailandnews.com>
+Date: Saturday, July 01, 2000 6:35 PM
+Subject: Re: looking for good hex dump utility...
+
+
+>If od doesn't match your description, it might help if you would
+>clarify.
+>
+>Tim Prince
+>----- Original Message -----
+>From: "Dave Arnold" <avr_fan@nettaxi.com>
+>To: <cygwin@sourceware.cygnus.com>
+>Cc: "mail and news" <avr_fan@mailandnews.com>
+>Sent: Saturday, July 01, 2000 6:10 PM
+>Subject: looking for good hex dump utility...
+>
+>
+>> hi,
+>>
+>> can anyone recommend a good, simple hex dump utility that's
+>> available with very portable source code in c/c++ or java which I can
+>> build and use on any of the variety of GNU supported platforms?
+>>
+>> I just want something that I can take with me from one computer
+>> to the next as needed without having to find one for each platform
+>> as I go.
+>>
+>> Just would like be able to dump file contents and see hex and ascii
+>> values line by line 16bytes at a time with byte address in hex next
+>> to each line.
+>>
+>> thanks,
+>> /dAVe
+>>
+>>
+>
+>
+>
+>--
+>Want to unsubscribe from this list?
+>Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+>
+
+
+--
+Want to unsubscribe from this list?
+Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+
+From cygwin-return-12875-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com Sun Jul 02 02:35:43 2000
+Return-Path: <cygwin-return-12875-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com>
+Delivered-To: listarch-cygwin@sourceware.cygnus.com
+Received: (qmail 26017 invoked by alias); 2 Jul 2000 02:35:43 -0000
+Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
+Precedence: bulk
+List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
+List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
+List-Post: <mailto:cygwin@sourceware.cygnus.com>
+List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
+Sender: cygwin-owner@sourceware.cygnus.com
+Delivered-To: mailing list cygwin@sourceware.cygnus.com
+Received: (qmail 25946 invoked from network); 2 Jul 2000 02:35:41 -0000
+Received: from taxismtp2.alchemy.net (HELO taxismtp2.alchemyfx.com) (209.132.220.152)
+ by sourceware.cygnus.com with SMTP; 2 Jul 2000 02:35:41 -0000
+Received: from homepc (PPPa61-ResaleFremont2-5R7275.saturn.bbn.com [4.16.191.218])
+ by taxismtp2.alchemyfx.com (8.9.3/8.9.3) with ESMTP id TAA21659;
+ Sat, 1 Jul 2000 19:27:55 -0700
+Message-ID: <004d01bfe3cf$8092c120$dabf1004@homepc.freedsl.com>
+Reply-To: "Dave Arnold" <avr_fan@mailandnews.com>
+From: "Dave Arnold" <avr_fan@nettaxi.com>
+To: "Tim Prince" <tprince@computer.org>, <cygwin@sourceware.cygnus.com>
+Subject: OD outputs the hex from right to left?...hex dump utility...
+Date: Sat, 1 Jul 2000 19:44:51 -0700
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 4.72.3110.5
+X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
+
+hi Tim,
+
+I just realized that the od dump utility is dumping the hex values
+from right to left and then dumping the ascii values from left to right.
+
+This makes it very hard to read. Is there a flag or option to make the
+output of ascii and hex columns to be in the same order?
+
+here's a sample output.
+
+ 000000 00000009 34333231 bf003635 00000078
+ ht nul nul nul 1 2 3 4 5 6 nul ? x nul nul nul
+ 000010 454c4f53 4f525443 5343494e 0000ea00
+ S O L E C T R O N I C S nul j nul nul
+
+
+I like the output to appear like so:
+
+ 000010 534f4c45 4354524f 4e494353 00ea0000
+ S O L E C T R O N I C S nul j nul nul
+
+or even better like this:(all on one line, only letters and number seen on
+ascii view and a '.' for everything else)
+(also all on one line is much more readable)
+
+ 000010 000010 534f4c45 4354524f 4e494353 00ea0000
+SOLECTRONICS.J..
+
+Any help or suggestions on this would be very welcomed.
+
+/dAVe
+
+
+-----Original Message-----
+From: Tim Prince <tprince@computer.org>
+To: Dave Arnold <avr_fan@mailandnews.com>; cygwin@sourceware.cygnus.com
+<cygwin@sourceware.cygnus.com>
+Cc: mail and news <avr_fan@mailandnews.com>
+Date: Saturday, July 01, 2000 6:35 PM
+Subject: Re: looking for good hex dump utility...
+
+
+>If od doesn't match your description, it might help if you would
+>clarify.
+>
+>Tim Prince
+>----- Original Message -----
+>From: "Dave Arnold" <avr_fan@nettaxi.com>
+>To: <cygwin@sourceware.cygnus.com>
+>Cc: "mail and news" <avr_fan@mailandnews.com>
+>Sent: Saturday, July 01, 2000 6:10 PM
+>Subject: looking for good hex dump utility...
+>
+>
+>> hi,
+>>
+>> can anyone recommend a good, simple hex dump utility that's
+>> available with very portable source code in c/c++ or java which I can
+>> build and use on any of the variety of GNU supported platforms?
+>>
+>> I just want something that I can take with me from one computer
+>> to the next as needed without having to find one for each platform
+>> as I go.
+>>
+>> Just would like be able to dump file contents and see hex and ascii
+>> values line by line 16bytes at a time with byte address in hex next
+>> to each line.
+>>
+>> thanks,
+>> /dAVe
+>>
+>>
+>
+>
+>
+>--
+>Want to unsubscribe from this list?
+>Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+>
+
+
+--
+Want to unsubscribe from this list?
+Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+
+From cygwin-return-12876-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com Sun Jul 02 02:45:29 2000
+Return-Path: <cygwin-return-12876-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com>
+Delivered-To: listarch-cygwin@sourceware.cygnus.com
+Received: (qmail 28083 invoked by alias); 2 Jul 2000 02:45:29 -0000
+Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
+Precedence: bulk
+List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
+List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
+List-Post: <mailto:cygwin@sourceware.cygnus.com>
+List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
+Sender: cygwin-owner@sourceware.cygnus.com
+Delivered-To: mailing list cygwin@sourceware.cygnus.com
+Received: (qmail 28061 invoked from network); 2 Jul 2000 02:45:27 -0000
+Received: from delorie.com (207.22.48.162)
+ by sourceware.cygnus.com with SMTP; 2 Jul 2000 02:45:27 -0000
+Received: from envy.delorie.com (envy.delorie.com [207.22.48.171])
+ by delorie.com (8.9.1/8.9.1) with ESMTP id WAA07995;
+ Sat, 1 Jul 2000 22:45:22 -0400
+Received: (from dj@localhost)
+ by envy.delorie.com (8.9.3/8.8.8) id WAA14181;
+ Sat, 1 Jul 2000 22:45:20 -0400
+Date: Sat, 1 Jul 2000 22:45:20 -0400
+Message-Id: <200007020245.WAA14181@envy.delorie.com>
+From: DJ Delorie <dj@delorie.com>
+To: asharji@plg2.math.uwaterloo.ca
+CC: cygwin@sourceware.cygnus.com
+In-reply-to: <Pine.SOL.3.96.1000630214754.5827A-100000@plg2.math.uwaterloo.ca>
+ (asharji@plg2.math.uwaterloo.ca)
+Subject: Re: user defined malloc
+References: <Pine.SOL.3.96.1000630214754.5827A-100000@plg2.math.uwaterloo.ca>
+
+
+> My question is do I have to also override the _malloc_r routine, and
+> if so, could someone provide some information or a link on what is
+> required? It appears to be a reentrant version of malloc.
+
+Yup, newlib is heavy into reentrancy. However, _malloc_r isn't
+exported by cygwin1.dll and cygwin doesn't expect your program to
+replace it. I'm not sure how much of a "bug" this is, but I'm open
+for suggestions. Might want to ask on the newlib list also, I'm sure
+they have really good reasons to call the reentrant malloc.
+
+--
+Want to unsubscribe from this list?
+Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+
+From cygwin-return-12877-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com Sun Jul 02 04:17:28 2000
+Return-Path: <cygwin-return-12877-listarch-cygwin=sourceware.cygnus.com@sourceware.cygnus.com>
+Delivered-To: listarch-cygwin@sourceware.cygnus.com
+Received: (qmail 29612 invoked by alias); 2 Jul 2000 04:17:27 -0000
+Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
+Precedence: bulk
+List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
+List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
+List-Post: <mailto:cygwin@sourceware.cygnus.com>
+List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
+Sender: cygwin-owner@sourceware.cygnus.com
+Delivered-To: mailing list cygwin@sourceware.cygnus.com
+Received: (qmail 29591 invoked from network); 2 Jul 2000 04:17:25 -0000
+Received: from mail1.sunflower.com (root@24.124.0.137)
+ by sourceware.cygnus.com with SMTP; 2 Jul 2000 04:17:25 -0000
+Received: from Amanda (dv193s32.lawrence.ks.us [24.124.32.193])
+ by mail1.sunflower.com (8.9.3/8.9.3) with ESMTP id XAA24247;
+ Sat, 1 Jul 2000 23:17:22 -0500
+Message-Id: <200007020417.XAA24247@mail1.sunflower.com>
+From: "Doug Wyatt" <dwyatt@sunflower.com>
+To: "Dave Arnold" <avr_fan@nettaxi.com>
+Date: Sat, 1 Jul 2000 23:17:21 -0500
+MIME-Version: 1.0
+Content-type: text/plain; charset=US-ASCII
+Content-transfer-encoding: 7BIT
+Subject: Re: OD outputs the hex from right to left?...hex dump utility...
+Reply-to: dwyatt@sunflower.com
+CC: <cygwin@sourceware.cygnus.com>
+Priority: normal
+In-reply-to: <004d01bfe3cf$8092c120$dabf1004@homepc.freedsl.com>
+X-mailer: Pegasus Mail for Win32 (v3.12b)
+
+Hi,
+
+I would suggest either of the following:
+
+1. your requirements are so narrow and specific you could probably
+ write a tool to do what you want, in C or Perl, in less than an hour.
+
+2. use a big-endian computer, so the bytes are in the order you want
+ them (e.g. MC 68xxxx, or the pending IA-64).
+
+Regards,
+Doug Wyatt
+
+
+
+> hi Tim,
+>
+> I just realized that the od dump utility is dumping the hex values
+> from right to left and then dumping the ascii values from left to right.
+>
+> This makes it very hard to read. Is there a flag or option to make the
+> output of ascii and hex columns to be in the same order?
+>
+> here's a sample output.
+>
+> 000000 00000009 34333231 bf003635 00000078
+> ht nul nul nul 1 2 3 4 5 6 nul ? x nul nul nul
+> 000010 454c4f53 4f525443 5343494e 0000ea00
+> S O L E C T R O N I C S nul j nul nul
+>
+>
+> I like the output to appear like so:
+>
+> 000010 534f4c45 4354524f 4e494353 00ea0000
+> S O L E C T R O N I C S nul j nul nul
+>
+> or even better like this:(all on one line, only letters and number seen on
+> ascii view and a '.' for everything else)
+> (also all on one line is much more readable)
+>
+> 000010 000010 534f4c45 4354524f 4e494353 00ea0000
+> SOLECTRONICS.J..
+>
+> Any help or suggestions on this would be very welcomed.
+>
+> /dAVe
+>
+>
+> -----Original Message-----
+> From: Tim Prince <tprince@computer.org>
+> To: Dave Arnold <avr_fan@mailandnews.com>; cygwin@sourceware.cygnus.com
+> <cygwin@sourceware.cygnus.com>
+> Cc: mail and news <avr_fan@mailandnews.com>
+> Date: Saturday, July 01, 2000 6:35 PM
+> Subject: Re: looking for good hex dump utility...
+>
+>
+> >If od doesn't match your description, it might help if you would
+> >clarify.
+> >
+> >Tim Prince
+> >----- Original Message -----
+> >From: "Dave Arnold" <avr_fan@nettaxi.com>
+> >To: <cygwin@sourceware.cygnus.com>
+> >Cc: "mail and news" <avr_fan@mailandnews.com>
+> >Sent: Saturday, July 01, 2000 6:10 PM
+> >Subject: looking for good hex dump utility...
+> >
+> >
+> >> hi,
+> >>
+> >> can anyone recommend a good, simple hex dump utility that's
+> >> available with very portable source code in c/c++ or java which I can
+> >> build and use on any of the variety of GNU supported platforms?
+> >>
+> >> I just want something that I can take with me from one computer
+> >> to the next as needed without having to find one for each platform
+> >> as I go.
+> >>
+> >> Just would like be able to dump file contents and see hex and ascii
+> >> values line by line 16bytes at a time with byte address in hex next
+> >> to each line.
+> >>
+> >> thanks,
+> >> /dAVe
+> >>
+> >>
+> >
+> >
+> >
+> >--
+> >Want to unsubscribe from this list?
+> >Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+> >
+>
+>
+> --
+> Want to unsubscribe from this list?
+> Send a message to cygwin-unsubscribe@sourceware.cygnus.com
+
+
+
+--
+Want to unsubscribe from this list?
+Send a message to cygwin-unsubscribe@sourceware.cygnus.com
diff --git a/kmailcvt/samples/evolution/evolution_1.4.x.tar.bz2 b/kmailcvt/samples/evolution/evolution_1.4.x.tar.bz2
new file mode 100644
index 000000000..d12bc293e
--- /dev/null
+++ b/kmailcvt/samples/evolution/evolution_1.4.x.tar.bz2
Binary files differ
diff --git a/kmailcvt/samples/evolution/evolution_2.2.x.tar.bz2 b/kmailcvt/samples/evolution/evolution_2.2.x.tar.bz2
new file mode 100644
index 000000000..ba00d1513
--- /dev/null
+++ b/kmailcvt/samples/evolution/evolution_2.2.x.tar.bz2
Binary files differ
diff --git a/kmailcvt/samples/oe/CREDITS b/kmailcvt/samples/oe/CREDITS
new file mode 100644
index 000000000..a51338b8f
--- /dev/null
+++ b/kmailcvt/samples/oe/CREDITS
@@ -0,0 +1 @@
+These files came from mbx2mbox by David Coppit (david@coppit.org, http://coppit.org/)
diff --git a/kmailcvt/samples/oe/test1.mbx b/kmailcvt/samples/oe/test1.mbx
new file mode 100644
index 000000000..44f460292
--- /dev/null
+++ b/kmailcvt/samples/oe/test1.mbx
Binary files differ
diff --git a/kmailcvt/samples/oe/test2.dbx b/kmailcvt/samples/oe/test2.dbx
new file mode 100644
index 000000000..b9623797e
--- /dev/null
+++ b/kmailcvt/samples/oe/test2.dbx
Binary files differ
diff --git a/kmailcvt/samples/oe/test3.mbx b/kmailcvt/samples/oe/test3.mbx
new file mode 100644
index 000000000..cadafb89c
--- /dev/null
+++ b/kmailcvt/samples/oe/test3.mbx
Binary files differ
diff --git a/kmailcvt/samples/oe/test4.dbx b/kmailcvt/samples/oe/test4.dbx
new file mode 100644
index 000000000..1fdeba524
--- /dev/null
+++ b/kmailcvt/samples/oe/test4.dbx
Binary files differ
diff --git a/kmailcvt/samples/oe/test5.mbx b/kmailcvt/samples/oe/test5.mbx
new file mode 100644
index 000000000..1fdeba524
--- /dev/null
+++ b/kmailcvt/samples/oe/test5.mbx
Binary files differ
diff --git a/kmailcvt/samples/oe6/OutlookExpress6.tar.bz2 b/kmailcvt/samples/oe6/OutlookExpress6.tar.bz2
new file mode 100644
index 000000000..20cb8c1f2
--- /dev/null
+++ b/kmailcvt/samples/oe6/OutlookExpress6.tar.bz2
Binary files differ
diff --git a/kmailcvt/samples/pmail/pmail.tar.bz2 b/kmailcvt/samples/pmail/pmail.tar.bz2
new file mode 100644
index 000000000..ae1aa43ce
--- /dev/null
+++ b/kmailcvt/samples/pmail/pmail.tar.bz2
Binary files differ
diff --git a/kmailcvt/samples/sylpheed/sylpheed.tar.bz2 b/kmailcvt/samples/sylpheed/sylpheed.tar.bz2
new file mode 100644
index 000000000..2e7cd598e
--- /dev/null
+++ b/kmailcvt/samples/sylpheed/sylpheed.tar.bz2
Binary files differ
diff --git a/kmailcvt/samples/thebat/the_bat-Inbox.tar.bz2 b/kmailcvt/samples/thebat/the_bat-Inbox.tar.bz2
new file mode 100644
index 000000000..079e9ff55
--- /dev/null
+++ b/kmailcvt/samples/thebat/the_bat-Inbox.tar.bz2
Binary files differ
diff --git a/kmailcvt/uninstall.desktop b/kmailcvt/uninstall.desktop
new file mode 100644
index 000000000..e1e3e1732
--- /dev/null
+++ b/kmailcvt/uninstall.desktop
@@ -0,0 +1,2 @@
+[Desktop Entry]
+Hidden=true