How do I copy a large number of emails to an IMAP folder in Thunderbird?

25
2014-03
  • iagdotme

    I am migrating all my email to a new server. I have about 10 accounts in 10 different folders in Mozilla Thunderbird. I have been using pop3 in the past, but on the new server I want to use imap.

    I have created all the imap accounts on the new server and I want to copy over all the emails on their folders on Thunderbird to their corresponding imap account folders on the new server.

    When searching for an answer for this, most people suggest just copying all the emails in their folder to the imap account inbox. Some people say that you should only copy around 500 emails at a time. The problem is I have around 20,000 emails per account (going back to the year 2002!) and Thunderbird just gives up on me. I have managed to get it working occassionally by copying 500 emails at a time but this is going to take forever!

    Thunderbird shows that it is copying the emails with a message in the status bar, but after a short while the status message goes blank.

    My question is, is there a way of moving a large number of emails from a local folder on Thunderbird to an imap account that works and is quick?

  • Answers
  • Kirk

    I have used Thunderbird to move large quantities of messages from Local to imap. You'll need to ensure that your local folders are indexed properly, and then start with smallish chunks and keep adding more until you get to a comfortable number. The last time I did this I started with about 1000, then 2500, then 5000, and pretty soon I was done. It could take some time, but be patient and try to leave thunderbird alone to do it's work while moving.


  • Related Question

    Thunderbird: moving email from local Junk folder to IMAP folder yields "Message contains invalid header"
  • Peltier

    Whenever I try to move an email from a local Junk folder to an IMAP folder in Thunderbird, I get the following error message:

    The current command did not succeed. The mail server responded: Message contains invalid header

    If Thunderbird's Junk folder is an IMAP folder on the server, then after Thunderbird has moved messages to that folder, I can successfully move messages from Junk back into to some other IMAP folder. However, if the Junk folder is not on the server, then moving a message from the local Junk folder to an IMAP folder yields the aforementioned error.

    The only interesting thing I've found about this error is "Message contains invalid header" from the MozillaZine Knowledge Base. That article officially is about importing folders from another email client, and does not mention the Junk filter as another possible cause. However the proposed solution is not very helpful since it requires manual editing of the message box files.

    Any better ideas?

    EDIT: make sure you read the comments before answering the question.


  • Related Answers
  • harrymc

    Found this article : "Fix invalid mail headers when moving from Thunderbird to IMAP", where a Python script is proposed that fixes all mailbox files in a given directory.

    Even if you don't use Python, it should be quite easy to do the same in another language or a text-editor or sed. Apparently, this fixed the problem for the author of the article.

  • Synetech

    Actually, I found another thing that causes this error. I converted my Outlook mail to Thunderbird via a program called MailStore Home and in some of the results mbox files there were extraneous lines with the following

    Microsoft Mail Internet Headers Version 2.0

    Once I removed those lines, messages that hadn't been able to move to an IMAP folder were able to be moved.