Bug 74380 - Change of the account symbolic name caused loss of the sent and drafts folders
Summary: Change of the account symbolic name caused loss of the sent and drafts folders
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Carsten Burghardt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-06 18:00 UTC by Marcin Kasperski
Modified: 2004-02-09 18:52 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 Marcin Kasperski 2004-02-06 18:00:59 UTC
Version:            (using KDE KDE 3.2.0)
OS:          Linux

Using IMAP account I prefer to keep my sent items and drafts within specific folders under this account instead of my personal computer. So I configured kmail this way and it worked.

Later on I decided to rename my account (change the symbolic name used by kmail). Day later I noticed that my sent mails are placed within my local folder instead of imap folder (no notification, no warning, nothing). I entered kmail configuration, entered 'Identification', clicked Change and then ... got warning that Sent and Drafts folders do not exist so defaults will be used.

There are two problems:

1) Changing the account symbolic name should not cause loss of the sent/drafts folders setting. One can expect that this is only - just - some label. Special folders setting should be bound to the 'item' not to the name.

2) The warning about loosing Sent/Drafts setting should be presented immediately after performing the operation which invalidates this setting (leaving the problem above also when someone deletes the whole  account or changes its characteristics so it is no longer IMAP). Even better, the warning should be presented before the operation is peformed ('Performing this operation will invalidate your Drafts and Sent folders setting, are you sure....').

3) At worst, if 2) is not possible or hard, I should be given a warning while trying to send the very first mail after the Sent folder was invalidated ('Your Sent folder is no longer valid, click Proceed to use default one instead or Cancel to go back to your mail and reconfigure kmail...').
Comment 1 Marcin Kasperski 2004-02-06 18:10:23 UTC
I will also add quick test scenario

1) Configure kmail to use some IMAP account
2) Create within this account folders Sent and Drafts 
3) Within Identification window set sent and drafts folders to the folders above
4) ...send some mail and check that everything is ok...
5) Enter Config/Network and change the name of the incoming mail account
6) ... send some mail ...

Best if after 6) the second mail is within IMAP Sent folder.
Good if during 5) the user is warned that the operation will invalidate (or worse just invalidated) sent and drafts folders.
Acceptable if during 6), before the mail is sent or just after it happened, user is warned about sent folder problem.
Bad if user is not warned but mail lands in wrong place.

Other variants:

At step 5) we keep the name but change the account from IMAP to POP3 or
change both the name and characteristics or remove the account and create another one
  (here keeping the folder settings is impossible but warnings should be given 
   at some stage)

At step 5) we just remove the Sent folder from IMAP server (both using kmail and using some other tool)
   (in case of deleting with kmail user should be given a warning, in case 
    of other tool user should be given a warning while sending first mail after
    the folder is removed)
Comment 2 Carsten Burghardt 2004-02-06 18:40:43 UTC
Subject: Re:  New: Change of the account symbolic name caused loss of the sent and drafts folders

On Friday 06 February 2004 18:01, Marcin Kasperski wrote:
> There are two problems:

I count 3 :-)

> 1) Changing the account symbolic name should not cause loss of the
> sent/drafts folders setting. One can expect that this is only - just - some
> label. Special folders setting should be bound to the 'item' not to the
> name.

This is a duplicate.

> 2) The warning about loosing Sent/Drafts setting should be presented
> immediately after performing the operation which invalidates this setting
> (leaving the problem above also when someone deletes the whole  account or
> changes its characteristics so it is no longer IMAP). Even better, the
> warning should be presented before the operation is peformed ('Performing
> this operation will invalidate your Drafts and Sent folders setting, are
> you sure....').

As this behaviour should only be temporary (see 1) I don't think this is an 
option. Especially because we can't introduce new strings.

> 3) At worst, if 2) is not possible or hard, I should be given a warning
> while trying to send the very first mail after the Sent folder was
> invalidated ('Your Sent folder is no longer valid, click Proceed to use
> default one instead or Cancel to go back to your mail and reconfigure
> kmail...')

Good point, I think this is an option.

Comment 3 Marcin Kasperski 2004-02-06 18:52:51 UTC
Problem 2) is not temporary. Even after 1) is corrected, we still have the problem when someone changes IMAP to POP, removes IMAP account as a whole etc. Of course if 1) and 3) are done, 2) is of less importantance
Comment 4 Carsten Burghardt 2004-02-09 18:40:24 UTC
CVS commit by burghard: 

