Bug 237279 - Emails not saved in Folder view folders
Summary: Emails not saved in Folder view folders
Status: VERIFIED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: VHI normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords: akonadi-ports-regression
Depends on:
Blocks: 223438
  Show dependency treegraph
 
Reported: 2010-05-11 20:10 UTC by Sabine Faure
Modified: 2010-06-25 00:08 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
non deleted messages (93.23 KB, image/png)
2010-05-28 23:17 UTC, Casey Link
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sabine Faure 2010-05-11 20:10:46 UTC
Version:            (using Devel)
Compiler:          gcc 4.3.2 
OS:                Linux
Installed from:    Compiled sources

- Launch Kmail
- Click on 'New' button
- Enter a recipient email address, a subject and a few words in the text editor
- Click on 'Send' button
- Click on the 'sent-mail' folder in the Folder view to display its content

The email is not saved in the 'sent-mail' folder nor on any other folder atm whereas it should be.

The same thing happens when saving an email as draft it is not saved in the 'drafts' folder atm.

Trunk, Svn Rev 1125510

The same thing happens when saving an email as a template it is not saved in the 'templates' folder atm.
Comment 1 Sabine Faure 2010-05-11 20:14:12 UTC
I am setting this bug as HIGH priority since it prevents me to test the composer dialogue functionalities fully.

Trunk, Svn Rev 1125510
Comment 2 Laurent Montel 2010-05-12 12:09:02 UTC
Save in draft works fine here 
(but I have 4 local folder...)
Comment 3 Sergio Martins 2010-05-12 14:59:52 UTC
I can only reproduce the sent folder bug.

Templates and drafts are working fine (1125828)
Comment 4 Sergio Martins 2010-05-12 16:17:55 UTC
SVN commit 1125857 by smartins:

Only use the collection from the combo if the user selected one there.

Still missing: Use the right "sent folder" if the user selects a toplevel collection in the combo.

CCBUG: 237279




 M  +3 -0      kmcomposewin.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1125857
Comment 5 Leo Franchi 2010-05-12 16:40:06 UTC
Fixed in related commit 1125769.
Comment 6 Thomas McGuire 2010-05-12 16:47:11 UTC
(but I have 4 local folder...)

> See bug 236247 for that
Comment 7 Sabine Faure 2010-05-12 23:51:24 UTC
It is partially corrected now.

Emails saved as drafts are saved in the 'drafts' folder now.
Emails saved as templates are saved in the 'templates' folder now.

However, the Emails sent are not shown in the 'outbox' and then saved in the 'sent-mail' folder as they should be. I can not found the sent mail in any other folder either.

Trunk, Svn Rev 1125914
Comment 8 Sabine Faure 2010-05-13 00:19:48 UTC
Leo suggested that I used the 'Sent-Mail folder:' combo box to select in which folder the sent mail will be stored. Here are the steps to reproduce:
- Launch Kmail
- Click on 'New'
- Go to View menu/Sent-Mail Folder
- Select 'sent-mail' from the 'Sent-Mail folder:' combo box
- Enter a recipient email, a subject and a few words in the text editor
- Click on 'Send'

The email is correctly sent and stored in the sent-mail folder too as it should.

However if you do not set this option then the mail cannot be found in any folder.

Trunk, Svn Rev 1125914
Comment 9 Casey Link 2010-05-26 03:19:41 UTC
i performed the above steps.. and i can't reproduce this bug. Maybe because i chose the sent mail folder first, so all subsequent mails use that setting?
Comment 10 Sabine Faure 2010-05-28 03:28:10 UTC
Unfortunately this bug prevented me to test most of what I wanted to test today.

Even using the 'Sent-Mail folder:' combo box to select in which
folder the sent mail will be stored was not any use today. I could never find the emails I was sending (they were not stored in any folders) though I could see that they were properly received.

This bug is a real blocker for me.

Trunk, Svn Rev 1131264
Comment 11 Sergio Martins 2010-05-28 13:29:16 UTC
i also couldn't reproduce this.

What does:
grep -i fcc kmailrc

say?

Do you have the combo visible? Try hiding the 'Sent-Mail folder" combo.
Comment 12 David Faure 2010-05-28 22:13:43 UTC
-kailin- sabine 22:12 ~/.kde-trunk/share/config>grep -i fcc kmailrc
previous-fcc=1385
sticky-fcc=true
Comment 13 Sabine Faure 2010-05-28 23:11:34 UTC
David, Casey and I finally managed to find a way to reproduce this bug. Here are the steps:

