Save orphaned emails from client - missing on server

Hi,

I have a ton of emails on my personal laptop representing my email archive since 1994 that I’d really like to keep. I had been storing them on a private mail server in my home network (Ubuntu 22.04, Postfix, Dovecot) and had Evolution on an old laptop that had copies of all of the messages in its folder structure.

Well, sure enough catastrophic hardware failure of the email server and apparently my backups had not been working correctly so I literally have no backups of the data other than the complete messages downloaded in Evolution on this laptop (which I have now turned off networking on).

I rebuilt the server and have it ready to receive the data, I’m just at a complete loss as to how to get the data from the laptop to the server. On another laptop that had copies of the messages, when it connected to the new server build it wiped all of the messages from the local folder structure in Evolution (glad the old laptop had a recent sync and was powered down).

I tried copying the messages with Evolution offline from the source to a folder on another mail server but the client code seems to want to connect to the source mail server before it will copy the data and it just tries and tries and then times out, stopping the copy process before a single message can be copied over.

Can someone suggest a way for me to get the messages and their attachments (which definitely exist in the ~/.cache/evolution directory on the old laptop) back to the mail server?

I’m at a loss.

Thanks!

Hi,
I would try to do it in two steps, copy messages from the offline
account (you can run evolution also as: evolution --offline to not
have connection for all your mail accounts) to an On This Computer
folder and once done, copy the messages to the new server. Making a
copy of the ~/.cache/evolution/mail// is a good thing to
do, though I guess you did that already.

One problem can be that not all of the messages are stored locally. It
can happen, depending whether you had enabled synchronization for
offline use and for what time frame. Whether you can define a time
frame for the offline download depends on the evolution version you
have installed, but you forgot to mention it (it can be found in the
Help->About menu). I suppose it’s at least 3.44.x.

The messages in the ~/.cache/evolution/mail// are
organized in a similar structure to Maildir, only not precisely the
same. Luckily, they are complete messages, thus you can copy them under
~/.local/share/evolution/mail/local/… to have them accessible under
the On This Computer. The procedure is a manual work (some scripts or
programs could be created). Basically, the IMAP cache looks like this:

   ~/.cache/evolution/mail/<imap-account>/folders/
     INBOX
       cur            [messages in this folder]
       subfolders     [subfolders of the Inbox]
         folder1
           cur
         folder2
           cur
           subfolders
             ...
         ...
     folderN          [on the same level as the Inbox]
       cur
       subfolders

(I do not know whether the Discourse interface will preserve my
indentation…)

The cur directory contains two-letter directories, where the actual
messages are stored.

The Maildir format is similar, the one used in Evolution uses (leading)
dots to delimit folder names. I suggest you create a folder under On
This Computer, into which you’ll copy the folder structure from the
cache. Then create a new test folder under it and copy a message into
it in Evolution, then create a new folder under it and copy another
message under it. Then see what happened under
~/.local/share/evolution/mail/local/ directory.

Say you named the first folder backup and created it under Inbox, in
which case there will be ~/.local/share/evolution/mail/local/…backup
which contains cur, new and tmp directories. Say you’ll name the
second folder testfolder under the backup, in which case there will
be ~/.local/share/evolution/mail/local/…backup.testfolder/ directory,
with the same cur, new and tmp directory structure.

You can recreate the folder structure this way under the On This
Computer. Then you copy the message files (really files, not the two-
letter directories) from
~/.cache/evolution/mail//folders/INBOX/cur/
into
~/.local/share/evolution/mail/local/…backup.Inbox/new/
It’s not a typo, you’ll copy from cur to new, because it’s the
place where the Maildir expects the new messages to be stored, then
it’ll move them to the cur on its own, with other required
processing.

The process can seem complicated, but I think it’s not as that, once
you’ll get to the way it works (I’m not sure I managed to explain it in
an understandable way though). The bigger problem is the manual work,
if you’ve deep/wide folder structure.

Bye,
Milan

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.