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 C7232431FBC for ; Thu, 21 Jan 2010 10:36:50 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.391 X-Spam-Level: X-Spam-Status: No, score=-0.391 tagged_above=-999 required=5 tests=[AWL=-0.392, BAYES_50=0.001] 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 uA8onqIV5nJ4 for ; Thu, 21 Jan 2010 10:36:50 -0800 (PST) Received: from batman.acm.jhu.edu (batman.acm.jhu.edu [128.220.251.35]) by olra.theworths.org (Postfix) with ESMTP id 23DC8431FAE for ; Thu, 21 Jan 2010 10:36:50 -0800 (PST) Received: from batman.acm.jhu.edu (localhost.localdomain [127.0.0.1]) by batman.acm.jhu.edu (Postfix) with ESMTP id 7A996CED7B; Thu, 21 Jan 2010 13:36:47 -0500 (EST) Received: by batman.acm.jhu.edu (Postfix, from userid 99) id 6FAE6CEE4E; Thu, 21 Jan 2010 13:36:47 -0500 (EST) Received: from lucky (c-69-255-36-229.hsd1.md.comcast.net [69.255.36.229]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by batman.acm.jhu.edu (Postfix) with ESMTPSA id B1AFCCED7B; Thu, 21 Jan 2010 13:36:43 -0500 (EST) Received: by lucky (Postfix, from userid 1000) id 9273433475F; Thu, 21 Jan 2010 13:36:38 -0500 (EST) From: Jesse Rosenthal To: notmuch@notmuchmail.org Date: Thu, 21 Jan 2010 13:36:38 -0500 Message-ID: <873a1zs3t5.fsf@jhu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV using ClamSMTP Subject: [notmuch] Fcc, Maildir, and Emacs message-mode -- a bit of code 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, 21 Jan 2010 18:36:50 -0000 Dear all, First of all, many thanks to Carl and others for writing notmuch. Some folks on IRC were bemoaning message-mode's annoying inability to save sent-mail to a Maildir using Fcc. I mentioned that I had written a bit of Maildir elisp code for that purpose a while back, and it was suggested that I share it with the list. Some caveats: - I've tested this a good number of times, but not very robustly, since I don't actually use it (I found that I prefer blind-copying myself). Please test it out somewhere safe, on a maildir you can afford to lose. - The hardlinking performed by `add-name-to-file' might be platform and filesystem specific. I'm using linux/ext3, and it works here. I don't know what will happen anywhere else. - I imagine there's a much better implementation inside of Wanderlust, if you can dig through all the libraries. - It's not really commented, but I hope the function names are pretty self-explanatory. - It requires that the directory in the `Fcc:' header already exist and be a maildir (i.e. have cur/, new/, and tmp/). It should be pretty simple to add in a prompt for creating a directory if it points to a nonexistent place. Anyway, here it is: http://jkr.acm.jhu.edu/jkr-maildir.el To use it, set one of the following: If you want Fcc'd messages to be marked as read: (setq message-fcc-handler-function '(lambda (destdir) (jkr/maildir-write-buffer-to-maildir destdir t))) If you want Fcc'd messages to be marked as new: (setq message-fcc-handler-function '(lambda (destdir) (jkr/maildir-write-buffer-to-maildir destdir nil))) Best, Jesse