- Delete your Local Folders from Configure Kmail - Accounts
- A new working one is automatically created ('Ready')
- Click on Identities icon and then on an identity
- Error messages appear: 'The custom sent-mail folder for identity ''NameOfTheIdentity' does not exist (anymore); therefore, the default sent-mail folder will be used.'
- Click on 'ok' each time you get one of those messages.
- Close the Configure dialogue
- Go to menu K/Configure Akonadi - second tab
- Stop akonadi server
- Click on 'start' to restart it
- Try sending an email
- The email is received but the sent-mail is not stored in any folder from the folders view
- Quit Kmail
- Relaunch Kmail
- Try sending an email

After a few seconds the email is stored in the sent-mail folder and properly received by the recipient.

Trunk, Svn Rev 1131669
Comment 14 Casey Link 2010-05-28 23:17:39 UTC
Created attachment 47438 [details]
non deleted messages

On a similar note, if you browse your Local folders AFTER removing the resource, you'll see the pre-existing messages are still there. Selecting them and clicking "Trash" results in the status bar saying "Messages moved to trash successfully", but the messages still exist in the view.

From debug: 

kmail(26552) KMMoveCommand::execute: AKONADI PORT: Disabled code in   virtual KMCommand::Result KMMoveCommand::execute()
kmail(26552) showJobError: There is no GUI delegate set for a kjob, and it failed with error: "Unknown error. (No collection found)"

See attached screenshot for visual explanation
Comment 15 Casey Link 2010-05-28 23:36:53 UTC
I'm convinced these are related.

KMail isn't properly cleaning up when the Local Folder resource is removed. I'm not sure what the correct behavior should be? I assume the Model should be cleared. Opinions?
Comment 16 Casey Link 2010-06-01 17:27:16 UTC
So, clicking the Remove Account button ends up sending a DBUS call to akonadi (kdepimlibs/akonadi/agentinterface.h, removeAgentInstance()), which removes the resource.

But then I'm not sure how KMail's folder/message model is supposed to be updated.
Comment 17 Casey Link 2010-06-01 17:40:59 UTC
Another effect of this bug, creating a new message and saving it as a draft freezes the message window.

Reproduce:
- Remove the local folder  resource
- Close config dialog
- Create new message
- Attempt to save as draft
- The new message win freezes with all fields disabled

You have to restart kmail to make it go away.

Debug:
kmail(18761) KMComposeWin::slotSendComposeResult: error 0 errorString ""
kmail(18761) KMComposeWin::slotSendComposeResult: NoError
kmail(18761) KMComposeWin::saveMessage: No default collection for 1
Comment 18 Thomas McGuire 2010-06-01 21:56:40 UTC
> Another effect of this bug, creating a new message and saving it as a draft
> freezes the message window.
>
> kmail(18761) KMComposeWin::saveMessage: No default collection for 1

Hmm right, it can't find the draft folder, and the error handling in the composer is broken.
Improved error handling somewhat in r1133476, although of course the real cause needs to be fixed.
Comment 19 Casey Link 2010-06-02 02:00:17 UTC
I wonder if this bug is in anyway related to the fact that the view/model are not real EntityTree::View/Models

see: https://bugs.kde.org/show_bug.cgi?id=223820#c1
Comment 20 Leo Franchi 2010-06-02 23:27:21 UTC
SVN commit 1133929 by lfranchi:

Make sure to reload the file before reading it, it's updated in the background by a SpecialMailCollectionsRequestJob
Fix signature of Q_PRIVATE_SLOT so slot is really called...

Saving as draft, sending, and other specialcollection-related things should now work after deleting an agent while kmail is running.
CCBUG: 237279


 M  +1 -0      specialcollections.cpp  
 M  +1 -1      specialcollections.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1133929
Comment 21 Leo Franchi 2010-06-03 00:01:10 UTC
Should be completed fixed with r1133936
Comment 22 Sabine Faure 2010-06-25 00:05:05 UTC
I am verifying this bug now eventhough if the user needs to delete 'local folders' this bug still happens.

However, theoritically the user should not need to delete any local folders and if it happens again to me I will recreate a new bug report that focuses only on that issue (since the fact that the emails sent are not saved in 'local folders' is a consequence not a cause).

Trunk, Svn Rev 1142388
Comment 23 Sabine Faure 2010-06-25 00:08:56 UTC
I meant : since the fact that the emails sent are not saved in 'sent-mail' is a consequence not a cause).