From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 2078D431FD0 for ; Mon, 16 May 2011 02:29:12 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled 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 UMb2pv5nlkgU for ; Mon, 16 May 2011 02:29:09 -0700 (PDT) Received: from kaylee.flamingspork.com (kaylee.flamingspork.com [74.207.245.61]) by olra.theworths.org (Postfix) with ESMTP id 6CCB5431FB6 for ; Mon, 16 May 2011 02:29:09 -0700 (PDT) Received: from willster.flamingspork.com (localhost [127.0.0.1]) by kaylee.flamingspork.com (Postfix) with ESMTPS id 30D0A609E for ; Mon, 16 May 2011 09:28:45 +0000 (UTC) Received: by willster.flamingspork.com (Postfix, from userid 1000) id 2EE8825F0DE; Mon, 16 May 2011 19:29:07 +1000 (EST) From: Stewart Smith To: notmuch Subject: Multiple sender identities (composing) User-Agent: Notmuch/0.5-93-g5e4ed5b (http://notmuchmail.org) Emacs/23.2.1 (x86_64-pc-linux-gnu) Date: Mon, 16 May 2011 19:29:07 +1000 Message-ID: <87vcxb0za4.fsf@flamingspork.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Mon, 16 May 2011 09:29:12 -0000 Thought I'd share this bit of my .emacs snippet that may be useful to go on the emacs tips page. This does the following: - sets up a list of possible identities to have mail From - on composing mail, it prompts you for who you want to send mail from - pressing enter will give you the default (first in the list) - otherwise you have tab completion You may also want to set this: '(message-sendmail-envelope-from (quote header)) (in custom-set-variables) so that if you're doing postfix sender based routing or the like, it gets the correct address and doesn't end up sending things the wrong way. (setq stewart/mua-identities (list "Stewart Smith " "Stewart Smith ")) (defun stewart/notmuch-mua-mail (&optional from) (interactive) (setq from (completing-read "Sender identity: " stewart/mua-identities nil t nil nil (car stewart/mua-identities))) (notmuch-mua-mail nil nil (list (cons 'from from)))) (define-key notmuch-show-mode-map "m" (lambda () "send email" (interactive) (stewart/notmuch-mua-mail))) (define-key notmuch-search-mode-map "m" (lambda () "send email" (interactive) (stewart/notmuch-mua-mail))) -- Stewart Smith