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


Header lines to be inserted in outgoing messages before you edit the message, so you can edit or delete their lines. If set to a string, it is directly inserted. If set to a function, it is called and its result is inserted.


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

Headers are hidden using narrowing, you can use M-x widen to expose them in the buffer.


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

This document was generated on January 25, 2015 using texi2html 1.82.