unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Multiple sender identities (composing)
@ 2011-05-16  9:29 Stewart Smith
  2011-05-16  9:52 ` Thomas Jost
                   ` (2 more replies)
  0 siblings, 3 replies; 35+ messages in thread
From: Stewart Smith @ 2011-05-16  9:29 UTC (permalink / raw)
  To: notmuch

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@flamingspork.com>" "Stewart Smith <stewart.smith@percona.com>"))

(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

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2011-06-02  1:49 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-16  9:29 Multiple sender identities (composing) Stewart Smith
2011-05-16  9:52 ` Thomas Jost
2011-05-16 13:52   ` Stewart Smith
2011-05-16 16:52     ` Jameson Graef Rollins
2011-05-16 18:03       ` Thomas Jost
2011-05-16 18:43         ` Jameson Graef Rollins
2011-05-16 22:36       ` green
2011-05-17  4:38       ` Mueen Nawaz
2011-05-24 21:54 ` Carl Worth
2011-05-24 22:02   ` [PATCH] emacs: Allow user to choose "From" address when composing a new message Carl Worth
2011-05-25 13:21     ` Thomas Jost
2011-05-25 13:22       ` [PATCH 1/4] emacs: Allow the user choose the "From" address when composing a new message from notmuch-show-mode too Thomas Jost
2011-05-25 13:22         ` [PATCH 2/4] emacs: Move the "prompt for sender" code to a new function Thomas Jost
2011-05-25 13:22         ` [PATCH 3/4] emacs: Allow the user to choose the "From" address when forwarding a message Thomas Jost
2011-05-25 13:22         ` [PATCH 4/4] emacs: Allow the user to choose the "From" address when replying to " Thomas Jost
2011-05-25 22:17       ` [PATCH] emacs: Allow user to choose "From" address when composing a new message Carl Worth
2011-05-26  8:39         ` Thomas Jost
2011-05-26  8:41           ` [PATCH v2 1/4] emacs: Helpers needed for the user to be able to choose the " Thomas Jost
2011-05-26  8:41             ` [PATCH v2 2/4] emacs: Allow the user " Thomas Jost
2011-05-26  8:41             ` [PATCH v2 3/4] emacs: Allow the user to choose the "From" address when forwarding a message Thomas Jost
2011-05-26  8:41             ` [PATCH v2 4/4] emacs: Allow the user to choose the "From" address when replying to " Thomas Jost
2011-05-26 15:35           ` [PATCH] emacs: Allow user to choose "From" address when composing a new message Jameson Graef Rollins
2011-05-26 17:22             ` [PATCH] emacs: Add a customization allowing to always prompt for the " Thomas Jost
2011-05-26 17:46               ` Jameson Graef Rollins
2011-05-26 21:11               ` Carl Worth
2011-05-26 21:37                 ` Jameson Graef Rollins
2011-05-26 22:33                   ` Jameson Graef Rollins
2011-05-27  9:14                     ` [PATCH 1/2] emacs: Don't always prompt for the "From" address when replying Thomas Jost
2011-05-27  9:15                       ` [PATCH 2/2] emacs: Cleaner interface when prompting for sender address Thomas Jost
2011-05-27 10:37                         ` Jameson Graef Rollins
2011-05-27 10:36                       ` [PATCH 1/2] emacs: Don't always prompt for the "From" address when replying Jameson Graef Rollins
2011-05-29 22:38   ` Multiple sender identities (composing) Stewart Smith
2011-06-01  5:53 ` Brian May
2011-06-01  6:42   ` Thomas Jost
2011-06-02  1:49     ` Brian May

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).