Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Lisp recipe to set From header
@ 2006-01-27 21:34 Matthew King
  2006-01-27 22:12 ` Sébastien Kirche
  2006-01-27 22:39 ` David Z Maze
  0 siblings, 2 replies; 3+ messages in thread
From: Matthew King @ 2006-01-27 21:34 UTC (permalink / raw)


I have the following:

;;; Set From header based on To header
(setq gnus-posting-styles
      '(("nn.+:"
	 (From (save-excursion
		 (set-buffer gnus-article-buffer)
		 (message-fetch-field "to"))))))

Which, as the comment says, sets the From header to be that of the
previous mail's To header. I have problems with my address being in the
Cc header instead or with there being more than one address in To, but
this is not important.

What I really want to do is only set the From address to be one from a
pre-set list and to fall back on user-mail-address if there is no match.

I don't know anywhere near enough lisp to write this though, so how
would I go about doing this?

Matthew

-- 
I must take issue with the term "a mere child," for it has been my
invariable experience that the company of a mere child is infinitely
preferable to that of a mere adult.
                                           --  Fran Lebowitz

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

end of thread, other threads:[~2006-01-27 22:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-27 21:34 Lisp recipe to set From header Matthew King
2006-01-27 22:12 ` Sébastien Kirche
2006-01-27 22:39 ` David Z Maze

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 NNTP newsgroup(s).