{"id":4293,"date":"2017-11-28T21:17:23","date_gmt":"2017-11-28T11:17:23","guid":{"rendered":"https:\/\/www.flamingspork.com\/blog\/?p=4293"},"modified":"2017-11-28T21:17:23","modified_gmt":"2017-11-28T11:17:23","slug":"how-i-do-email-at-home","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2017\/11\/28\/how-i-do-email-at-home\/","title":{"rendered":"How I do email (at home)"},"content":{"rendered":"<p>I thought I might write something up on how I&#8217;ve been doing email both at home and at work. I very much on purpose keep the two <strong>completely<\/strong> separate, and have slightly different use cases for both of them.<\/p>\n<p>For work, I do <strong>not<\/strong> want mail on my phone. For personal mail, it turns out I <strong>do<\/strong> want this on my phone, which is currently an Android phone. Since my work and personal email is very separate, the volume of mail is really, <strong>really<\/strong> different. Personal mail is maybe a couple of dozen a day at most. Work is&#8230; orders of magnitude more.<\/p>\n<p>Considering I generally prefer free software to non-free software, <a href=\"https:\/\/k9mail.github.io\/\">K9 Mail<\/a> is the way I go on my phone. I have it set up to point at the IMAP and SMTP servers of my mail provider (<a href=\"https:\/\/www.fastmail.com\/\">FastMail<\/a>). I also have a google account, and the gmail app works fine for the few bits of mail that go there instead of my regular account.<\/p>\n<p>For my mail accounts, I do an INBOX ZERO like approach (in reality, I&#8217;m pretty much nowhere near zero, but today I learned I&#8217;m a lot closer than many colleagues). This means I read \/ respond \/ do \/ ignore mail and then move it to an ARCHIVE folder. K9 and Gmail both have the ability to do this easily, so it works well.<\/p>\n<p>Additionally though, I don&#8217;t want to care about limits on storage (i.e. expire mail from the server after X days), nor do I want to rely on &#8220;the cloud&#8221; to be the only copy of things. I also don&#8217;t want to have to upload any of past mail I may be keeping around. I also generally prefer to use <a href=\"http:\/\/notmuchmail.org\/\">notmuch<\/a> as a mail client on a computer.<\/p>\n<p>For those not familiar with notmuch, it does tags on mail in Maildir, is extremely fast and can actually cope with a quantity of mail. It also has this &#8220;archive&#8221;\/INBOX ZERO workflow which I like.<\/p>\n<p>In order to get mail from FastMail and Gmail onto a machine, I use <a href=\"http:\/\/www.offlineimap.org\/\">offlineimap<\/a>. An important thing to do is to set &#8220;<code>status_backend = sqlite<\/code>&#8221; for each <code>Account<\/code>. It turns out I first hacked on sqlite for offlineimap status <a href=\"https:\/\/www.flamingspork.com\/blog\/2007\/03\/28\/patching-your-mission-critical-email-syncing-software-on-your-life-setup-my-offlineimap-patch-for-today\/\">a bit over ten years ago<\/a> &#8211; time flies. For each Account I also set <code>presynchook = ~\/Maildir\/maildir-notmuch-presync<\/code> (below) and a <code>postsynchook = notmuch new<\/code>. The presynchook is run before we sync, and its job is to move files around based on the tags in notmuch and the postsynchook lets notmuch catch any new mail that&#8217;s been fetched.<\/p>\n<p>My maildir-notmuch-presync hook script is:<\/p>\n<pre>#!\/bin\/bash\r\nnotmuch search --output=files not tag:inbox and folder:fastmail\/INBOX|xargs -I'{}' mv '{}' \"$HOME\/Maildir\/INBOX\/fastmail\/Archive\/cur\/\"\r\n\r\nnotmuch search --output=files folder:fastmail\/INBOX and tag:spam |xargs -I'{}' mv '{}' \"$HOME\/Maildir\/INBOX\/fastmail\/Spam\/cur\/\"\r\nARCHIVE_DIR=$HOME\/Maildir\/INBOX\/`date +\"%Y%m\"`\/cur\/\r\nmkdir -p $ARCHIVE_DIR\r\nnotmuch search --output=files folder:fastmail\/Archive and date:..90d and not tag:flagged | xargs -I'{}' mv '{}' \"$ARCHIVE_DIR\"\r\n\r\n# Gmail\r\nnotmuch search --output=files not tag:inbox and folder:gmail\/INBOX|grep 'INBOX\/gmail\/INBOX\/' | xargs -I'{}' rm '{}'\r\nnotmuch search --output=files folder:gmail\/INBOX and tag:spam |xargs -I'{}' mv '{}' \"$HOME\/Maildir\/INBOX\/gmail\/[Gmail].Spam\/cur\/\"\r\n<\/pre>\n<p>So This keeps 90 days of mail on the fastmail server, and archives older mail off into month based archive dirs. This is simply to keep directory sizes not too large, you <strong>could<\/strong> put everything in one directory&#8230; but at some point that gets a bit silly.<\/p>\n<p>I don&#8217;t think this is all the most optimal setup I could have, but it does let me read and answer mail on my phone and desktop (as well as use a web client if I want to). There is a bit of needless copying of messages by offlineimap under certain circumstances, but I don&#8217;t get enough personal mail for it to be a problem.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I thought I might write something up on how I&#8217;ve been doing email both at home and at work. I very much on purpose keep the two completely separate, and have slightly different use cases for both of them. For &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2017\/11\/28\/how-i-do-email-at-home\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[724,723,435,725,727,144,434,722,726],"class_list":["post-4293","post","type-post","status-publish","format-standard","hentry","category-general","tag-email","tag-fastmail","tag-gmail","tag-imap","tag-k9","tag-mail","tag-notmuch","tag-offlineimap","tag-smtp"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-17f","jetpack-related-posts":[{"id":432,"url":"https:\/\/www.flamingspork.com\/blog\/2005\/07\/19\/faster-imap\/","url_meta":{"origin":4293,"position":0},"title":"faster IMAP","author":"Stewart Smith","date":"2005-07-19","format":false,"excerpt":"wow, courier-imap in sarge is so much faster than in woody. I see noticable speed improvements now. I also don't see weird stuff happenning with offlineimap (terminating due to unexpected EOF). Much happier with mail. Also, on another note, I've started using Evolution's vfolders again. Talk about cool. Also, I\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":622,"url":"https:\/\/www.flamingspork.com\/blog\/2006\/03\/15\/let-me-express-my-thanks\/","url_meta":{"origin":4293,"position":1},"title":"Let me express my thanks","author":"Stewart Smith","date":"2006-03-15","format":false,"excerpt":"Looks like due to a bug in offlineimap, i'm now getting 1 copy of my mail on my laptop, and about 3 copies of each message on my imap server. Looks like I'm going to have to write a script to find duplicate mail messages to unfuck this. Damn you\u2026","rel":"","context":"In &quot;grumble&quot;","block_context":{"text":"grumble","link":"https:\/\/www.flamingspork.com\/blog\/category\/grumble\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":760,"url":"https:\/\/www.flamingspork.com\/blog\/2006\/11\/13\/86gb-of-email\/","url_meta":{"origin":4293,"position":2},"title":"8.6GB of email","author":"Stewart Smith","date":"2006-11-13","format":false,"excerpt":"If you tar my Maildir, it comes out at about 8.6GB currently. That's about all my mail since October 2001. Notable exceptions are most of the Spam I've received and any messages from LKML. Doing a first time sync with offlineimap takes an amount of time that is truly scary.\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":905,"url":"https:\/\/www.flamingspork.com\/blog\/2007\/10\/18\/everything-thats-wrong-and-right-with-ubuntu-gutsy\/","url_meta":{"origin":4293,"position":3},"title":"Everything that&#8217;s wrong (and right) with Ubuntu Gutsy","author":"Stewart Smith","date":"2007-10-18","format":false,"excerpt":"So, I've upgraded two boxes: my laptop and my mail server. Wrong: courier-imap-ssl broke. My cell phone could no longer pull mail. I got something like in the log: imapd-ssl: couriertls: connect: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number The fix for this is to change the TLS_PROTOCOL option in \/etc\/courier\/imapd-ssl to SSL23\u2026","rel":"","context":"In &quot;GNOME&quot;","block_context":{"text":"GNOME","link":"https:\/\/www.flamingspork.com\/blog\/category\/gnome\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2393,"url":"https:\/\/www.flamingspork.com\/blog\/2011\/09\/17\/without-notmuch-i-would-simply-delete-your-email\/","url_meta":{"origin":4293,"position":4},"title":"Without notmuch, I would simply delete your email","author":"Stewart Smith","date":"2011-09-17","format":false,"excerpt":"I have been using notmuch (http:\/\/notmuchmail.org\/) as my email client for quite a while now. It's fast. I don't mean that everything happens instantly (some actions do take a bit longer than ideally they would), but with the quantity of mail I (and others) throw at it? Beats everything else\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3523,"url":"https:\/\/www.flamingspork.com\/blog\/2013\/10\/22\/how-many-pages-of-tos-and-privacy-policies\/","url_meta":{"origin":4293,"position":5},"title":"How many pages of ToS and Privacy Policies?","author":"Stewart Smith","date":"2013-10-22","format":false,"excerpt":"So, I started this thought experiment: let's assume for the moment that government is completely trustworthy, only has your interests at heart and doesn't secretly sell you out to whoever they feel like. Now, on top of that, what about the agreements you enter into with corporations? How long are\u2026","rel":"","context":"In &quot;life, the universe and everything&quot;","block_context":{"text":"life, the universe and everything","link":"https:\/\/www.flamingspork.com\/blog\/category\/life-the-universe-and-everything\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/4293","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/comments?post=4293"}],"version-history":[{"count":2,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/4293\/revisions"}],"predecessor-version":[{"id":4335,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/4293\/revisions\/4335"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=4293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=4293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=4293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}