Howto recover mail from k9mail cache

Hi,

My hosting company dropped my email mailbox without warning and I am trying to recover what I still can.

I have a Samsung Galaxy A6 2016 (rooted) with k9mail and the account setup on it.

It still has in cache the last 250 mails in various directories which may save me partialy the day.

The mails are not complete, picture as attachment are not present for example.

K9mail don’t support to copy or move the mails from one account to an other sadly.

I only see one way to recover my mails by transfering as attachment the mails, but it may trash the content from the sent directory.

I looked in Android directory for k9mail data but it’s empty either in the device storge and in the sd card.

I tried the backup procedure from Locate Mails of k9-mail - Android Enthusiasts Stack Exchange, but archive is empty (41 bytes) :cry:

Where are stored the data in cache of k9mail ??? I would like to backup everything first and then try the best option to recover the content.
(it is unlikely it’s stored in the application memory on my device)

I am on a rooted device, I would like to backup the database it store it’s data in before trying any procedure that may be destructive…

Thanks in avance.

Model: SM-G955U
Android: 7.0
K9mail: 5.806

I have found some data in /data/data/com.fsck.k9

Is there a documentation somewhere appart of the source code how to reconstruct the mails from theses sqlite databases ?
(header + body + ???)

Before you try anything:

  • Disable sync for the dysfunctional account
  • Create a full adb backup of K-9 (including app data)

Anything you try from there on, do it in virtual device in Android Studio. This should prevent you from accidentally damaging or deleting mails from the database on your phone.

There are plenty of SQLite apps on Playstore and F-Droid. The challenge will be to make them access K-9’s data (or to be more precise: the copy thereof).

You might be more successful not going the AVD route at all, but rather use the SQLite stack in a Linux environment.

Good luck!