{"id":37,"date":"2008-04-20T17:48:16","date_gmt":"2008-04-20T16:48:16","guid":{"rendered":"http:\/\/paul.sinnett.name\/archives\/37"},"modified":"2008-04-20T17:48:16","modified_gmt":"2008-04-20T16:48:16","slug":"e-mail-collection","status":"publish","type":"post","link":"https:\/\/powered-up-games.com\/blog\/wordpress\/archives\/37","title":{"rendered":"E-mail collection"},"content":{"rendered":"<p>For a long time I&#8217;ve wanted a better home office e-mail system and I finally had some free time to set it up. It took a while. The information and tools are all freely available. But they are distributed in many different places and it&#8217;s difficult to find stuff when you don&#8217;t know what to look for. So I&#8217;m documenting my set-up here for future reference.<\/p>\n<p><!--more--><\/p>\n<p>The first feature I wanted was to collect mail from multiple service provider accounts. My main account is on <a href=\"http:\/\/mail.google.com\/mail\/help\/intl\/en-GB\/about.html\" title=\"about Google Mail\">Google Mail<\/a> but I&#8217;ve had others over the years and I also maintain a separate account for <a href=\"http:\/\/gamecontractor.org\">gamecontractor.org<\/a>. I was tempted to forward all my mail to Google Mail and manage everything through a web browser. But I wanted a little more control over my data. In particular, I wanted more control over spam, archiving, and searching.<\/p>\n<p>To collect my mail I found 2 programs that did what I wanted: <a href=\"http:\/\/fetchmail.berlios.de\/\">fetchmail<\/a> and <a href=\"http:\/\/pyropus.ca\/software\/getmail\/\">getmail<\/a>. I chose getmail because it seemed better documented and supported. The scripts to set-up getmail are even easy to read. Here&#8217;s my Google Mail script: .getmail\/getmailrc-1:<\/p>\n<p><code><br \/>\n[retriever]<br \/>\ntype = SimpleIMAPSSLRetriever<br \/>\nserver = imap.googlemail.com<br \/>\nusername = ***<br \/>\npassword = ***<br \/>\nmailboxes = (\"INBOX\", )<\/p>\n<p>[destination]<br \/>\ntype = Maildir<br \/>\npath = ~\/Maildir\/<\/p>\n<p>[options]<br \/>\nread_all = false<br \/>\nmessage_log = ~\/.getmail\/log<br \/>\ndelete = true<br \/>\n<\/code><\/p>\n<p>Mail collected by this script is delivered directly to my <a href=\"http:\/\/en.wikipedia.org\/wiki\/Maildir\">Maildir<\/a> folder. Maildir is one of the two most popular email storage formats (the other is <a href=\"http:\/\/en.wikipedia.org\/wiki\/Mbox\">mbox<\/a>) and I chose it because it seemed more robust and easier to configure.<\/p>\n<p>I have one of these scripts for each account and type of mail I need to collect. But getmail doesn&#8217;t collect my mail automatically. Each time I must run the getmail program with this script:<\/p>\n<p><code><br \/>\ngetmail -r getmailrc-1<br \/>\n<\/code><\/p>\n<p>However I can get the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Cron\">cron<\/a> program to run getmail for me a regular intervals. The cron program was running automatically on my Ubuntu system so all I needed to do was add entries for my mail collections. I did that with the command:<\/p>\n<p><code><br \/>\ncrontab -e<br \/>\n<\/code><\/p>\n<p>This allows me to edit my <a href=\"http:\/\/en.wikipedia.org\/wiki\/Crontab#crontab_syntax\" title=\"syntax of the crontab file\">crontab<\/a> file which is a schedule of programs that I want to run. The schedule is a list with one entry per line. Each entry starts with 5 space separated numbers and then the command to start the program. The numbers represent: minutes past the hour, hour, day of the month, month, and day of the week. Any of these numbers can be replaced with a * which will match any value. The cron program will then call the program whenever the current time matches the numbers:<\/p>\n<p><code><br \/>\n10 * * * * \/usr\/bin\/getmail -r getmailrc-1 -r getmailrc-2<br \/>\n<\/code><\/p>\n<p>This line from my crontab collects my mail from two different accounts at 10 minutes past the hour.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For a long time I&#8217;ve wanted a better home office e-mail system and I finally had some free time to set it up. It took a while. The information and tools are all freely available. But they are distributed in many different places and it&#8217;s difficult to find stuff when you don&#8217;t know what to look for. So I&#8217;m documenting my set-up here for future reference.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,7],"tags":[],"class_list":["post-37","post","type-post","status-publish","format-standard","hentry","category-internet","category-process"],"_links":{"self":[{"href":"https:\/\/powered-up-games.com\/blog\/wordpress\/wp-json\/wp\/v2\/posts\/37","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=37"}],"version-history":[{"count":0,"href":"https:\/\/powered-up-games.com\/blog\/wordpress\/wp-json\/wp\/v2\/posts\/37\/revisions"}],"wp:attachment":[{"href":"https:\/\/powered-up-games.com\/blog\/wordpress\/wp-json\/wp\/v2\/media?parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/powered-up-games.com\/blog\/wordpress\/wp-json\/wp\/v2\/categories?post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/powered-up-games.com\/blog\/wordpress\/wp-json\/wp\/v2\/tags?post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}