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 24EF64196F0 for ; Wed, 7 Apr 2010 13:05:01 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -4.2 X-Spam-Level: X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] 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 zUwhwh6pUkpk for ; Wed, 7 Apr 2010 13:05:00 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by olra.theworths.org (Postfix) with ESMTP id 566FE431FC1 for ; Wed, 7 Apr 2010 13:05:00 -0700 (PDT) Received: from localhost ([::1] helo=localhost.localdomain) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NzbUb-0002Uq-Te; Wed, 07 Apr 2010 20:04:54 +0000 Received: by localhost.localdomain (Postfix, from userid 500) id 6A028C00DB; Wed, 7 Apr 2010 13:04:53 -0700 (PDT) From: Dirk Hohndel To: Jameson Rollins , notmuch@notmuchmail.org Subject: Re: [notmuch] Fcc, Maildir, and Emacs message-mode -- a bit of code In-Reply-To: <878wbj4nfq.fsf@servo.finestructure.net> References: <873a1zs3t5.fsf@jhu.edu> <878wbj4nfq.fsf@servo.finestructure.net> Date: Wed, 07 Apr 2010 13:04:53 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html 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: Wed, 07 Apr 2010 20:05:01 -0000 On Wed, 27 Jan 2010 09:44:41 -0500, Jameson Rollins wrote: > Hey, folks. Following up on this thread about better fcc handling, > Jesse passed on a simple python script he wrote that uses the python > "mailbox" module to deliver a message on stdin to a specified maildir > directory. It's very a simple, elegant and general purpose script > (attached). > > I then put the following in my notmuch .emacs to use the new script in > message-mode to fcc sent mail to my ~/.mail/sent directory: > > ;; fcc handler > (defun maildir-deliver-region(destdir) > (shell-command-on-region > (point-min) (point-max) > (concat "maildir-deliver.py -c -s -d " destdir))) > (setq message-fcc-handler-function 'maildir-deliver-region) > (defun my-message-header-setup () > (message-add-header "Fcc: ~/.mail/sent")) > (add-hook 'message-send-hook 'my-message-header-setup) This is really nice - just what I needed. Well, almost. Instead of passing in destdir it would be even better if the lisp code figured out which MailDir to use. So we'd have a configuration variable that matched From addresses to MailDirs "dirk@hohndel.org" "~/MailDirHohndel" "dirk.hohndel@intel.com" "~/MailDirIntel" etc. And just for safety used the passed in destdir as fallback / default. Anyone willing / able to add this? I can't lisp to save my life... /D -- Dirk Hohndel Intel Open Source Technology Center