Summary: | data loss setting mail receiving location and destination to same maildir | ||
---|---|---|---|
Product: | [Unmaintained] kmail | Reporter: | Leo Davis <ldav1s> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Leo Davis
2002-11-17 04:15:04 UTC
Subject: Re: New: data loss setting mail receiving location and destination to same maildir
On Sunday 17 November 2002 04:15, Leo Davis wrote:
> I guess I was just expecting kmail to not empty/modify the Location's
> cur directory.
Exactly. Obviously this assumption was wrong. We will disallow setting
the location of a maildir account to a folder in ~/Mail to prevent
others from making the same mistake.
Was able to reproduce this in kmail 1.5.3 also. It is still reproducible in 1.5.93 [KDE 3.1.93 (CVS>=20031028)]. I may only add that after checking mail in that mailbox amount of messages doubles but they are all corrupted (folder is in fact empty). Subject: kdepim/kmail CVS commit by tilladam: Don't allow users to specify the folder itself as the target folder of a maildir acccount. Since we are in string freeze this simply sets the target folder to the main inbox. After 3.2 we should pop up a dialog asking the user to select a different one. CCMAIL: 50841-done@bugs.kde.org M +13 -5 accountdialog.cpp 1.134 --- kdepim/kmail/accountdialog.cpp #1.133:1.134 @@ -1496,4 +1496,15 @@ void AccountDialog::saveSettings() mAccount->setName( mMaildir.nameEdit->text() ); acctMaildir->setLocation( mMaildir.locationEdit->currentText() ); + + KMFolder *targetFolder = *mFolderList.at(mMaildir.folderCombo->currentItem()); + if ( targetFolder->location() == acctMaildir->location() ) { + /* + Prevent data loss if the user sets the destination folder to be the same as the + source account maildir folder by setting the target folder to the inbox. + ### FIXME post 3.2: show dialog and let the user chose another target folder + */ + targetFolder = kmkernel->inboxFolder(); + } + mAccount->setFolder( targetFolder ); } mAccount->setCheckInterval( mMaildir.intervalCheck->isChecked() ? @@ -1505,7 +1516,4 @@ void AccountDialog::saveSettings() mAccount->setPrecommand( mMaildir.precommand->text() ); - - mAccount->setFolder( *mFolderList.at(mMaildir.folderCombo->currentItem()) ); - } |