Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 589DA49F192 for ; Thu, 11 Mar 2010 07:24:22 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.185 X-Spam-Level: X-Spam-Status: No, score=-0.185 tagged_above=-999 required=5 tests=[BAYES_40=-0.185] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hc6pchu6htkz for ; Thu, 11 Mar 2010 07:24:21 -0800 (PST) Received: from mail-ew0-f219.google.com (mail-ew0-f219.google.com [209.85.219.219]) by olra.theworths.org (Postfix) with ESMTP id B57D849F191 for ; Thu, 11 Mar 2010 07:24:20 -0800 (PST) Received: by ewy19 with SMTP id 19so63174ewy.2 for ; Thu, 11 Mar 2010 07:24:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject; bh=xan/iuTKOLF5y4MI7UmMIFb74H6ycdvGvr5s4REcn/Y=; b=BUreiEoIh38HVcAqQgUVHI+mrv0o88PsUS+gpJHIB2WSE0MxrrFkmsOiGGeiNvozcm 3135a9olixiXPlsG5KGclnxbIPVscLUonPaLzA38s82ezPKsFGQ6Jairx0iABHuZ2Ys0 9VeJJTEmB2NMT9hIlEsMWF0FeYxJ/AlB0I+xI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject; b=gCON4S5DTgHH0d/KoGPYD8WExdJPy64d45u1mr/j7sSvjf4keFg25H/wJspVfsUYDD 7Fmpes8wIJbsiVR2domKHAQa5XjGs310z3kPEe5wO3IfCjw0n2Gw48CLxGydqDKhtbza EPIsqv30ocsxYacYGmRRSwfBXWxYhIYVKdhLY= Received: by 10.213.103.146 with SMTP id k18mr2158847ebo.5.1268321045515; Thu, 11 Mar 2010 07:24:05 -0800 (PST) Received: from localhost (pool-96-236-125-203.spfdma.east.verizon.net [96.236.125.203]) by mx.google.com with ESMTPS id 15sm62383ewy.8.2010.03.11.07.24.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 11 Mar 2010 07:24:05 -0800 (PST) Message-ID: <4b990b15.0f67f10a.361e.0682@mx.google.com> Date: Thu, 11 Mar 2010 07:24:05 -0800 (PST) From: Ben Gamari To: notmuch Subject: [notmuch] My shiny new notmuch configuration X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Mar 2010 15:24:22 -0000 Hey all, After standing on the sidelines for several months now, I've finally transitioned to using notmuch exclusively. I had originally intended on waiting until the vim was in a usable state, but it seems that the emacs client is usable enough for basic mail reading for the time being. It took a bit of thinking to figure out how thing should be implemented, but I think it turned out alright. There are still a few sticky spots, but hopefully I'll be able to iron those out in time. Regardless, I couldn't sacrifice my preference for vim for email composition and therefore have been using a small wrapper script[10] to begin new drafts. I also have a small python script[12] so that I can make use of my old sup address book. Finally, I have a script for sending a draft and placing it in my sent maildir. My tagging script[13] is very similar to those posted here before. All-in-all, things seem very usable and I'm quite happy with how my notmuch configuration has turned out. It will be very nice with a real vim interface, which I'll hopefully have time to work on in May or so. Unfortunately, both notmuch new and the initial tagging process are a bit slower than I would like (with fairly warm caches notmuch new just took 20 seconds to add 2 messages, which then took an additional 45 seconds to tag) but still usable. I believe I should have the newest Xapian bits so I guess figuring out the issue here could require some investigation. In the meantime, I've done a some hacking on the noneatall[1] web interface that was posted here a little while ago, restructing the code a little and adding a tag list. I intend doing more work on this in the future. At the moment the latency really kills usability, but with some work I suspect a web interface might be very usable. I hope that someone finds this at least slightly useful. Cheers, - Ben [1] 874okzdgh0.fsf@aw.hh.sledj.ne [10] compose-mail #!/bin/bash cd ~/.mail/.drafts TO=$(contacts $@) gvim - +3 -c'set syntax=mail' < To: ${TO} Subject: EOF [11] contacts #!/usr/bin/python # Simple address book lookup: # Usage: contacts.py [alias] # Outputs: Full Name import os import sys contacts_file = os.path.expanduser('~/.contacts') def get(): contacts = {} for l in open(contacts_file, 'r'): name,address = l.split(':') contacts[name.strip()] = address.strip() return contacts if __name__ == '__main__': contacts = get() m = [] m = [ contacts.get(name, name) for name in sys.argv[1:] ] print ", ".join(m) [13] sort-mail #!/usr/bin/python dry_run = False import subprocess import time def sf_list(name): return 'to:%s@lists.sourceforge.net or to:%s@lists.sf.net' % (name, name) def kernel_list(name): return 'to:%s@vger.kernel.org' % name def fdo_list(name): return 'to:%s@lists.freedesktop.org' % name # These are bulk message sources which should be immediately archived list_tags = { kernel_list('linux-kernel'): 'lkml', kernel_list('linux-omap') : 'linux-omap', kernel_list('linux-next'): 'linux-next', 'to:linux-arm-kernel@lists.infradead.org': 'linux-arm', sf_list('oprofile-list'): 'oprofile', sf_list('ipw3945-devel'): 'ipw', 'to:hostap@lists.shmoo.com': 'hostap', 'to:ath9k-devel@': 'ath9k', 'to:vim-dev@vim.org': 'vim', fdo_list('intel-gfx'): 'intel-gfx', fdo_list('xorg'): 'xorg', fdo_list('hal'): 'hal', fdo_list('compiz'): 'compiz', sf_list('dri-devel'): 'dri', sf_list('dri-users'): 'dri', sf_list('mesa3d-dev'): 'mesa', fdo_list('devkit-devel'): 'devkit', sf_list('matplotlib-users'): 'matplotlib', 'to:notmuch@notmuchmail.org': 'notmuch', 'to:openembedded-devel@lists.openembedded.org': 'openembedded', 'to:beagleboard@googlegroups.com': 'beagleboard', 'to:angstrom-distro-devel@linuxtogo.org': 'angstrom', 'to:angstrom-distro-users@linuxtogo.org': 'angstrom', 'to:mono-devel-list@lists.ximian.com': 'mono', 'to:mono-list@': 'mono', 'to:ubuntu-devel-discuss@lists.ubuntu.com': 'ubuntu-devel', 'to:git@vger.kernel.org': 'git', 'to:sup-talk@rubyforge.org': 'sup', 'from:bugzilla': 'bugs', 'to:gdh@gdhour.com': 'gdh', 'from:Facebook': 'facebook', } # Tags that aren't for lists generic_tags = { 'from:goldner': 'lori', 'to:goldnerlab': 'lori', 'to:babaev1@physics.umass.edu': 'stat-mech', 'to:pgradon@physics.umass.edu': 'pgradon', } def notmuch(*args): cmd = ['notmuch'] cmd.extend(args) print ' '.join(cmd) if dry_run: return while True: res = subprocess.call(cmd) if res == 0: break print "Call failed. Trying again in 1 second..." time.sleep(1) # Tag things for terms, tag in generic_tags.items(): notmuch('tag', '+%s' % tag, 'tag:inbox', terms) # Tag lists for terms, tag in list_tags.items(): notmuch('tag', '+list', '+%s' % tag, 'tag:inbox', terms) # Remove inbox for lists for terms, tag in list_tags.items(): notmuch('tag', '-inbox', 'tag:inbox', terms)