Display warning when the user tries to send a mail or save a draft and the folder
of the identity is not found
CCMAIL: 74380-done@bugs.kde.org


  M +10 -0     kmcomposewin.cpp   1.770.2.3
  M +11 -1     kmsender.cpp   1.197.2.1


--- kdepim/kmail/kmsender.cpp  #1.197:1.197.2.1
@@ -267,4 +267,5 @@ kdDebug(5006) << "KMSender::doSendMsg() 
     const KMIdentity & id = kmkernel->identityManager()
       ->identityForUoidOrDefault( mCurrentMsg->headerField( "X-KMail-Identity" ).stripWhiteSpace().toUInt() );
+    bool folderGone = false;
     if ( !mCurrentMsg->fcc().isEmpty() )
     {
@@ -277,4 +278,6 @@ kdDebug(5006) << "KMSender::doSendMsg() 
         imapSentFolder =
           kmkernel->imapFolderMgr()->findIdString( mCurrentMsg->fcc() );
+      if ( !sentFolder && !imapSentFolder )
+        folderGone = true;
     }
     else if ( !id.fcc().isEmpty() )
@@ -286,6 +289,13 @@ kdDebug(5006) << "KMSender::doSendMsg() 
       if ( sentFolder == 0 )
         imapSentFolder = kmkernel->imapFolderMgr()->findIdString( id.fcc() );
+      if ( !sentFolder && !imapSentFolder )
+        folderGone = true;
     }
     if (imapSentFolder && imapSentFolder->noContent()) imapSentFolder = 0;
+    if (folderGone)
+      KMessageBox::information(0, i18n("The custom sent-mail folder for identity "
+            "\"%1\" doesn't exist (anymore). "
+            "Therefore the default sent-mail folder "
+            "will be used.").arg( id.identityName() ) );
 
     if ( sentFolder == 0 )

--- kdepim/kmail/kmcomposewin.cpp  #1.770.2.2:1.770.2.3
@@ -4930,4 +4930,14 @@ bool KMComposeWin::doSend(int aSendNow, 
       if ( draftsFolder == 0 )
         imapDraftsFolder = kmkernel->imapFolderMgr()->findIdString( mMsg->drafts() );
+      if ( !draftsFolder && !imapDraftsFolder )
+      {
+        const KMIdentity & id = kmkernel->identityManager()
+          ->identityForUoidOrDefault( mMsg->headerField( "X-KMail-Identity" ).stripWhiteSpace().toUInt() );
+        KMessageBox::information(0, i18n("The custom drafts folder for identity "
+              "\"%1\" doesn't exist (anymore). "
+              "Therefore the default drafts folder "
+              "will be used.")
+            .arg( id.identityName() ) );
+      }
     }
     if (imapDraftsFolder && imapDraftsFolder->noContent())


Comment 5 Marcin Kasperski 2004-02-09 18:52:42 UTC
If I were writing it, I would add the name of the poblematic folder to the error text. This way the person getting the problem could get some idea of what could happen (for instance seeing message 'the folder MyImap/Sent does not exist' I would guess that the change of the name MyImap can have sth...)
Comment 6 Carsten Burghardt 2004-02-09 19:02:59 UTC
On Monday 09 February 2004 18:52, Marcin Kasperski wrote:
> ------- Additional Comments From Marcin.Kasperski@softax.com.pl  2004-02-09
> 18:52 ------- If I were writing it, I would add the name of the poblematic
> folder to the error text. This way the person getting the problem could get
> some idea of what could happen (for instance seeing message 'the folder
> MyImap/Sent does not exist' I would guess that the change of the name
> MyImap can have sth...)

As we're in string freeze I can't do that, I have to take the already existing 
message.