missing mails in maildir

Jos van den Oever jos at vandenoever.info
Mon Feb 11 23:03:38 GMT 2019


On Monday, February 11, 2019 11:04:08 PM CET Ingo Klöcker wrote:
> You didn't say which versions of KMail and Akonadi you are using.
KMail 5.9.0
Akonadi 18.08.0
KDE Frameworks 5.49.0
Qt 5.11.1

So granted: not super fresh.

> On Montag, 11. Februar 2019 00:15:16 CET Jos van den Oever wrote:
> > In my akonadi/kmail setup with maildir, I'm seeing that mails that are in
> > the database are not all as mail files on the filesystem. Since akonadi is
> > the cache for the filesystem, I wonder how this discrepancy has come to
> > be.
> 
> Does this happen for new mails? Or only for old mails?

Also for old mails.
I've found where the mails are hiding. They are in
  $HOME/.local/share/akonadi/file_db_data
There are 1236 files there of which 1183 are mails (they match ^From: and 
^Date:).
17 mails are from 2016.

I did some shell scripting to figure out how many mails in file_db_data/ are 
not in mail/

```
find ~/mail -type f -exec sha256sum {} + > mail.txt
grep ^Date: /home/oever/.local/share/akonadi/file_db_data/ -rl | xargs 
sha256sum > file_db_data.txt
for f in $(cut -f 1 -d ' ' file_db_data.txt); do
   grep $f mail.txt
done > found.txt
wc -l found.txt
```
333 mails are present in both file_db_data/ and mail/, so 850 mails are 
missing from mail/.

I could move these mails to a folder in ~/mail and hope for the best, but it 
feels strange.

> 
> How did the mails end up in the folder? Were they moved? Copied? Filtered?

I couldn't say. Moving the mail in the KMail user interface does not get it 
back into the maildir.

> There was a bug where when one moved several mails at once to a maildir
> folder only the first one was actually written to the maildir folder. This
> bug has been fixed in the meantime.
> 
> > This is the first time I've seen this and it's worrying me. I'd like to
> > find out how many files might be missing and get them back in the
> > maildir.
> For me, copying (!; not moving) mails (individually or several at once) to
> another maildir folder made the mails appear in the filesystem (after some
> time, i.e. a few minutes).

I've now tried copying in the KMail interface and this indeed works. There are 
so many mails, that I'd prefer to do it with a script.

> > Very concretely, I'm looking for a mail I sent, that shows up in the inbox
> > in kmail and akonadi_console, but is not in the maildir. I've connected to
> > MariaDB with `mysql -D akonadi` --socket=...
> > However, I do not see where (what table column) the mail body is. The
> > largest table is parttable, but I do not find any mails in there. The
> > largest blob in that table is 4096.
> 
> I think you are looking at the right table.

Does that table have a relation to file_db_data?

Cheers,
Jos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20190212/bb100235/attachment.sig>


More information about the kde-pim mailing list