[ < ] [ > ]   [ << ] [ 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 Insertion Variables  Customizing how things are inserted.
3.7 Various Message Variables  Other message variables.
3.8 Sending Variables  Variables for sending.
3.9 Message Buffers  How Message names its buffers.
3.10 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.

If t, generate all required headers before starting to compose the message. This can also be a list of headers to generate:

(setq message-generate-headers-first

The variables message-required-headers, message-required-mail-headers and message-required-news-headers specify which headers are required.

Note that some headers will be removed and re-generated before posting, because of the variable message-deletable-headers (see below).

When running Message from Gnus, the message buffers are associated with a draft group. message-draft-headers says which headers should be generated when a draft is written to the draft group.

Specifies how From headers should look. There are four valid values:

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

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

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

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

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.

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

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 abominations 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.

Here's an example of a value to deal with these headers when responding to a message:

(setq message-subject-re-regexp
       "^[ \t]*"
             "[Aa][Nn][Tt][Ww]\\.?\\|"     ; antw
             "[Aa][Ww]\\|"                 ; aw
             "[Ff][Ww][Dd]?\\|"            ; fwd
             "[Oo][Dd][Pp]\\|"             ; odp
             "[Rr][Ee]\\|"                 ; re
             "[Rr][\311\351][Ff]\\.?\\|"   ; ref
             "[Ss][Vv]"                    ; sv
           "*:[ \t]*"
       "*[ \t]*"

Controls what to do with trailing `(was: <old subject>)' in subject lines. If nil, leave the subject unchanged. If it is the symbol ask, query the user what do do. In this case, the subject is matched against message-subject-trailing-was-ask-regexp. If message-subject-trailing-was-query is t, always strip the trailing old subject. In this case, message-subject-trailing-was-regexp is used.

Regexp matching alternative email addresses. The first address in the To, Cc or From headers of the original article matching this variable is used as the From field of outgoing messages, replacing the default From value.

For example, if you have two secondary email addresses john@home.net and john.doe@work.com and want to use them in the From field when composing a reply to a message addressed to one of them, you could set this variable like this:

(setq message-alternative-emails
      (regexp-opt '("john@home.net" "john.doe@work.com")))

This variable has precedence over posting styles and anything that runs off message-setup-hook.

Specifies what to do when there are no recipients other than Gcc or Fcc. If it is always, the posting is allowed. If it is never, the posting is not allowed. If it is ask (the default), you are prompted.

A regexp, a list of regexps, or a list where the first element is not and the rest are regexps. It says which headers to keep hidden when composing a message.

(setq message-hidden-headers
      '(not "From" "Subject" "To" "Cc" "Newsgroups"))

A list of lists of header synonyms. E.g., if this list contains a member list with elements Cc and To, then message-carefully-insert-headers will not insert a To header when the message is already Cced to the recipient.

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

3.2 Mail Headers

See section 3.4 News Headers, for the syntax of this variable. It is (From Subject Date (optional . In-Reply-To) Message-ID (optional . User-Agent)) by default.

Regexp of headers to be removed before mailing. The default is

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

Function used to send the current buffer as mail. The default is message-send-mail-with-sendmail. Other valid values include message-send-mail-with-mh, message-send-mail-with-qmail, message-smtpmail-send-it, smtpmail-send-it and feedmail-send-it.

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.

Location of the qmail-inject program.

Arguments passed to qmail-inject programs. This should be a list of strings, one string for each argument. It may also be a function.

For e.g., if you wish to set the envelope sender address so that bounces go to the right place or to deal with listserv's usage of that address, you might set this variable to '("-f" "you@some.where").

Non-nil means don't add `-f username' to the sendmail command line. Doing so would be even more evil than leaving it out.

When message-sendmail-f-is-evil is nil, this specifies the address to use in the SMTP envelope. If it is nil, use user-mail-address. If it is the symbol header, use the `From' header of the message.

Set this to non-nil if the system's mailer runs the header and body together. (This problem exists on SunOS 4 when sendmail is run in remote mode.) The value should be an expression to test whether the problem will actually occur.

The limitation of messages sent as message/partial. The lower bound of message size in characters, beyond which the message should be sent in several parts. If it is nil, the size is unlimited.

[ < ] [ > ]   [ << ] [ 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:

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.

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

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

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

This optional header will be computed by Message.

This required header will be generated by Message. A unique ID will be created based on the date, time, user name (for the local part) and the domain part. For the domain part, message will look (in this order) at message-user-fqdn, system-name, mail-host-address and message-user-mail-address (i.e. user-mail-address) until a probably valid fully qualified domain name (FQDN) was found.

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

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

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.

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

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.

If you want to delete an entry from this list, the following Lisp snippet might be useful. Adjust accordingly if you want to remove another element.

(setq message-required-news-headers
      (delq 'Message-ID message-required-news-headers))

Other variables for customizing outgoing news articles:

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:

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

All these conditions are checked by default.

Regexp of headers to be removed before posting. The default is

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

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

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

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

3.6 Insertion Variables

All headers that match this regexp will be removed from yanked messages. The default is `.', which means that all headers will be removed.

Regexp matching the longest possible citation prefix on a line.

Function called to insert the citation line. The default is message-insert-citation-line, which will lead to citation lines that look like:

Hallvard B Furuseth <h.b.furuseth@usit.uio.no> writes:

Point will be at the beginning of the body of the message when this function is called.

Note that Gnus provides a feature where clicking on `writes:' hides the cited text. If you change the citation line too much, readers of your messages will have to adjust their Gnus, too. See the variable gnus-cite-attribution-suffix. See section `Article Highlighting' in The Gnus Manual, for details.

When you are replying to or following up an article, you normally want to quote the person you are answering. Inserting quoted text is done by yanking, and each line you yank will have message-yank-prefix prepended to it (except for quoted and empty lines which uses message-yank-cited-prefix). The default is `> '.

When yanking text from an article which contains no text or already cited text, each line will be prefixed with the contents of this variable. The default is `>'. See also message-yank-prefix.

Number of spaces to indent yanked messages.

Function for citing an original message. The default is message-cite-original, which simply inserts the original message and prepends `> ' to each line. message-cite-original-without-signature does the same, but elides the signature. You can also set it to sc-cite-original to use Supercite.

Function for modifying a citation just inserted in the mail buffer. This can also be a list of functions. Each function can find the citation between (point) and (mark t). And each function should leave point and mark around the citation text as modified.

String to mark the beginning of some inserted text.

String to mark the end of some inserted text.

String to be inserted at the end of the message buffer. If t (which is the default), the message-signature-file file will be inserted instead. If a function, the result from the function will be used instead. If a form, the result from the form will be used instead. If this variable is nil, no signature will be inserted at all.

File containing the signature to be inserted at the end of the buffer. The default is `~/.signature'.

If t (the default value) an empty line is inserted before the signature separator.

Note that RFC1036bis says that a signature should be preceded by the three characters `-- ' on a line by themselves. This is to make it easier for the recipient to automatically recognize and process the signature. So don't remove those characters, even though you might feel that they ruin your beautiful design, like, totally.

Also note that no signature should be more than four lines long. Including ASCII graphics is an efficient way to get everybody to believe that you are silly and have nothing important to say.

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

3.7 Various Message Variables

Symbol naming a MIME charset. Non-ASCII characters in messages are assumed to be encoded using this charset. The default is iso-8859-1 on non-MULE Emacsen; otherwise 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.

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

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

Directory used by many mailey things. The default is `~/Mail/'. All other mail file variables are derived from message-directory.

Directory where Message auto-saves buffers if Gnus isn't running. If nil, Message won't auto-save. The default is `~/Mail/drafts/'.

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

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

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

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")
  (message-add-header "X-Whatever: no"))

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

Hook run before sending mail messages. This hook is run very late -- just before the message is actually sent as mail.

Hook run before sending news messages. This hook is run very late -- just before the message is actually sent as news.

Hook run after sending messages.

Hook run when canceling news articles.

Syntax table used in message mode buffers.

Emacs has a number of special text properties which can break message composing in various ways. If this option is set, message will strip these properties from the message composition buffer. However, some packages requires these properties to be present in order to work. If you use one of these packages, turn this option off, and hope the message composition doesn't break too bad.

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

(type predicate function)

A symbol that names the method.

A function called without any parameters to determine whether the message is a message of type type. The function will be called in the buffer where the message is.

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

The default is:

((news message-news-p message-send-via-news)
 (mail message-mail-p message-send-via-mail))

The message-news-p function returns non-nil if the message looks like news, and the message-send-via-news function sends the message according to the message-send-news-function variable (see section 3.5 News Variables). The message-mail-p function returns non-nil if the message looks like mail, and the message-send-via-mail function sends the message according to the message-send-mail-function variable (see section 3.3 Mail Variables).

All the elements in this alist will be tried in order, so a message containing both a valid `Newsgroups' header and a valid `To' header, for example, will be sent as news, and then as mail.

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

3.8 Sending Variables

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.

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"'.

If nil, attach files as normal parts in Fcc copies; if it is non-nil, attach local files as external parts.

If non-nil wait for and display errors when sending a message; if nil let the mailer mail back a message to report errors.

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

3.9 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.

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.

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.

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)

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

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

3.10 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:

   `(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 XEmacs Webmaster on October, 2 2007 using texi2html