summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-09-10 20:16:14 (UTC)
committer zautrix <zautrix>2004-09-10 20:16:14 (UTC)
commit768ce5ccec90c1b062b749e7ad0464d09760b91c (patch) (side-by-side diff)
tree78523f09e276d6ac881ff20905ddacee1851af66
parentcebdd6de7481514ad5ea0517f7a2e8f4db422be5 (diff)
downloadkdepimpi-768ce5ccec90c1b062b749e7ad0464d09760b91c.zip
kdepimpi-768ce5ccec90c1b062b749e7ad0464d09760b91c.tar.gz
kdepimpi-768ce5ccec90c1b062b749e7ad0464d09760b91c.tar.bz2
Some imap fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp
index be825ef..ca1c7f1 100644
--- a/kmicromail/libmailwrapper/imapwrapper.cpp
+++ b/kmicromail/libmailwrapper/imapwrapper.cpp
@@ -398,24 +398,29 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
if (!m_att) {
return m;
}
m = new RecMail();
for (c = clist_begin(m_att->att_list); c!=NULL;c=clist_next(c) ) {
current = c;
size = 0;
item = (mailimap_msg_att_item*)current->data;
+ if ( !item )
+ continue;
if (item->att_type!=MAILIMAP_MSG_ATT_ITEM_STATIC) {
flist = (mailimap_msg_att_dynamic*)item->att_data.att_dyn;
- if (!flist->att_list) {
+ if (!flist || !flist->att_list) {
continue;
}
cf = flist->att_list->first;
+ if( ! cf )
for (cf = clist_begin(flist->att_list); cf!=NULL; cf = clist_next(cf)) {
cflag = (mailimap_flag_fetch*)cf->data;
+ if( ! cflag )
+ qDebug("imap:not cflag ");
if (cflag->fl_type==MAILIMAP_FLAG_FETCH_OTHER && cflag->fl_flag!=0) {
switch (cflag->fl_flag->fl_type) {
case MAILIMAP_FLAG_ANSWERED: /* \Answered flag */
mFlags.setBit(FLAG_ANSWERED);
break;
case MAILIMAP_FLAG_FLAGGED: /* \Flagged flag */
mFlags.setBit(FLAG_FLAGGED);
break;
@@ -436,20 +441,26 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
break;
}
} else if (cflag->fl_type==MAILIMAP_FLAG_FETCH_RECENT) {
mFlags.setBit(FLAG_RECENT);
}
}
continue;
}
+ if ( item->att_data.att_static == NULL )
+ continue;
if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_ENVELOPE) {
mailimap_envelope * head = item->att_data.att_static->att_data.att_env;
- m->setDate(head->env_date);
- m->setSubject(convert_String((const char*)head->env_subject));
+ if ( head == NULL )
+ continue;
+ if ( head->env_date != NULL )
+ m->setDate(head->env_date);
+ if ( head->env_subject != NULL )
+ m->setSubject(convert_String((const char*)head->env_subject));
//m->setSubject(head->env_subject);
if (head->env_from!=NULL) {
addresslist = address_list_to_stringlist(head->env_from->frm_list);
if (addresslist.count()) {
m->setFrom(addresslist.first());
}
}
if (head->env_to!=NULL) {
@@ -478,17 +489,17 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
}
while (h.length()>0 && h[h.length()-1]=='>') {
h.remove(h.length()-1,1);
}
if (h.length()>0) {
m->setInreply(QStringList(h));
}
}
- if (head->env_message_id) {
+ if (head->env_message_id != NULL) {
m->setMsgid(QString(head->env_message_id));
}
} else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_INTERNALDATE) {
#if 0
mailimap_date_time*d = item->att_data.att_static->att_data.att_internal_date;
QDateTime da(QDate(d->dt_year,d->dt_month,d->dt_day),QTime(d->dt_hour,d->dt_min,d->dt_sec));
qDebug("time %s ",da.toString().latin1() );
#endif