Complete.Org: Mailing Lists: Archives: offlineimap: March 2009:
Use offlineimap to merge different imap mailboxes to one?
Home

Use offlineimap to merge different imap mailboxes to one?

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: offlineimap@xxxxxxxxxxxx
Subject: Use offlineimap to merge different imap mailboxes to one?
From: Kent Boortz <Kent.Boortz@xxxxxxx>
Date: Mon, 09 Mar 2009 14:18:29 +0100

Hi,

Without going into how, I have managed to totally mess up my saved
emails when merging from one imap server to another. Some mails got
migrated over, others did not. And I even managed to create the
situation that some emails are on one imap server, some on the other,
and some on both.

So I want to fix this mess, and at the same time do some cleanup.
What I want to do (and tried but failed) is

  (1) Take down all mails from the two sites to my local computer,
      in MailDir format (or other format you suggest)

  (2) Run various find/grep/rm commands and perl snippets to remove
      some junk I don't want to keep (I'm a command line guy)

  (3) Run various find/grep/rm commands and perl snippets to put
      my mails into the folders I want them, a new merged structure.

  (4) Send this up to the single imap server I now use

My question, do you know a way to do what I want?

When I tried, all kind of weird things happened and I interrupted it.
I think it started deleting files in my MailDir structure instead of
sending up the new files I added.

Seems that the MailDir file naming has some semantic that offlineimap
use, and the files under "~/.offlineimap/" together with the current
state of the imap server I try send to doesn't allow for me to just
move files around in the MailDir folders.

It is ok with a solution where I have to change file names in MailDir
and/or edit files under "~/.offlineimap/", but then I need advice how
to change it and documentation for the offlineimap MailDir format and
format of files under "~/.offlineimap/".

Most cool had been if offlineimap itself had a "local command mode",
i.e. moving an email from one folder to another was

  % cd local_maildir_from_servers
  % offlineimap mv \
      
oldsrv/somebox/cur/1220977416_3.2860.air.local,U=9,FMD5=e3f728f2adf3364aa96b4368d77fa7eb:2,FS
 \
      newsrv/otherbox/
  % offlineimap mv \
      
newsrv/box1/cur/1221175681_0.4087.air.local,U=212,FMD5=52f8712ec6773add124cb9dda6264d36:2,S
 \
      newsrv/box2/new/

that handled renaming and update of "~/.offlineimap/". Or something ;-)

kent

-- 
Kent Boortz, Senior Production Engineer
Sun Microsystems Inc., the MySQL team
Office: +46 863 11 363
Mobile: +46 70 279 11 71



[Prev in Thread] Current Thread [Next in Thread]