summaryrefslogtreecommitdiffabout
path: root/kmicromail
authorzautrix <zautrix>2004-10-18 10:57:05 (UTC)
committer zautrix <zautrix>2004-10-18 10:57:05 (UTC)
commita83b6694d2f80ec58f6eb88684897052c69276a0 (patch) (side-by-side diff)
tree4b20f33e874f035f54021638125ed293e4202613 /kmicromail
parent112db6c41265da5255a58424186d95d7a00b6ff0 (diff)
downloadkdepimpi-a83b6694d2f80ec58f6eb88684897052c69276a0.zip
kdepimpi-a83b6694d2f80ec58f6eb88684897052c69276a0.tar.gz
kdepimpi-a83b6694d2f80ec58f6eb88684897052c69276a0.tar.bz2
some mail imap changes
Diffstat (limited to 'kmicromail') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp
index b0dd1b8..a6688ed 100644
--- a/kmicromail/libmailwrapper/imapwrapper.cpp
+++ b/kmicromail/libmailwrapper/imapwrapper.cpp
@@ -62,5 +62,5 @@ void IMAPwrapper::progress( QString m )
if ( m != QString::null ) {
mProgrMess = m;
- mCurrent = 0;
+ mCurrent = 1;
return;
}
@@ -70,4 +70,5 @@ void IMAPwrapper::progress( QString m )
else mess = mProgrMess +tr(" message %1").arg( mCurrent++);
Global::statusMessage(mess);
+ qDebug("Progress %s %s", mess.latin1(), m.latin1());
qApp->processEvents();
}
@@ -234,4 +235,7 @@ void IMAPwrapper::logout()
void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> > &target , int maxSizeInKb)
{
+
+ int tryAgain = 1;
+ while ( tryAgain >= 0 ) {
int err = MAILIMAP_NO_ERROR;
clist *result = 0;
@@ -257,9 +261,13 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma
} else {
}
-
+ progress( tr("Fetch "));
+ mMax = last;
+ //qDebug("last %d ", last);
Global::statusMessage(tr("Fetching header list"));
qApp->processEvents();
/* the range has to start at 1!!! not with 0!!!! */
- set = mailimap_set_new_interval( 1, last );
+ //LR the access to web.de imap server is no working with value 1
+ qDebug("interval %d - %d ", tryAgain, last-1+tryAgain );
+ set = mailimap_set_new_interval( tryAgain, last );
fetchType = mailimap_fetch_type_new_fetch_att_list_empty();
mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_envelope());
@@ -275,8 +283,10 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma
if ( err == MAILIMAP_NO_ERROR ) {
+ tryAgain = -1;
mailimap_msg_att * msg_att;
int i = 0;
for (current = clist_begin(result); current != 0; current=clist_next(current)) {
++i;
+ //qDebug("iii %d ",i);
msg_att = (mailimap_msg_att*)current->data;
RecMail*m = parse_list_result(msg_att);
@@ -292,8 +302,15 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma
Global::statusMessage(tr("Mailbox has %1 mails").arg(target.count()));
} else {
+ --tryAgain;
+ --tryAgain;
+ if ( tryAgain < 0 )
Global::statusMessage(tr("Error fetching headers: %1").arg(m_imap->imap_response));
+ else
+ qDebug("try again... ");
}
+
if (result) mailimap_fetch_list_free(result);
}
+}
QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders()
@@ -953,5 +970,5 @@ void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target)
mMax = count;
- //progress( tr("Delete"));
+ progress( tr("Delete"));
QProgressBar wid ( count );