This term is often confused with mung, which probably was derived from it. However, it also appears the word `munge' was in common use in Scotland in the 1940s, and in Yorkshire in the 1950s, as a verb, meaning to munch up into a masticated mess, and as a noun, meaning the result of munging something up (the parallel with the kluge/kludge pair is amusing)." [The Jargon File]
Now covers unmunge Version 0.5. If
you are using version 0.4 see
version 0.4 instructions.
Starting from the assumption that you have little idea what you're doing. Read the emacs manual, or my quick start guide for more info.
load-path). You add new directories to this list with a
command like
(setq load-path (cons load-path "~/lisp")~/.emacs file. This adds a directory
lisp in your home directory to the list.
M-x byte-compile-file
(require 'unmunge-general)~/.gnus.el as my gnus startup file.
~/.gnus also works. Try and only use one at a time,
though.(add-hook 'message-header-setup-hook
'unmunge-address-function).gnus.el.(add-hook 'message-signature-setup-hook
'unmunge-sigfile-function)
.gnus.el file (setq unmunge-default-address
"address1@my.domain")
address1@my.domain with a valid email
address. (Leave the quotes though.) This address will be your
email address whenever unmunge thinks you are posting to
Usenet..gnus.el (setq unmunge-mail-address "address2@my.domain")unmunge thinks you're
sending email correspondence.
(setq my-linux-mail-address "gowen+linux@ma.man.ac.uk")
(setq unmunge-alist
'(("alt.religion.emacs" . unmunge-default-address)
("emacs" . "gowen+emacs@my.domain")
("linux" . my-linux-mail-address)))
When I post to a newsgroup, say, gnu.emacs.misc,
unmunge compares "gnu.emacs.misc" to each of the
first elements in list of pairs, starting with the first
(i.e. "alt.religion.emacs", then "emacs", then "linux").
When it first gets a match (i.e. the list element is contained in
the newsgroup name) unmunge uses the second element
in that pair as the email address.
Note: It was formerly necessary to
specify "^nn" as a regexp in unmunge-alist to catch
mail groups. This is no longer necessary, since unmunge looks for
a ``To:'' line at the beginning of a buffer and chooses between
the mail and newsgroup defaults accordingly.
So, in the case of my example, unmunge would first
compare "gnu.emacs.misc" with "alt.religion.emacs". These don't
match and so it would compare "gnu.emacs.misc"with "emacs". The
word "emacs" is contained "gnu.emacs.misc", so these match and
unmunge will use
"gowen+emacs@my.domain" as my email address for
that posting.
unmunge-addressee-address-alist. This
works in a similar way to unmunge-alist, only it matches using the
email addresses of the recipients. Another sample of code from a
typical .emacs.
(setq unmunge-addressee-address-alist
'(("abuse@" . "gowen+spam@ma.man.ac.uk"))
("postmaster@" . "gowen+spam@ma.man.ac.uk"))
To be honest, I don't find this as useful as the ability to change
signature according to recipient. Your mileage may vary, of
course.
nil for no signature at
all.
The variables are
unmunge-default-sigfile ; For
Usenet
unmunge-mail-sigfile ; For
email
unmunge-sigfile-alist ; For
matching signatures to newsgroup names.
unmunge-addressee-sigfile-alist ; For
matching signatures to recipient email addresses.
See the example below, to see just how similar they are to the email address versions explained above.
.gnus file
would look like if I kept it well commented:-
(setq user-mail-address "gowen@ma.man.ac.uk") ;Used by other programs
(require 'unmunge-general)
; Set the defaults
(setq unmunge-default-address "gowen+usenet@ma.man.ac.uk")
(setq unmunge-mail-address "gowen@ma.man.ac.uk")
(setq unmunge-sigfile-default "~/.signature")
(setq unmunge-sigfile-mail "~/.signature.mail")
; Change email address
(setq unmunge-alist
'(("spam" . "gowen+spam@ma.man.ac.uk")))
; For complaining in my spam mail group
(setq unmunge-addressee-address-alist
'(("abuse@" . "gowen+spam@ma.man.ac.uk"))
("postmaster@" . "gowen+spam@ma.man.ac.uk"))
; For complaining elsewhere
; Set up some apposite signatures
; First for newsgroups and mail ,
(setq unmunge-sigfile-alist
'(("alt.fan.warlord" . nil)
("linux" . "~/.signature.linux") ; linux groups
("vega" . "~/.signature.vega") ; Suzanne Vega mailing list
("emacs" . "~/.signature.emacs"))); Emacs groups (Duh?)
;Then for individual email addresses
(setq unmunge-addressee-sigfile-alist
'(("ero2\\|cooper@biol\\|brian@arq\\|owenk001\\|DaveyOwen" . nil)
; No sigs for friends and family
("@ma.man.ac.uk" . "~/.sigfixed"))) ; People in the department get
; a room/phone number, which
; no one else needs