Message 5.7 Manual. Node: Various Message Variables

PREVNews Variables UPVariables NEXTSending Variables

3.6: Various Message Variables

message-signature-separator

Regexp matching the signature separator. It is `^-- *$' by default.

mail-header-separator

String used to separate the headers from the body. It is `--text follows this line--' by default.

message-directory

Directory used by many mailey things. The default is `~/Mail/'.

message-signature-setup-hook

Hook run when initializing the message buffer. It is run after the headers have been inserted but before the signature has been inserted.

message-setup-hook

Hook run as the last thing when the message buffer has been initialized, but before yanked text is inserted.

message-header-setup-hook

Hook called narrowed to the headers after initializing the headers.

For instance, if you're running Gnus and wish to insert a `Mail-Copies-To' header in all your news articles and all messages you send to mailing lists, you could do something like the following:

(defun my-message-header-setup-hook ()
  (let ((group (or gnus-newsgroup-name "")))
    (when (or (message-fetch-field "newsgroups")
              (gnus-group-find-parameter group 'to-address)
              (gnus-group-find-parameter group 'to-list))
      (insert "Mail-Copies-To: never\n"))))

(add-hook 'message-header-setup-hook
          'my-message-header-setup-hook)
message-send-hook

Hook run before sending messages.

If you want to add certain headers before sending, you can use the message-add-header function in this hook. For instance:

(add-hook 'message-send-hook 'my-message-add-content)
(defun my-message-add-content ()
  (message-add-header
   "Mime-Version: 1.0"
   "Content-Type: text/plain"
   "Content-Transfer-Encoding: 7bit"))

This function won't add the header if the header is already present.

message-send-mail-hook

Hook run before sending mail messages.

message-send-news-hook

Hook run before sending news messages.

message-sent-hook

Hook run after sending messages.

message-mode-syntax-table

Syntax table used in message mode buffers.

message-send-method-alist

Alist of ways to send outgoing messages. Each element has the form

(TYPE PREDICATE FUNCTION)
type

A symbol that names the method.

predicate

A function called without any parameters to determine whether the message is a message of type type.

function

A function to be called if predicate returns non-nil. function is called with one parameter -- the prefix.

((news message-news-p message-send-via-news)
 (mail message-mail-p message-send-via-mail))
PREVNews Variables UPVariables NEXTSending Variables