Re: [notmuch] Fcc, Maildir, and Emacs message-mode -- a bit of code
authorSebastian Spaeth <Sebastian@SSpaeth.de>
Fri, 23 Apr 2010 07:13:06 +0000 (09:13 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:36:49 +0000 (09:36 -0800)
d1/404206df93b328bcb8fbf48b02f657b7f4800e [new file with mode: 0644]

diff --git a/d1/404206df93b328bcb8fbf48b02f657b7f4800e b/d1/404206df93b328bcb8fbf48b02f657b7f4800e
new file mode 100644 (file)
index 0000000..3336057
--- /dev/null
@@ -0,0 +1,74 @@
+Return-Path: <Sebastian@SSpaeth.de>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 06CD84196F3\r
+       for <notmuch@notmuchmail.org>; Fri, 23 Apr 2010 00:13:12 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.9\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
+       tests=[BAYES_00=-1.9] autolearn=ham\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 96MEpOHT9h4O for <notmuch@notmuchmail.org>;\r
+       Fri, 23 Apr 2010 00:13:11 -0700 (PDT)\r
+Received: from homiemail-a20.g.dreamhost.com (caiajhbdccah.dreamhost.com\r
+       [208.97.132.207])\r
+       by olra.theworths.org (Postfix) with ESMTP id 2678D4196F2\r
+       for <notmuch@notmuchmail.org>; Fri, 23 Apr 2010 00:13:11 -0700 (PDT)\r
+Received: from sspaeth.de (mtec-hg-docking-1-dhcp-204.ethz.ch\r
+       [129.132.133.204]) (Authenticated sender: sebastian@sspaeth.de)\r
+       by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPA id D5B757EC065; \r
+       Fri, 23 Apr 2010 00:13:08 -0700 (PDT)\r
+Received: by sspaeth.de (sSMTP sendmail emulation);\r
+       Fri, 23 Apr 2010 09:13:06 +0200\r
+From: "Sebastian Spaeth" <Sebastian@SSpaeth.de>\r
+To: Dirk Hohndel <hohndel@infradead.org>, notmuch@notmuchmail.org\r
+Subject: Re: [notmuch] Fcc, Maildir, and Emacs message-mode -- a bit of code\r
+In-Reply-To: <m3bpdbrsa7.fsf@x200.gr8dns.org>\r
+References: <873a1zs3t5.fsf@jhu.edu> <87ochbx3er.fsf@SSpaeth.de>\r
+       <m3bpdbrsa7.fsf@x200.gr8dns.org>\r
+Date: Fri, 23 Apr 2010 09:13:06 +0200\r
+Message-ID: <87bpdaljzx.fsf@SSpaeth.de>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 23 Apr 2010 07:13:12 -0000\r
+\r
+On 2010-04-22, Dirk Hohndel wrote:\r
+> ;; This is the list of alternatives that should be configurable as\r
+> ;; defcustom (or simply set in .emacs for now)\r
+> (setq notmuch-fcc-dirs '(\r
+>       ("Dirk Hohndel <dirk.hohndel@intel.com>" . "Maildir/Sent Items")\r
+>       ("Dirk Hohndel <hohndel@infradead.org>" . "MaildirInfradead/Sent")))\r
+> \r
+> ;This constructs a path, concatenating the content of the variable\r
+> ;"message-directory" and the second part in the alist:\r
+> (defun my-fcc-header-setup ()\r
+> (let ((subdir (cdr (assoc (message-fetch-field "from") notmuch-fcc-dirs))))\r
+>      (message-add-header (concat "Fcc: " message-directory subdir))))\r
+> (add-hook 'message-send-hook 'my-fcc-header-setup)\r
+\r
+> The disadvantage is that with the message-send-hook I don't get to see /\r
+> correct the FCC line in the message buffer - but since I trust the logic\r
+> here (and tested it quite a bit), I'm less concerned about this.\r
+\r
+Another disadvantage is that this does not provide a fallback, so if you\r
+type "dirk" rather than "Dirk" in your from, the fcc dir will be nil, so\r
+it tries to deliver just to "message-directory". The user should be able\r
+to configure a default FCC dir, I think.\r
+\r
+Sebastian\r