{"id":77,"date":"2008-05-22T17:52:14","date_gmt":"2008-05-22T16:52:14","guid":{"rendered":"http:\/\/patrick-nagel.net\/blog\/?p=77"},"modified":"2008-05-23T06:21:53","modified_gmt":"2008-05-23T06:21:53","slug":"uploading-mail-to-an-imap-server-with-thunderbird-20014-sucks-perl-script-to-the-rescue","status":"publish","type":"post","link":"https:\/\/patrick-nagel.net\/blog\/archives\/77","title":{"rendered":"Uploading mail to an IMAP server with Thunderbird (2.0.0.14) sucks &#8211; perl script to the rescue"},"content":{"rendered":"<p>Today I was trying to upload a <strong>lot<\/strong> of mail (something like 160000 mails stored in a deeply nested folder structure of about 13000 folders) to an IMAP server. Those mails were converted from the Eudora mailbox format to a more sane Eudora mailbox format using <a href=\"http:\/\/qwerky.50webs.com\/eudorarescue\/\">&#8220;Eudora rescue&#8221;<\/a>, and then imported into Thunderbird&#8217;s &#8220;Local folders&#8221;. From there, so we thought, it would only be a matter of minutes to put those mails onto the newly setup dovecot IMAP server, with one drag-and-drop action.<\/p>\n<p><strong>But&#8230;<\/strong><\/p>\n<p>The upload horribly failed after the 3rd folder or so, with no error message whatsoever. No matter what I tried, it would just fail silently. The debug logging (see <a href=\"http:\/\/wiki.dovecot.org\/Debugging\/Thunderbird\">Debugging\/Thunderbird article in the Dovecot wiki<\/a>) didn&#8217;t help, and neither did dovecot&#8217;s log on the server. The problem seems to be connected with creating folders on the server somehow &#8211; because uploading a big amount (400 for a small test) mails within one folder wasn&#8217;t a problem. I couldn&#8217;t find out if Thunderbird or dovecot is to blame here&#8230;<\/p>\n<p>I eventually managed to get this big pile of mail to the server by using a perl script that I found on <a href=\"http:\/\/www.perlmonks.org\/?node_id=535127\">perlmonks.org<\/a>. Thanks to <a href=\"http:\/\/www.perlmonks.org\/?node_id=80839\">Davis<\/a> for providing this! I downloaded it, installed the Mail::MboxParser and Mail::IMAPClient dependencies (with two &#8216;cpan install &#8230;&#8217; calls), changed the configuration in the script to our site&#8217;s data and ran it. ~30 minutes later, the mails were on the server. Only thing that could have been better: All mails were &#8216;marked as unread&#8217; &#8211; but that&#8217;s easy to fix.<\/p>\n<p><strong>Update:<\/strong><br \/>\nAfter looking into the perl code, I found a way to &#8216;mark as read&#8217; during the transfer. I posted it under the <a href=\"http:\/\/www.perlmonks.org\/?node_id=535127\">original perlmonks.org script as a comment<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I was trying to upload a lot of mail (something like 160000 mails stored in a deeply nested folder structure of about 13000 folders) to an IMAP server. Those mails were converted from the Eudora mailbox format to a more sane Eudora mailbox format using &#8220;Eudora rescue&#8221;, and then imported into Thunderbird&#8217;s &#8220;Local folders&#8221;. &hellip; <a href=\"https:\/\/patrick-nagel.net\/blog\/archives\/77\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Uploading mail to an IMAP server with Thunderbird (2.0.0.14) sucks &#8211; perl script to the rescue&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-77","post","type-post","status-publish","format-standard","hentry","category-linux-general"],"_links":{"self":[{"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/posts\/77","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/comments?post=77"}],"version-history":[{"count":0,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/posts\/77\/revisions"}],"wp:attachment":[{"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/media?parent=77"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/categories?post=77"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/tags?post=77"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}