RFC: User-Agent header

Sebastian Spaeth Sebastian at SSpaeth.de
Sun Apr 11 15:12:15 PDT 2010


After some research, this is what I found/propose:

With some simple elisp am I using this User-Agent header now:

  User-Agent: notmuch version 0.1 (Emacs 23.1.1/i486-pc-linux-gnu)

This needs to be done:

1) Add "User-Agent" to the variable "message-required-headers" (it is
(optional . User-Agent) by default in message-mode.

2) Message mode will then insert a User-Agent header and fill it with
the (local) variable "message-newsreader". This is how I set my
message-newsreader now (leading to above string): 

(setq message-newsreader (concat (substring (shell-command-to-string (concat notmuch-command " --version")) 0 -1) " (Emacs " emacs-version "/" system-configuration ")"))

This works fine for composing mails with both "m" (from within notmuch)
and "c-x m" from outside notmuch. It won't work with "r" as message mode
does not seem to be involved in setting up the headers at all then. (So
notmuch-reply.c might just want to also set up the User-Agent header by
default).

sebastian


More information about the notmuch mailing list