[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3. Variables

3.1 Message Headers  General message header stuff.
3.2 Mail Headers  Customizing mail headers.
3.3 Mail Variables  Other mail variables.
3.4 News Headers  Customizing news headers.
3.5 News Variables  Other news variables.
3.6 Various Message Variables  Other message variables.
3.7 Sending Variables  Variables for sending.
3.8 Message Buffers  How Message names its buffers.
3.9 Message Actions  Actions to be performed when exiting.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1 Message Headers

Message is quite aggressive on the message generation front. It has to be -- it's a combined news and mail agent. To be able to send combined messages, it has to generate all headers itself (instead of letting the mail/news system do it) to ensure that mail and news copies of messages look sufficiently similar.

message-generate-headers-first
If non-nil, generate all headers before starting to compose the message.

message-from-style
Specifies how From headers should look. There are four valid values:

nil
Just the address -- `king@grassland.com'.

parens
`king@grassland.com (Elvis Parsley)'.

angles
`Elvis Parsley <king@grassland.com>'.

default
Look like angles if that doesn't require quoting, and parens if it does. If even parens requires quoting, use angles anyway.

message-deletable-headers
Headers in this list that were previously generated by Message will be deleted before posting. Let's say you post an article. Then you decide to post it again to some other group, you naughty boy, so you jump back to the *post-buf* buffer, edit the Newsgroups line, and ship it off again. By default, this variable makes sure that the old generated Message-ID is deleted, and a new one generated. If this isn't done, the entire empire would probably crumble, anarchy would prevail, and cats would start walking on two legs and rule the world. Allegedly.

message-default-headers
This string is inserted at the end of the headers in all message buffers.

message-subject-re-regexp
Responses to messages have subjects that start with `Re: '. This is not an abbreviation of the English word "response", but is Latin, and means "in response to". Some illiterate nincompoops have failed to grasp this fact, and have "internationalized" their software to use abonimations like `Aw: ' ("antwort") or `Sv: ' ("svar") instead, which is meaningless and evil. However, you may have to deal with users that use these evil tools, in which case you may set this variable to a regexp that matches these prefixes. Myself, I just throw away non-compliant mail.

message-alternative-emails
A regexp to match the alternative email addresses. The first matched address (not primary one) is used in the From field.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.2 Mail Headers

message-required-mail-headers
See section 3.4 News Headers, for the syntax of this variable. It is (From Date Subject (optional . In-Reply-To) Message-ID Lines (optional . X-Mailer)) by default.

message-ignored-mail-headers
Regexp of headers to be removed before mailing. The default is `^[GF]cc:\\|^Resent-Fcc:'.

message-default-mail-headers
This string is inserted at the end of the headers in all message buffers that are initialized as mail.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3 Mail Variables

message-send-mail-function
Function used to send the current buffer as mail. The default is message-send-mail-with-sendmail. If you prefer using MH instead, set this variable to message-send-mail-with-mh.

message-mh-deletable-headers
Most versions of MH doesn't like being fed messages that contain the headers in this variable. If this variable is non-nil (which is the default), these headers will be removed before mailing when sending messages via MH. Set it to nil if your MH can handle these headers.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.4 News Headers

message-required-news-headers a list of header symbols. These headers will either be automatically generated, or, if that's impossible, they will be prompted for. The following symbols are valid:

From
This required header will be filled out with the result of the message-make-from function, which depends on the message-from-style, user-full-name, user-mail-address variables.

Subject
This required header will be prompted for if not present already.

Newsgroups
This required header says which newsgroups the article is to be posted to. If it isn't present already, it will be prompted for.

Organization
This optional header will be filled out depending on the message-user-organization variable. message-user-organization-file will be used if this variable is t. This variable can also be a string (in which case this string will be used), or it can be a function (which will be called with no parameters and should return a string to be used).

Lines
This optional header will be computed by Message.

Message-ID
This required header will be generated by Message. A unique ID will be created based on the date, time, user name and system name. Message will use system-name to determine the name of the system. If this isn't a fully qualified domain name (FQDN), Message will use mail-host-address as the FQDN of the machine.

X-Newsreader
This optional header will be filled out according to the message-newsreader local variable.

X-Mailer
This optional header will be filled out according to the message-mailer local variable, unless there already is an X-Newsreader header present.

In-Reply-To
This optional header is filled out using the Date and From header of the article being replied to.

Expires
This extremely optional header will be inserted according to the message-expires variable. It is highly deprecated and shouldn't be used unless you know what you're doing.

Distribution
This optional header is filled out according to the message-distribution-function variable. It is a deprecated and much misunderstood header.

Path
This extremely optional header should probably never be used. However, some very old servers require that this header is present. message-user-path further controls how this Path header is to look. If it is nil, use the server name as the leaf node. If it is a string, use the string. If it is neither a string nor nil, use the user name only. However, it is highly unlikely that you should need to fiddle with this variable at all.

In addition, you can enter conses into this list. The car of this cons should be a symbol. This symbol's name is the name of the header, and the cdr can either be a string to be entered verbatim as the value of this header, or it can be a function to be called. This function should return a string to be inserted. For instance, if you want to insert Mime-Version: 1.0, you should enter (Mime-Version . "1.0") into the list. If you want to insert a funny quote, you could enter something like (X-Yow . yow) into the list. The function yow will then be called without any arguments.

If the list contains a cons where the car of the cons is optional, the cdr of this cons will only be inserted if it is non-nil.

Other variables for customizing outgoing news articles:

message-syntax-checks
Controls what syntax checks should not be performed on outgoing posts. To disable checking of long signatures, for instance, add

 
(signature . disabled)

to this list.

Valid checks are:

subject-cmsg
Check the subject for commands.
sender
Insert a new Sender header if the From header looks odd.
multiple-headers
Check for the existence of multiple equal headers.
sendsys
Check for the existence of version and sendsys commands.
message-id
Check whether the Message-ID looks ok.
from
Check whether the From header seems nice.
long-lines
Check for too long lines.
control-chars
Check for invalid characters.
size
Check for excessive size.
new-text
Check whether there is any new text in the messages.
signature
Check the length of the signature.
approved
Check whether the article has an Approved header, which is something only moderators should include.
empty
Check whether the article is empty.
invisible-text
Check whether there is any invisible text in the buffer.
empty-headers
Check whether any of the headers are empty.
existing-newsgroups
Check whether the newsgroups mentioned in the Newsgroups and Followup-To headers exist.
valid-newsgroups
Check whether the Newsgroups and Followup-to headers are valid syntactically.
repeated-newsgroups
Check whether the Newsgroups and Followup-to headers contains repeated group names.
shorten-followup-to
Check whether to add a Followup-to header to shorten the number of groups to post to.

All these conditions are checked by default.

message-ignored-news-headers
Regexp of headers to be removed before posting. The default is
`^NNTP-Posting-Host:\\|^Xref:\\|^[BGF]cc:\\|^Resent-Fcc:'.

message-default-news-headers
This string is inserted at the end of the headers in all message buffers that are initialized as news.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.5 News Variables

message-send-news-function
Function used to send the current buffer as news. The default is message-send-news.

message-post-method
Gnusish select method (see the Gnus manual for details) used for posting a prepared news message.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.6 Various Message Variables

message-default-charset
Symbol naming a MIME charset. Non-ASCII characters in messages are assumed to be encoded using this charset. The default is nil, which means ask the user. (This variable is used only on non-MULE Emacsen. See section `Charset Translation' in Emacs MIME Manual, for details on the MULE-to-MIME translation process.

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
   "X-In-No-Sense: Nonsense"
   "X-Whatever: no"))

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))


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.7 Sending Variables

