Bug 50841 - data loss setting mail receiving location and destination to same maildir
Summary: data loss setting mail receiving location and destination to same maildir
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: unspecified
Platform: openSUSE Linux
: NOR major
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-17 04:15 UTC by Leo Davis
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leo Davis 2002-11-17 04:15:04 UTC
Version:            (using KDE KDE 3.0.4)
Installed from:    SuSE RPMs
Compiler:          gcc (GCC) 3.2 
OS:          Linux

1.  Create a data-loss maildir folder at the toplevel of Mail
2.  Copy some email into the data-loss folder.  Observe that files are
in the ~/Mail/data-loss/cur directory.
3.  Settings->Configure Kmail->Network->Receiving
4.  Add a maildir mailbox
5.  Set Location to ~/Mail/data-loss and Destination folder to
data-loss, and ok it.
6.  apply and ok the configuration
7.  File->Check Mail->Unnamed
8.  Observe that ~/Mail/data-loss/cur is empty.  Also observe that
clicking on "new" message entries in data-loss causes them to be invalid.

Using KMail 1.4.3 (using KDE 3.0.5)

I guess I was just expecting kmail to not empty/modify the Location's cur directory.
Comment 1 Ingo Klöcker 2002-11-17 20:24:36 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.

Comment 2 Leo Davis 2003-09-25 06:20:59 UTC
Was able to reproduce this in kmail 1.5.3 also.
Comment 3 noster 2003-11-05 21:36:40 UTC
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).
Comment 4 Till Adam 2003-11-29 21:10:24 UTC
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()) );
-
   }