How to push IMAP messages from Android to a server or to backup location?

0

Background: My Linux-Apache server ran an IMAP email server to which I had connected my Android phone and PC. Since it's IMAP, things were automatically kept in sync. The Apache server was recently hacked and the server admins had to wipe & rebuild it on short notice. As a result, I lost all the emails that were on the server.

My problem: Without thinking, I then reconnected the PC to the email server and the changes from the server (an empty email account) cascaded to the PC, so I lost all the emails on the PC. The Android phone has not been reconnected to the server, so all the messages are still on the phone, just waiting to be deleted as soon as I reconnect.

Ideal Objective: Ideally, I'd like a way to repopulate the server from the messages on my Android 4.4 device so that ultimately all three locations (along with the PC) would have the old emails. One additional wrinkle is that there have been new emails since the server has come back online. The server and the PC have those emails, but the phone doesn't (it hasn't been reconnected since the server was wiped). I don't want to lose those messages.

Alternate Objective: If the objective above is not doable, I would at least like to backup the messages from the phone so I can access them and search through them on the PC. That way when I reconnect the phone and it gets sync'ed to the server, I won't lose those messages forever.

The folder structure of the mail directory on the server is as follows:

  • /.Draft
  • /.Junk
  • /.Sent
  • /.Trash
  • /cur
  • /new
  • /tmp
  • dofecot-acl-list
  • dovecot-uidlist
  • dovecot--uidvalidity
  • dovecot-uidvalidity.55ee8fcd
  • dovecot.index.cache
  • dovecot.index.log
  • dovecot.mailbox.log
  • maildirsize
  • subscriptions

Each of the dot-folders (.Drafts, .Junk...) has contents similar to the following:

  • /cur
  • /new
  • /tmp
  • dovecot-uidlist
  • dovecot.index.cache
  • dovecot.index.log
  • maildirfolder

The /new and /tmp folders are currently empty, but the /cur folders have a list of files with names similar to 1441697998.M590997P21245.host,S=2655,W=2734:2,S. On the Android phone which contains the old messages, I use the default messaging app. On the PC, I use Microsoft Outlook 2013

How can I meet either of my objectives? Ideas are welcome!

BeetleJuice

Posted 2015-09-23T07:12:37.860

Reputation: 677

Answers

0

The safest way to do this would be to create an account somewhere else, like gmail (assuming gmail doesn't do anything weird to emails), and add it to your email client on Android. Copy all the email folders from the deleted account to Gmail.

Then on your desktop, create a new account pointing to Gmail, and copy all the emails to your proper account.

The first part requires an android imap client than can copy emails between accounts (perhaps k9?)

The second part can be achieved by most imap clients I imagine. Probably outlook, but definitely thunderbird.

Paul

Posted 2015-09-23T07:12:37.860

Reputation: 52 173

Paul if I install a new Android IMAP client with the ability to copy messages to Gmail IMAP, how would I get the messages I am trying to save from the standard email App to this new client? Connecting the new client to the server would not give it access to the old messages. – BeetleJuice – 2015-09-23T09:15:29.620

You may have misunderstood my last post. You recommendation is that I copy folders from k9 to Gmail on the phone, then from Gmail to the initial account on the desktop right?. Notice this assumes that k9 has the old emails to begin with. But how do I get them in k9? They are currently in the default email client. – BeetleJuice – 2015-09-23T09:22:49.107

@Patrick Yes, good point! Does the default android client have the ability to copy emails within itself? Ie, can you create a new folder, and copy emails into it (while not connected)? – Paul – 2015-09-23T09:24:04.247

No I don't think so. I can't figure out a way to create a folder or even move mail from one folder to another in the default Android client. – BeetleJuice – 2015-09-23T11:05:22.580

Do you have root and a way to backup data? The situation is precarious so Titanium is a good option right now. I'd start researching what format the android emails are stored in. It seems likely that even if you change the settings on your android account to point to a different server, it will find the emails aren't there and sync them into oblivion. – Paul – 2015-09-23T13:55:19.980

I don't have root on this device. This is all so silly. Just thought of one thing. I could forward every one of these old emails to myself. They get saved in the Outbox for later delivery. When I reconnect to the server, the inbox will be emptied by the sync'ed process but perhaps all the letters in the outbox will be delivered...back to the same account's inbox? Thing is, I know only how to forward 1 email at a time and the account has hundreds of emails to preserve. Also, I have only 1 shot at success. Once I reconnect to the server, it will be too late to change course. Thoughts? – BeetleJuice – 2015-09-23T14:10:45.530