From 637c11e444809aab7d6446ad05b8fba42a4f1c6e Mon Sep 17 00:00:00 2001 From: Michael Haeckel Date: Wed, 27 Jun 2001 20:04:48 +0000 Subject: [PATCH] Split up long FETCH commands up into several commands to work around a bug in Courier IMAP server, we trigger when fetching the headers of a highly fragmented folder. svn path=/trunk/kdenetwork/kmail/; revision=104169 --- kmacctimap.cpp | 21 +++++++++++++++++++++ kmversion.h | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/kmacctimap.cpp b/kmacctimap.cpp index 2ccb36412..276866454 100644 --- a/kmacctimap.cpp +++ b/kmacctimap.cpp @@ -431,6 +431,7 @@ void KMAcctImap::slotListFolderResult(KIO::Job * job) jobData jd; jd.parent = (*it).parent; jd.done = 0; + /* Workaround for a limitation in the freemail server at imap.web.de */ if (job->error() == KIO::ERR_UNSUPPORTED_ACTION) { (*it).parent->folder->expunge(); @@ -497,6 +498,26 @@ void KMAcctImap::slotListFolderResult(KIO::Job * job) uids += QString::number(first); else uids += QString::number(first) + ":" + QString::number(last); + + /* Workaround for a bug in the Courier IMAP server */ + if (uids.length() > 100 && uid != (*it).items.end()) + { + KURL url = getUrl(); + url.setPath((*it).parent->folder->imapPath() + ";UID=" + uids + + ";SECTION=ENVELOPE"); + makeConnection(); + KIO::SimpleJob *newJob = KIO::get(url, FALSE, FALSE); + KIO::Scheduler::assignJobToSlave(mSlave, newJob); + jobData jd2 = jd; + jd2.total = 0; + mapJobData.insert(newJob, jd2); + connect(newJob, SIGNAL(result(KIO::Job *)), + this, SLOT(slotSimpleResult(KIO::Job *))); + connect(newJob, SIGNAL(data(KIO::Job *, const QByteArray &)), + this, SLOT(slotGetMessagesData(KIO::Job *, const QByteArray &))); + uids = ""; + } + /* end workaround */ } } KURL url = getUrl(); diff --git a/kmversion.h b/kmversion.h index 648b4f9aa..4ff8c182f 100644 --- a/kmversion.h +++ b/kmversion.h @@ -3,6 +3,6 @@ #ifndef kmversion_h #define kmversion_h -#define KMAIL_VERSION "1.2.3" +#define KMAIL_VERSION "1.2.9" #endif /*kmversion_h*/