message-fcc-handler-function
A function called to save outgoing articles. This function will be called with the name of the file to store the article in. The default function is message-output which saves in Unix mailbox format.

message-courtesy-message
When sending combined messages, this string is inserted at the start of the mailed copy. If the string contains the format spec `%s', the newsgroups the article has been posted to will be inserted there. If this variable is nil, no such courtesy message will be added. The default value is `"The following message is a courtesy copy of an article\nthat has been posted to %s as well.\n\n"'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.8 Message Buffers

Message will generate new buffers with unique buffer names when you request a message buffer. When you send the message, the buffer isn't normally killed off. Its name is changed and a certain number of old message buffers are kept alive.

message-generate-new-buffers
If non-nil, generate new buffers. The default is t. If this is a function, call that function with three parameters: The type, the to address and the group name. (Any of these may be nil.) The function should return the new buffer name.

message-max-buffers
This variable says how many old message buffers to keep. If there are more message buffers than this, the oldest buffer will be killed. The default is 10. If this variable is nil, no old message buffers will ever be killed.

message-send-rename-function
After sending a message, the buffer is renamed from, for instance, `*reply to Lars*' to `*sent reply to Lars*'. If you don't like this, set this variable to a function that renames the buffer in a manner you like. If you don't want to rename the buffer at all, you can say:

 
(setq message-send-rename-function 'ignore)

message-kill-buffer-on-exit
If non-nil, kill the buffer immediately on exit.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.9 Message Actions

When Message is being used from a news/mail reader, the reader is likely to want to perform some task after the message has been sent. Perhaps return to the previous window configuration or mark an article as replied.

The user may exit from the message buffer in various ways. The most common is C-c C-c, which sends the message and exits. Other possibilities are C-c C-s which just sends the message, C-c C-d which postpones the message editing and buries the message buffer, and C-c C-k which kills the message buffer. Each of these actions have lists associated with them that contains actions to be executed: message-send-actions, message-exit-actions, message-postpone-actions, and message-kill-actions.

Message provides a function to interface with these lists: message-add-action. The first parameter is the action to be added, and the rest of the arguments are which lists to add this action to. Here's an example from Gnus:

 
  (message-add-action
   `(set-window-configuration ,(current-window-configuration))
   'exit 'postpone 'kill)

This restores the Gnus window configuration when the message buffer is killed, postponed or exited.

An action can be either: a normal function, or a list where the car is a function and the cdr is the list of arguments, or a form to be evaled.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by James LewisMoss on November, 11 2002 using texi2html