diff options
author | Michael Nottebrock <lofi@FreeBSD.org> | 2004-02-05 14:31:35 +0000 |
---|---|---|
committer | Michael Nottebrock <lofi@FreeBSD.org> | 2004-02-05 14:31:35 +0000 |
commit | 6804c88072e15d106d44f29b086a281138ff2372 (patch) | |
tree | 152a1611ce85e6a5a4cfb44f1f56b88671cd40e1 /deskutils/kdepim3/files/patch-kmail-kmfolderimap.cpp | |
parent | CONFLICTS with kdesdk-3.2+ (diff) |
Fix a rather nasty bug in kmail's IMAP
implementation. Bump PORTREVISION.
More info: http://lists.kde.org/?l=kde-cvs&m=107588505207720&w=2
Notes
Notes:
svn path=/head/; revision=100058
Diffstat (limited to 'deskutils/kdepim3/files/patch-kmail-kmfolderimap.cpp')
-rw-r--r-- | deskutils/kdepim3/files/patch-kmail-kmfolderimap.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/deskutils/kdepim3/files/patch-kmail-kmfolderimap.cpp b/deskutils/kdepim3/files/patch-kmail-kmfolderimap.cpp new file mode 100644 index 000000000000..c27ffe4117aa --- /dev/null +++ b/deskutils/kdepim3/files/patch-kmail-kmfolderimap.cpp @@ -0,0 +1,33 @@ +--- kmail/kmfolderimap.cpp.orig Sat Jan 17 13:55:08 2004 ++++ kmail/kmfolderimap.cpp Thu Feb 5 13:33:38 2004 +@@ -1207,7 +1207,16 @@ + { + KURL url = mAccount->getUrl(); + KMFolderImap *msg_parent = static_cast<KMFolderImap*>(msg->parent()); +- url.setPath(msg_parent->imapPath() + ";UID=" + msg->headerField("X-UID")); ++ QString uid = msg->headerField("X-UID"); ++ /* If the uid is empty the delete job below will nuke all mail in the ++ folder, so we better safeguard against that. See ::expungeFolder, as ++ to why. :( */ ++ if ( uid.isEmpty() ) { ++ kdDebug( 5006 ) << "KMFolderImap::deleteMessage: Attempt to delete " ++ "an empty UID. Aborting." << endl; ++ return; ++ } ++ url.setPath(msg_parent->imapPath() + ";UID=" + uid ); + if ( mAccount->makeConnection() != ImapAccountBase::Connected ) + return; + KIO::SimpleJob *job = KIO::file_delete(url, FALSE); +@@ -1228,7 +1237,11 @@ + KMFolderImap *msg_parent = static_cast<KMFolderImap*>(msgList.first()->parent()); + for ( QStringList::Iterator it = sets.begin(); it != sets.end(); ++it ) + { +- url.setPath(msg_parent->imapPath() + ";UID=" + *it); ++ QString uid = *it; ++ // Don't delete with no uid, that nukes the folder. Should not happen, but ++ // better safe than sorry. ++ if ( uid.isEmpty() ) continue; ++ url.setPath(msg_parent->imapPath() + ";UID=" + uid); + if ( mAccount->makeConnection() != ImapAccountBase::Connected ) + return; + KIO::SimpleJob *job = KIO::file_delete(url, FALSE); |