Bug 271231 - e-mails downloaded from POP3-servers by akonadi/kmail2 are stored twice locally
Summary: e-mails downloaded from POP3-servers by akonadi/kmail2 are stored twice locally
Status: RESOLVED NOT A BUG
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: POP3 Resource (show other bugs)
Version: 1.5.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Thomas McGuire
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-18 19:06 UTC by eric
Modified: 2011-11-29 19:42 UTC (History)
10 users (show)

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 eric 2011-04-18 19:06:42 UTC
Version:           1.5.2 (using KDE 4.6.2) 
OS:                Linux

All e-mails downloaded from POP3-servers are stored in 2 directories: '~/.local/share/akonadi/file_db_data' and '~/.local/share/.local-mail.directory/'

Reproducible: Always

Steps to Reproduce:
1) Setup Akonadi/Kmail2 to download from a POP3-account;
2) Download new e-mails from that account (make sure there are new e-mails);
3) Compare (with the command 'diff') the new files in the 2 directories I've mentioned (the filenames inside those directories are different).

Actual Results:  
Every downloaded e-mail is found in the 2 directories... the only difference is the filename, but the rest is equal.

Expected Results:  
Downloaded e-mails should be stored in just 1 local location to not waste diskspace.

I'm using Kontact/Kmail 4.6beta5, Akonadi 1.5.2 and MySQL 5.5.11.

Friends and family are sending me e-mails with photos and powerpoint presentations attached. That means I receive big e-mails and storing these e-mails locally in 2 different directories is a waste of diskspace.

I can ofcourse delete this '~/.local/share/akonadi/file_db_data' directory, because all the e-mails there are just duplicates... but when I do this Kmail does not show the e-mails anymore. Only the header is showed, the body of the e-mail is gone. The e-mail files found in '~/.local/share/.local-mail.directory/' are complete (you can read them with a text editor), but Kmail insists to retrieve the body of these e-mails from '~/.local/share/akonadi/file_db_data'.

To make the e-mails complete again, I can ofcourse rebuild the akonadi database. With a new database Kmail2 can show the complete e-mails again, but flags like (un)read/important and maybe also tags are reset.
Comment 1 eric 2011-07-04 01:25:04 UTC
I've just found out that not all e-mails are stored twice, small e-mails are not stored twice. The smallest e-mail that is stored twice here on my computer is 4101 bytes... I don't know where is the limit, maybe 4kb?

But still, the big multi-megabyte e-mails are stored twice!
Comment 2 eric 2011-07-04 01:26:40 UTC
I've just found out that small e-mails are not stored twice. The smallest e-mail that is stored twice here on my computer is 4101 bytes... I don't know where is the limit, maybe 4kb?
But still, the big multi-megabyte e-mails are stored twice!

This is with akonadi-1.5.3 and kmail/kontact-4.5.96 (4.6rc1).
Comment 3 Oldřich Jedlička 2011-07-13 05:49:22 UTC
I don't know if it is related, but I get a dialog to resolve duplicities sometimes during fetching new mails. One of the mail always has the X-Virus tag on the top of the mail header, while the other doesn't. I'm using latest RC - 4.7RC2 KDE/KMail2 (4.6.95), Akonadi 1.5.80.
Comment 4 Oldřich Jedlička 2011-07-13 20:28:48 UTC
Just a note - my problem happens with Akonadi 1.6.0 too.
Comment 5 Oldřich Jedlička 2011-07-28 13:39:43 UTC
I've updated KDE to 4.7 (still with Akonadi 1.6.0), fetched mails and I see no dialog to remove duplicates.
Comment 6 Ian Stanistreet 2011-07-31 04:07:18 UTC
It isn't just emails, akonadi notes are stored in both ~/.local/share/notes/ and ~/.local/share/akonadi/file_db_data/.  Some of them (large ones?) seem to only be read from file_db_data/ -- renaming the directory led to the content of most of my notes disappearing until I renamed it back.

My file_db_data/ is only ~100 MiB, but I noticed it contains emails that I deleted months ago, so it must get pretty big for people who get more emails than me!

KDE 4.7, Akonadi 1.6, Arch Linux.
Comment 7 Christian Fowelin 2011-08-07 16:55:15 UTC
*** This bug has been confirmed by popular vote. ***
Comment 8 Oldřich Jedlička 2011-08-08 20:17:59 UTC
(In reply to comment #5)
> I've updated KDE to 4.7 (still with Akonadi 1.6.0), fetched mails and I see no
> dialog to remove duplicates.

The dialog appears sometimes, but not as much as before.
Comment 9 Christian Trippe 2011-08-12 19:31:31 UTC
I have the same problem with akonadi and kmail2 from KDE 4.7.0.
For me there is an additional problem. Sometimes mails are shown twice in kmail. Then you can find really two entries in ~/.local/share/akonadi/file_db_databut only one in ~/.local/share/.local-mail.directory/

Now choosing remove duplicates often leads to result that all of these entries are deleted and the mail is lost!

Not sure if I should fill this as an additional bug?
Comment 10 Thomas McGuire 2011-09-15 21:13:48 UTC
~/.local/share/akonadi/file_db_data is only a temporary cache, the mails will be deleted from there after a short time. If that doesn't work for you, check the cache policy of the root local folder. In KMail, right-click on "Local Folders", click "Folder Properties", go to the "Retrieval" tab. There, the option "Retrieve message bodies on demand" should be checked, with the "keep message bodies locally for" time set to 1 minute.

If you are still seeing this behaviour, please file a bug against the maildir resource. POP3 handles the items over to Akonadi during a mail check, and is not involved in storing them.
Comment 11 Christian Trippe 2011-09-16 19:14:21 UTC
Yes the behaviour is still there, so I did as suggested an filled bug 282160.
Comment 12 Thomas McGuire 2011-09-16 20:18:15 UTC
Thanks, Christian.
Comment 13 Christian Trippe 2011-09-17 10:11:15 UTC
Hi Thomas,

can you give me a hint against which component I should fill the problem I described in comment 9, as this still happens. Is this more likely a problem of the pop3-resource or does this also belong to the maildir one, or even kmail?

Thanks in advance!
Christian
Comment 14 Thomas McGuire 2011-09-18 14:18:44 UTC
The bug from comment 9 (two entries in file_db_data, but only one entry in the maildir folder) is not a POP3 bug. I don't know where the bug is though, could be maildir or could be Akonadi itself.
Comment 15 Christian Trippe 2011-09-18 17:19:27 UTC
Thanks for you fast reply. And for reference for the problem from comment 9 I filled bug 282296.
Comment 16 mkay 2011-11-29 19:42:05 UTC
(In reply to comment #10)
> ~/.local/share/akonadi/file_db_data is only a temporary cache, the mails will
> be deleted from there after a short time. If that doesn't work for you, check
> the cache policy of the root local folder. In KMail, right-click on "Local
> Folders", click "Folder Properties", go to the "Retrieval" tab. There, the
> option "Retrieve message bodies on demand" should be checked, with the "keep
> message bodies locally for" time set to 1 minute.
> 
can you please describe what happens if i set it? i mean - does it have some disadvantages?