ErgoEmacsEmacsLispBlogEmacsLispBuy Tutorial
Web Hosting by 1&1

35.2 Mail Header Fields

A header field in the mail buffer starts with a field name at the beginning of a line, terminated by a colon. Upper and lower case are equivalent in field names (and in mailing addresses also). After the colon and optional whitespace comes the contents of the field.

You can use any name you like for a header field, but normally people use only standard field names with accepted meanings. Here is a table of commonly-used fields. Emacs pre-initializes some of these, depending on various options you can set. You can delete or alter any header field before you send the message, if you wish.

From
The address of the sender (you). This should be a valid mailing address, as replies will normally go there. Emacs initializes this field using the variables user-full-name and user-mail-address; see below.
To
The mailing address(es) to which the message is addressed. To list more than one address, use commas (not spaces) to separate them.
Subject
A piece of text saying what the message is about. Most mail-reading programs can display a summary of messages, listing the subject of each message but not its text.
CC
Additional mailing address(es) to send the message to. This is like ‘To’, except that these readers should not regard the message as directed at them.
BCC
Additional mailing address(es) to send the message to, which should not appear in the header of the message actually sent. “BCC” stands for blind carbon copies.
FCC
The name of one file, to which a copy of the sent message should be appended. Emacs writes the message in mbox format, unless the file is in Babyl format (used by Rmail before Emacs 23), in which case Emacs writes Babyl. If an Rmail buffer is visiting the file, Emacs updates it accordingly. To specify more than one file, use several ‘FCC’ fields, with one file name in each field.
Reply-to
An address to which replies should be sent, instead of ‘From’. You can use this header if, for some reason, your ‘From’ address is unable to receive replies.
Mail-reply-to
This field takes precedence over ‘Reply-to’. It is used because some mailing lists set the ‘Reply-to’ field for their own purposes (a somewhat controversial practice).
Mail-followup-to
This field contains one or more addresses. It is typically used when you reply to a message from a mailing list that you are subscribed to. It usually indicates that you want replies to go to the list, and that you do not need an extra copy sent directly to you.
In-reply-to
A piece of text describing the message you are replying to. Some mail systems can use this information to correlate related pieces of mail. Normally, you never need to think about this, because it is filled in automatically when you reply to a message in Rmail (or any other mail program built into Emacs).
References
The Message-Ids of previous related messages (a Message-Id is a unique identifier generated when a message is sent). Like ‘In-reply-to’, this is normally set up automatically for you.

The ‘To’, ‘CC’, and ‘BCC’ fields can appear any number of times, and each such header field can contain multiple addresses, separated by commas. This way, you can specify any number of places to send the message. These fields can also have continuation lines: one or more lines starting with whitespace, following the starting line of the field, are considered part of the field. Here's an example of a ‘To’ field with a continuation line:

     To: foo@example.net, this@example.net,
       bob@example.com

The default contents of the ‘From’ header field are computed from the variables user-full-name and user-mail-address. On some operating systems, Emacs initializes these two variables using environment variables (see General Variables). If this information is unavailable or wrong, you can customize the variables yourself (see Easy Customization).

The value of the variable mail-from-style specifies how to format the address in the ‘From’ field:

nil
Use just the address, as in ‘king@grassland.com’.
parens
Use both address and full name, as in:
king@grassland.com (Elvis Parsley)’.
angles
Use both address and full name, as in:
Elvis Parsley <king@grassland.com>’.
any other value
Use angles for most addresses. However, if the address must be “quoted” to remain syntactically-valid under the angles format but not under the parens format, use parens instead. This is the default.

You can direct Emacs to insert certain default headers into the mail buffer by setting the variable mail-default-headers to a string. Then C-x m inserts this string into the message headers. For example, here is how to add a ‘Reply-to’ and ‘FCC’ header to each message:

     (setq mail-default-headers
           "Reply-to: foo@example.com\nFCC: ~/Mail/sent")

If the default header fields are not appropriate for a particular message, edit them as necessary before sending the message.

blog comments powered by Disqus