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 296B8431FD0 for ; Mon, 16 May 2011 03:02:56 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.09 X-Spam-Level: X-Spam-Status: No, score=-0.09 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, T_MIME_NO_TEXT=0.01] 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 MG9zdlQL5sBv for ; Mon, 16 May 2011 03:02:53 -0700 (PDT) X-Greylist: delayed 598 seconds by postgrey-1.32 at olra; Mon, 16 May 2011 03:02:53 PDT Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222]) by olra.theworths.org (Postfix) with ESMTP id 6F618431FB6 for ; Mon, 16 May 2011 03:02:53 -0700 (PDT) Received: from thor.loria.fr (unknown [IPv6:2001:660:4501:1:dad3:85ff:fe94:599c]) by ks3536.kimsufi.com (Postfix) with ESMTPSA id 8D7E86A06A9 for ; Mon, 16 May 2011 11:52:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net; s=key-schnouki; t=1305539574; bh=R7R/N0mk95+qxV7f6sarD+9vzekUn/MaHE/vn+NM0W4=; h=From:To:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=HnwUNcPUg0ntpDtRM9bq2F6wJmErLSdo2UOWdL+l441uHWd2WbzZMCcgnH5We7TSe cKvRo1aAYMXYtpISfnzc7hpvXRfHIUoa8Ifch3/41KaHspZ8rJ3HkKb00TIWnjtTVM aCCXb2LZm0FYoNAIaIJ4fD7gbgsT3qly0QbGNtAQ= From: Thomas Jost To: notmuch Subject: Re: Multiple sender identities (composing) In-Reply-To: <87vcxb0za4.fsf@flamingspork.com> References: <87vcxb0za4.fsf@flamingspork.com> User-Agent: Notmuch/0.5-156-g539f505 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-unknown-linux-gnu) Date: Mon, 16 May 2011 11:52:43 +0200 Message-ID: <8762pb55w4.fsf@thor.loria.fr> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" 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 10:02:56 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable On Mon, 16 May 2011 19:29:07 +1000, Stewart Smith wrote: > Thought I'd share this bit of my .emacs snippet that may be useful to go > on the emacs tips page. >=20 > 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 And here's the same for choosing the identity when forwarding a mail: ;; Choose the identity used to forward a mail (defun schnouki/notmuch-mua-forward-message () (interactive) (let* ((from (ido-completing-read "Sender identity: " schnouki/mua-identi= ties nil nil nil nil (car schnouki/mua-identities))) (address-components (mail-extract-address-components from)) (user-full-name (car address-components)) (user-mail-address (cadr address-components))) (notmuch-mua-forward-message))) (people who don't use or like ido may want to replace ido-completing-read with completing-read) If anyone is interested, I have some more useful snippets available on https://github.com/Schnouki/dotfiles/blob/master/emacs/init-50-mail.el#L232: =2D function to choose a signature according to the From header =2D function to choose the sender identity according to the To header (useful for replying to work e-mails using your work address, or for replying to a ML with a subscribed address that won't be rejected) =2D function to change the SMTP server that will be used for sending the mail according to the From header It seriously lacks documentation so don't hesitate to ask if you have any problem with it :) Regards, =2D-=20 Thomas/Schnouki --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJN0PPrAAoJEMPdciX+bh5Iu/0H/2bhnIqrieBzWahh4PhEo/rP jBsUEofNMa8pTZKh018jZtGUbBhMdUCNNXd2uKhW0yEmF7Gnry3frjUNpF9IPDTN Keh+L29YotbccQpgTy4cflRiuGjfFKAn8bH9rU1ddO0POMAXBbVb57PVJclUsZth 3noYrAW+pj0cMOS3/urL270Stxnlt2+8/viZ3mAX2t4SuCGrdztN2La1hO75dXjm 1D6FlNBMEWKb/RhTI96EDL7F7EsG01FjJuUNmLi6go/WGYfitXYPukaEQWHZLOme LcwigQc6aXhpAmMQgVThhhXsf/XtkBFGB8rKiSc5Z+ewMx3kHKEY2X3yiM1oI2I= =Wy7a -----END PGP SIGNATURE----- --=-=-=--