29.10. Sending Replies

Rmail has several commands that use Mail mode to send outgoing mail. Chapitre 28, for information on using Mail mode, including certain features meant to work with Rmail. What this section documents are the special commands of Rmail for entering Mail mode. Note that the usual keys for sending mail--C-x m, C-x 4 m, and C-x 5 m--are available in Rmail mode and work just as they usually do.

m

Send a message (rmail-mail).

c

Continue editing the already started outgoing message (rmail-continue).

r

Send a reply to the current Rmail message (rmail-reply).

f

Forward the current message to other users (rmail-forward).

C-u f

Resend the current message to other users (rmail-resend).

M-m

Try sending a bounced message a second time (rmail-retry-failure).

The most common reason to send a message while in Rmail is to reply to the message you are reading. To do this, type r (rmail-reply). This displays the *mail* buffer in another window, much like C-x 4 m, but preinitializes the Subject, To, CC and In-reply-to header fields based on the message you are replying to. The To field starts out as the address of the person who sent the message you received, and the CC field starts out with all the other recipients of that message.

You can exclude certain recipients from being placed automatically in the CC, using the variable rmail-dont-reply-to-names. Its value should be a regular expression (as a string); any recipient that the regular expression matches, is excluded from the CC field. The default value matches your own name, and any name starting with info-. (Those names are excluded because there is a convention of using them for large mailing lists to broadcast announcements.)

To omit the CC field completely for a particular reply, enter the reply command with a numeric argument: C-u r or 1 r.

Once the *mail* buffer has been initialized, editing and sending the mail goes as usual (Chapitre 28). You can edit the presupplied header fields if they are not right for you. You can also use the commands of Mail mode (Section 28.4), including C-c C-y which yanks in the message that you are replying to. You can switch to the Rmail buffer, select a different message there, switch back, and yank the new current message.

Sometimes a message does not reach its destination. Mailers usually send the failed message back to you, enclosed in a failure message. The Rmail command M-m (rmail-retry-failure) prepares to send the same message a second time: it sets up a *mail* buffer with the same text and header fields as before. If you type C-c C-c right away, you send the message again exactly the same as the first time. Alternatively, you can edit the text or headers and then send it. The variable rmail-retry-ignored-headers, in the same format as rmail-ignored-headers (Section 29.13), controls which headers are stripped from the failed message when retrying it; it defaults to nil.

Another frequent reason to send mail in Rmail is to forward the current message to other users. f (rmail-forward) makes this easy by preinitializing the *mail* buffer with the current message as the text, and a subject designating a forwarded message. All you have to do is fill in the recipients and send. When you forward a message, recipients get a message which is "from" you, and which has the original message in its contents.

Forwarding a message encloses it between two delimiter lines. It also modifies every line that starts with a dash, by inserting - at the start of the line. When you receive a forwarded message, if it contains something besides ordinary text--for example, program source code--you might find it useful to undo that transformation. You can do this by selecting the forwarded message and typing M-x unforward-rmail-message. This command extracts the original forwarded message, deleting the inserted - strings, and inserts it into the Rmail file as a separate message immediately following the current one.

Resending is an alternative similar to forwarding; the difference is that resending sends a message that is "from" the original sender, just as it reached you--with a few added header fields Resent-from and Resent-to to indicate that it came via you. To resend a message in Rmail, use C-u f. (f runs rmail-forward, which is programmed to invoke rmail-resend if you provide a numeric argument.)

The m (rmail-mail) command is used to start editing an outgoing message that is not a reply. It leaves the header fields empty. Its only difference from C-x 4 m is that it makes the Rmail buffer accessible for C-c C-y, just as r does. Thus, m can be used to reply to or forward a message; it can do anything r or f can do.

The c (rmail-continue) command resumes editing the *mail* buffer, to finish editing an outgoing message you were already composing, or to alter a message you have sent.

If you set the variable rmail-mail-new-frame to a non-nil value, then all the Rmail commands to start sending a message create a new frame to edit it in. This frame is deleted when you send the message, or when you use the Don't Send item in the Mail menu.

All the Rmail commands to send a message use the mail-composition method that you have chosen (Section 28.6).