GnusAlias

gnus-alias provides a simple mechanism to switch Identities when using message-mode. An Identity is one or more of the following elements:

All of this is also provided by the standard ‘gnus-posting-styles’. Whereas PostingStyles let you set these up initially, though, gnus-alias lets you change them on the fly easily, too (in this regard gnus-alias is much like GnusPers, upon which it is based). With a simple command (‘gnus-alias-select-identity’) you can select & replace one Identity with another.

There are other significant differences between gnus-alias and PostingStyles, too. gnus-alias has a much simpler interface/API for selecting an initial Identity automatically. PostingStyles is much more flexible (especially in that you can build up an “Identity” piece by piece), but with that flexibility can come some complexity.

Other advantages to using gnus-alias:

Latest version by original author can be found at: http://www.northbound-train.com/emacs.html

Emacswiki hosts a slightly updated version: Lisp:gnus-alias.el

– The Emacswiki version does not seem to work in XEmacs 21.4.

And this version adds a few goodies, including support swapping identities in multi-part MIME messages: https://github.com/altruizine/gnus-alias

– I wanted to use gnus-alias to add an Fcc header in some identities as follows:

(setq gnus-alias-identity-alist
      '(("work"
         nil
         "My Name <my.name@emailaddress.com>"
         nil ;; No organization header
         (("Fcc" . "/home/myname/Mail/Gmail/Archive")) ;; extra headers to save outgoing mail
         nil ;; No extra body text
         nil ;; No signature))

However, the version of gnus-alias from emacswiki tests to see whether “/home/myname/Mail/Gmail/Archive" is a file and tries to insert its contents, which yields an error since it is a file AND a directory. I think gnus-alias should test whether "/home/myname/Mail/Gmail/Archive” is a file BUT NOT a directory, so I’ve amended the relevant part of the function gnus-alias-get-value as follows: at around line 1170 change from this:

     ;; .........................
     ;; FILE
     ((and (> (length element) 0)
           (file-exists-p element))

to this:

     ;; .........................
     ;; FILE
     ((and (> (length element) 0)
           (and (file-exists-p element)
                (not (file-directory-p element))))

Now the extra fcc header works as I think it should. - Geoff Ferrari