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 2B2554048C4 for ; Thu, 11 Mar 2010 12:05:17 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.323 X-Spam-Level: X-Spam-Status: No, score=-0.323 tagged_above=-999 required=5 tests=[AWL=-0.324, 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 D0Jdw32Sgk0x for ; Thu, 11 Mar 2010 12:05:16 -0800 (PST) X-Greylist: delayed 1195 seconds by postgrey-1.32 at olra; Thu, 11 Mar 2010 12:05:16 PST Received: from mail.sflc.info (mail.sflc.info [216.27.154.199]) by olra.theworths.org (Postfix) with ESMTP id 04CDB4048C0 for ; Thu, 11 Mar 2010 12:05:15 -0800 (PST) Received: from localhost (unknown [10.5.53.83]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sflc.info (Postfix) with ESMTP id 56D6920353445; Thu, 11 Mar 2010 14:45:08 -0500 (EST) From: James Vasile To: Michal Sojka , notmuch@notmuchmail.org In-Reply-To: <87ljdyn7zi.fsf@steelpick.localdomain> References: <87aauhp9kk.fsf@hackervisions.org> <87pr3bm2sn.fsf@steelpick.localdomain> <87fx46hq7w.fsf@hackervisions.org> <87ljdyn7zi.fsf@steelpick.localdomain> Date: Thu, 11 Mar 2010 14:45:03 -0500 Message-ID: <876352hccg.fsf@softwarefreedom.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [notmuch] [PATCH] Change From and Bcc when creating reply draft buffer 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 20:05:17 -0000 On Thu, 11 Mar 2010 17:22:41 +0100, Michal Sojka wrote: > thanks for clarification. It all sounds reasonable. The only problem I > can see now is that if I create a new account on my machine and run > emacs there, then the value of user-mail-address is @ > which doesn't refer to existing mailbox. I think that the header should > only be rewritten if these variables are known to have valid values. Do > you know how to do this? > I explicitly set these in my .emacs file, so I don't do any detection. If you could define "valid" I suppose you could test for such things. Something like the following works for me. I run mail-profile-foo with M-x or run it automatically with profile-guessing/setting routines. When I get the system ironed out, I'll emit patches and a wiki entry. (defun message-mode-set-profile () (save-excursion (when (string= "message-mode" major-mode) (goto-char (point-min)) (when (re-search-forward "^From: " nil t) (kill-line) (insert (format "%s <%s>" user-full-name user-mail-address))) (goto-char (point-min)) (when (re-search-forward "^Bcc: " nil t) (kill-line) (insert (format "%s <%s>" user-full-name user-mail-address)))))) (defun mail-profile-hv () (interactive) (setq mail-host-address "hackervisions.org" user-full-name "James Vasile" message-sendmail-extra-arguments '("-a" "hv") user-mail-address "james@hackervisions.org") (message-mode-set-profile) user-mail-address) (mail-profile-hv)