{"id":51,"date":"2011-04-28T00:51:55","date_gmt":"2011-04-27T23:51:55","guid":{"rendered":"http:\/\/blog.powered-up-games.com\/wordpress\/?p=51"},"modified":"2011-04-28T00:54:12","modified_gmt":"2011-04-27T23:54:12","slug":"importing-eml-email-to-maildir","status":"publish","type":"post","link":"https:\/\/powered-up-games.com\/blog\/wordpress\/archives\/51","title":{"rendered":"Importing .eml email to Maildir"},"content":{"rendered":"<p>Recently, while reconciling my company accounts, I found I was missing an email receipt. I was able to retrieve a copy of the email as a .eml file, but to store it with my other emails I needed some way to import it into my email system.<\/p>\n<p><!--more--><\/p>\n<p>I currently store my emails on a server running <a href=\"http:\/\/www.ubuntu.com\/\">Ubuntu<\/a>. Locally I use a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Maildir\">Maildir<\/a> format folder and serve it to my other client machines using <a href=\"http:\/\/en.wikipedia.org\/wiki\/Internet_Message_Access_Protocol\">IMAP<\/a> with the <a href=\"http:\/\/www.dovecot.org\/\">Dovecot<\/a> program. On the server I use the <a href=\"http:\/\/pyropus.ca\/software\/getmail\/\">getmail<\/a> program to collect my email from several different Internet mail servers and send them to my Maildir folder. The server does this automatically for me at regular intervals as I set them up as <a href=\"http:\/\/en.wikipedia.org\/wiki\/Cron\">cron<\/a> tasks.<\/p>\n<h3>How can I get a .eml file into my system?<\/h3>\n<p>One approach uses the <a href=\"http:\/\/www.mozillamessaging.com\/en-GB\/thunderbird\/\">Thunderbird<\/a> email client program. This program recognises the .eml file so, to import it to any email folder, you can just drag and drop the file. Since I use Thunderbird on my Windows machine as a client to my IMAP folders this allows me to store the email on my server too.<\/p>\n<p>But, on my Ubuntu machines, I tend to use the <a href=\"http:\/\/projects.gnome.org\/evolution\/\">Evolution<\/a> email client, as that&#8217;s currently the default program for email. Unfortunately, Evolution doesn&#8217;t understand the .eml file format in the way that Thunderbird does. However, the getmail package also comes with the program <a href=\"http:\/\/pyropus.ca\/software\/getmail\/configuration.html#running-mda-maildir-example\">getmail_maildir<\/a>. Here&#8217;s how to use it to import an email into a local Maildir format folder from a terminal or shell:<\/p>\n<p><code>getmail_maildir ~\/Maildir\/ &lt; email_file.eml<\/code><\/p>\n<ul>\n<li>getmail_maildir is the name of the program.<\/li>\n<li>~\/Maildir\/ is the location of the Maildir format folders:\n<ul>\n<li>the ~ is a shortcut that means the current user&#8217;s home directory.<\/li>\n<li>the trailing \/ is required.<\/li>\n<\/ul>\n<\/li>\n<li>The &lt; tells it to pipe the contents of the following file into the program.<\/li>\n<li>email_file.eml is the file you want to import<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Recently, while reconciling my company accounts, I found I was missing an email receipt. I was able to retrieve a copy of the email as a .eml file, but to store it with my other emails I needed some way to import it into my email system.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-51","post","type-post","status-publish","format-standard","hentry","category-internet"],"_links":{"self":[{"href":"https:\/\/powered-up-games.com\/blog\/wordpress\/wp-json\/wp\/v2\/posts\/51","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/powered-up-games.com\/blog\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/powered-up-games.com\/blog\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/powered-up-games.com\/blog\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/powered-up-games.com\/blog\/wordpress\/wp-json\/wp\/v2\/comments?post=51"}],"version-history":[{"count":11,"href":"https:\/\/powered-up-games.com\/blog\/wordpress\/wp-json\/wp\/v2\/posts\/51\/revisions"}],"predecessor-version":[{"id":62,"href":"https:\/\/powered-up-games.com\/blog\/wordpress\/wp-json\/wp\/v2\/posts\/51\/revisions\/62"}],"wp:attachment":[{"href":"https:\/\/powered-up-games.com\/blog\/wordpress\/wp-json\/wp\/v2\/media?parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/powered-up-games.com\/blog\/wordpress\/wp-json\/wp\/v2\/categories?post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/powered-up-games.com\/blog\/wordpress\/wp-json\/wp\/v2\/tags?post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}