1 \input texinfo @c -*-texinfo-*-
3 @setfilename message.info
4 @settitle Message Manual
11 @setchapternewpage odd
15 This file documents Messa, the Emacs message composition mode.
17 Copyright (C) 1996 Free Software Foundation, Inc.
19 Permission is granted to make and distribute verbatim copies of
20 this manual provided the copyright notice and this permission notice
21 are preserved on all copies.
24 Permission is granted to process this file through Tex and print the
25 results, provided the printed document carries copying permission
26 notice identical to this one except for the removal of this paragraph
27 (this paragraph not being relevant to the printed manual).
30 Permission is granted to copy and distribute modified versions of this
31 manual under the conditions for verbatim copying, provided also that the
32 entire resulting derived work is distributed under the terms of a
33 permission notice identical to this one.
35 Permission is granted to copy and distribute translations of this manual
36 into another language, under the above conditions for modified versions.
44 @author by Lars Magne Ingebrigtsen
47 @vskip 0pt plus 1filll
48 Copyright @copyright{} 1996 Free Software Foundation, Inc.
50 Permission is granted to make and distribute verbatim copies of
51 this manual provided the copyright notice and this permission notice
52 are preserved on all copies.
54 Permission is granted to copy and distribute modified versions of this
55 manual under the conditions for verbatim copying, provided that the
56 entire resulting derived work is distributed under the terms of a
57 permission notice identical to this one.
59 Permission is granted to copy and distribute translations of this manual
60 into another language, under the above conditions for modified versions.
70 All message composition (both mail and news) takes place in Message mode
74 * Interface:: Setting up message buffers.
75 * Commands:: Commands you can execute in message mode buffers.
76 * Variables:: Customizing the message buffers.
77 * Index:: Variable, function and concept index.
78 * Key Index:: List of Message mode keys.
85 When a program (or a person) wants to respond to a message -- reply,
86 follow up, forward, cancel -- the program (or person) should just put
87 point in the buffer where the message is and call the required command.
88 @code{Message} will then pop up a new @code{message} mode buffer with
89 appropriate headers filled out, and the user can edit the message before
93 * New Mail Message:: Editing a brand new mail message.
94 * New News Message:: Editing a brand new news message.
95 * Reply:: Replying via mail.
96 * Wide Reply:: Responding to all people via mail.
97 * Followup:: Following up via news.
98 * Canceling News:: Canceling a news article.
99 * Superseding:: Superseding a message.
100 * Forwarding:: Forwarding a message via news or mail.
101 * Resending:: Resending a mail message.
102 * Bouncing:: Bouncing a mail message.
106 @node New Mail Message
107 @section New Mail Message
110 The @code{message-mail} command pops up a new message buffer.
112 Two optional parameters are accepted: The first will be used as the
113 @code{To} header and the second as the @code{Subject} header. If these
114 aren't present, those two headers will be empty.
117 @node New News Message
118 @section New News Message
121 The @code{message-news} command pops up a new message buffer.
123 This function accepts two optional parameters. The first will be used
124 as the @code{Newsgroups} header and the second as the @code{Subject}
125 header. If these aren't present, those two headers will be empty.
131 @findex message-reply
132 The @code{message-reply} function pops up a message buffer that's a
133 reply to the message in the current buffer.
135 @vindex message-reply-to-function
136 Message uses the normal methods to determine where replies are to go,
137 but you can change the behavior to suit your needs by fiddling with the
138 @code{message-reply-to-function} variable.
140 If you want the replies to go to the @code{Sender} instead of the
141 @code{From}, you could do something like this:
144 (setq message-reply-to-function
146 (cond ((equal (mail-fetch-field "from") "somebody")
147 (mail-fetch-field "sender"))
152 This function will be called narrowed to the head of the article that is
155 As you can see, this function should return a string if it has an
156 opinion as to what the To header should be. If it does not, it should
157 just return @code{nil}, and the normal methods for determining the To
160 This function can also return a list. In that case, each list element
161 should be a cons, where the car should be the name of an header
162 (eg. @code{Cc}) and the cdr should be the header value
163 (eg. @samp{larsi@@ifi.uio.no}). All these headers will be inserted into
164 the head of the outgoing mail.
170 @findex message-wide-reply
171 The @code{message-wide-reply} pops up a message buffer that's a wide
172 reply to the message in the current buffer.
174 @vindex message-wide-reply-to-function
175 Message uses the normal methods to determine where wide replies are to go,
176 but you can change the behavior to suit your needs by fiddling with the
177 @code{message-wide-reply-to-function}. It is used in the same way as
178 @code{message-reply-to-function} (@pxref{Reply}).
184 @findex message-followup
185 The @code{message-followup} command pops up a message buffer that's a
186 followup to the message in the current buffer.
188 @vindex message-followup-to-function
189 Message uses the normal methods to determine where followups are to go,
190 but you can change the behavior to suit your needs by fiddling with the
191 @code{message-followup-to-function}. It is used in the same way as
192 @code{message-reply-to-function} (@pxref{Reply}).
194 @vindex message-use-followup-to
195 The @code{message-use-followup-to} variable says what to do about
196 @code{Followup-To} headers. If it is @code{use}, always use the value.
197 If it is @code{ask} (which is the default), ask whether to use the
198 value. If it is @code{t}, use the value unless it is @samp{poster}. If
199 it is @code{nil}, don't use the value.
203 @section Canceling News
205 @findex message-cancel-news
206 The @code{message-cancel-news} command cancels the article in the
213 @findex message-supersede
214 The @code{message-supersede} command pops up a message buffer that will
215 supersede the message in the current buffer.
217 @vindex message-ignored-supersedes-headers
218 Headers matching the @code{message-ignored-supersedes-headers} are
219 removed before popping up the new message buffer. The default is
220 @samp{^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|^Received:\\|^X-From-Line:\\|Return-Path:}.
227 @findex message-forward
228 The @code{message-forward} command pops up a message buffer to forward
229 the message in the current buffer. If given a prefix, forward using
233 @item message-forward-start-separator
234 @vindex message-forward-start-separator
235 Delimiter inserted before forwarded messages. The default is
236 @samp{------- Start of forwarded message -------\n}.
238 @vindex message-forward-end-separator
239 @item message-forward-end-separator
240 @vindex message-forward-end-separator
241 Delimiter inserted after forwarded messages. The default is
242 @samp{------- End of forwarded message -------\n}.
244 @item message-signature-before-forwarded-message
245 @vindex message-signature-before-forwarded-message
246 If this variable is @code{t}, which it is by default, your personal
247 signature will be inserted before the forwarded message. If not, the
248 forwarded message will be inserted first in the new mail.
250 @item message-forward-included-headers
251 @vindex message-forward-included-headers
252 Regexp matching header lines to be included in forwarded messages.
260 @findex message-resend
261 The @code{message-resend} command will prompt the user for an address
262 and resend the message in the current buffer to that address.
264 @vindex message-ignored-resent-headers
265 Headers the match the @code{message-ignored-resent-headers} regexp will
266 be removed before sending the message. The default is
267 @samp{^Return-receipt}.
273 @findex message-bounce
274 The @code{message-bounce} command will, if the current buffer contains a
275 bounced mail message, pop up a message buffer stripped of the bounce
278 @vindex message-ignored-bounced-headers
279 Headers that match the @code{message-ignored-bounced-headers} regexp
280 will be removed before popping up the buffer. The default is
288 * Header Commands:: Commands for moving to headers.
289 * Movement:: Moving around in message buffers.
290 * Insertion:: Inserting things into message buffers.
291 * Various Commands:: Various things.
292 * Sending:: Actually sending the message.
296 @node Header Commands
297 @section Header Commands
299 All these commands move to the header in question. If it doesn't exist,
306 @findex message-goto-to
307 Describe the message mode.
311 @findex message-goto-to
312 Go to the @code{To} header (@code{message-goto-to}).
316 @findex message-goto-bcc
317 Go to the @code{Bcc} header (@code{message-goto-bcc}).
321 @findex message-goto-fcc
322 Go to the @code{Fcc} header (@code{message-goto-fcc}).
326 @findex message-goto-cc
327 Go to the @code{Cc} header (@code{message-goto-cc}).
331 @findex message-goto-subject
332 Go to the @code{Subject} header (@code{message-goto-subject}).
336 @findex message-goto-reply-to
337 Go to the @code{Reply-To} header (@code{message-goto-reply-to}).
341 @findex message-goto-newsgroups
342 Go to the @code{Newsgroups} header (@code{message-goto-newsgroups}).
346 @findex message-goto-distribution
347 Go to the @code{Distribution} header (@code{message-goto-distribution}).
351 @findex message-goto-followup-to
352 Go to the @code{Followup-To} header (@code{message-goto-followup-to}).
356 @findex message-goto-keywords
357 Go to the @code{Keywords} header (@code{message-goto-keywords}).
361 @findex message-goto-summary
362 Go to the @code{Summary} header (@code{message-goto-summary}).
373 @findex message-goto-body
374 Move to the beginning of the body of the message
375 (@code{message-goto-body}).
379 @findex message-goto-signature
380 Move to the signature of the message (@code{message-goto-signature}).
392 @findex message-yank-original
393 Yank the message that's being replied to into the message buffer
394 (@code{message-yank-original}).
398 @findex message-fill-yanked-message
399 Fill the yanked message (@code{message-fill-yanked-message}).
403 @findex message-insert-signature
404 Insert a signature at the end of the buffer
405 (@code{message-insert-signature}).
410 @item message-ignored-cited-headers
411 @vindex message-ignored-cited-headers
412 All headers that match this regexp will be removed from yanked
413 messages. The default is @samp{.}, which means that all headers will be
416 @item message-citation-line-function
417 @vindex message-citation-line-function
418 Function called to insert the citation line. The default is
419 @code{message-insert-citation-line}.
421 @item message-yank-prefix
422 @vindex message-yank-prefix
425 When you are replying to or following up an article, you normally want
426 to quote the person you are answering. Inserting quoted text is done by
427 @dfn{yanking}, and each quoted line you yank will have
428 @code{message-yank-prefix} prepended to it. The default is @samp{> }.
429 If it is @code{nil}, just indent the message.
431 @item message-indentation-spaces
432 @vindex message-indentation-spaces
433 Number of spaces to indent yanked messages.
435 @item message-cite-function
436 @vindex message-cite-function
437 Function for citing an original message. The default is
438 @code{message-cite-original}.
440 @item message-indent-citation-function
441 @vindex message-indent-citation-function
442 Function for modifying a citation just inserted in the mail buffer.
443 This can also be a list of functions. Each function can find the
444 citation between @code{(point)} and @code{(mark t)}. And each function
445 should leave point and mark around the citation text as modified.
447 @item message-signature
448 @vindex message-signature
449 String to be inserted at the end of the message buffer. If @code{t}
450 (which is the default), the @code{message-signature-file} file will be
451 inserted instead. If a function, the result from the function will be
452 used instead. If a form, the result from the form will be used instead.
453 If this variable is @code{nil}, no signature will be inserted at all.
455 @item message-signature-file
456 @vindex message-signature-file
457 File containing the signature to be inserted at the end of the buffer.
458 The default is @samp{~/.signature}.
462 Note that RFC1036 says that a signature should be preceded by the three
463 characters @samp{-- } on a line by themselves. This is to make it
464 easier for the recipient to automatically recognize and process the
465 signature. So don't remove those characters, even though you might feel
466 that they ruin you beautiful design, like, totally.
468 Also note that no signature should be more than four lines long.
469 Including ASCII graphics is an efficient way to get everybody to believe
470 that you are silly and have nothing important to say.
474 @node Various Commands
475 @section Various Commands
481 @findex message-caesar-buffer-body
482 Caesar rotate (aka. rot13) the current message
483 (@code{message-caesar-buffer-body}). If narrowing is in effect, just
484 rotate the visible portion of the buffer. A numerical prefix says how
485 many places to rotate the text. The default is 13.
489 @findex message-insert-to
490 Insert a @code{To} header that contains the @code{Reply-To} or
491 @code{From} header of the message you're following up
492 (@code{message-insert-to}).
496 @findex message-insert-newsgroups
497 Insert a @code{Newsgroups} header that reflects the @code{Followup-To}
498 or @code{Newsgroups} header of the article you're replying to
499 (@code{message-insert-newsgroups}).
503 @findex message-rename-buffer
504 Rename the buffer (@code{message-rename-buffer}). If given a prefix,
505 prompt for a new buffer name.
516 @findex message-send-and-exit
517 Send the message and bury the current buffer
518 (@code{message-send-and-exit}).
523 Send the message (@code{message-send}).
527 @findex message-dont-send
528 Bury the message buffer and exit (@code{message-dont-send}).
532 @findex message-kill-buffer
533 Kill the message buffer and exit (@code{message-kill-buffer}).
542 * Message Headers:: General message header stuff.
543 * Mail Headers:: Customizing mail headers.
544 * Mail Variables:: Other mail variables.
545 * News Headers:: Customizing news headers.
546 * News Variables:: Other news variables.
547 * Various Message Variables:: Other message variables.
548 * Sending Variables:: Variables for sending.
549 * Message Actions:: Actions to be performed when exiting.
553 @node Message Headers
554 @section Message Headers
556 Message is a quite aggressive on the message generation front. It has
557 to be -- it's a combined news and mail agent. To be able to send
558 combined messages, it has to generate all headers itself to ensure that
559 mail and news copies of messages look sufficiently similar.
563 @item message-generate-headers-first
564 @vindex message-generate-headers-first
565 If non-@code{nil}, generate all headers before starting to compose the
568 @item message-from-style
569 @vindex message-from-style
570 Specifies how @code{From} headers should look. There are four legal
575 Just the address -- @samp{king@@grassland.com}.
578 @samp{king@@grassland.com (Elvis Parsley)}.
581 @samp{Elvis Parsley <king@@grassland.com>}.
584 Look like @code{angles} if that doesn't require quoting, and
585 @code{parens} if it does. If even @code{parens} requires quoting, use
586 @code{angles} anyway.
590 @item message-deletable-headers
591 @vindex message-deletable-headers
592 Headers in this list that were previously generated by Message will be
593 deleted before posting. Let's say you post an article. Then you decide
594 to post it again to some other group, you naughty boy, so you jump back
595 to the @code{*post-buf*} buffer, edit the @code{Newsgroups} line, and
596 ship it off again. By default, this variable makes sure that the old
597 generated @code{Message-ID} is deleted, and a new one generated. If
598 this isn't done, the entire empire would probably crumble, anarchy would
599 prevail, and cats would start walking on two legs and rule the world.
602 @item message-default-headers
603 @vindex message-default-headers
604 This string is inserted at the end of the headers in all message
611 @section Mail Headers
614 @item message-required-mail-headers
615 @vindex message-required-mail-headers
616 See @pxref{News Headers} for the syntax of this variable. It is
617 @code{(From Date Subject (optional . In-Reply-To) Message-ID Lines
618 (optional . X-Mailer))} by default.
620 @item message-ignored-mail-headers
621 @vindex message-ignored-mail-headers
622 Regexp of headers to be removed before mailing. The default is
623 @samp{^Gcc:\\|^Fcc:}.
625 @item message-default-mail-headers
626 @vindex message-default-mail-headers
627 This string is inserted at the end of the headers in all message
628 buffers that are initialized as mail.
634 @section Mail Variables
637 @item message-send-mail-function
638 @vindex message-send-mail-function
639 Function used to send the current buffer as mail. The default is
640 @code{message-send-mail-with-sendmail}. If you prefer using MH
641 instead, set this variable to @code{message-send-mail-with-mh}.
647 @section News Headers
649 @vindex message-required-news-headers
650 @code{message-required-news-headers} a list of header symbols. These
651 headers will either be automatically generated, or, if that's
652 impossible, they will be prompted for. The following symbols are legal:
658 This required header will be filled out with the result of the
659 @code{message-make-from} function, which depends on the
660 @code{message-from-style}, @code{user-full-name},
661 @code{user-mail-address} variables.
665 This required header will be prompted for if not present already.
669 This required header says which newsgroups the article is to be posted
670 to. If it isn't present already, it will be prompted for.
674 This optional header will be filled out depending on the
675 @code{message-user-organization} variable.
676 @code{message-user-organization-file} will be used if that variable is
681 This optional header will be computed by Message.
685 This required header will be generated by Message. A unique ID will be
686 created based on date, time, user name and system name.
690 This optional header will be filled out according to the
691 @code{message-newsreader} local variable.
694 This optional header will be filled out according to the
695 @code{message-mailer} local variable, unless there already is an
696 @code{X-Newsreader} header present.
699 This optional header is filled out using the @code{Date} and @code{From}
700 header of the article being replied.
704 This extremely optional header will be inserted according to the
705 @code{message-expires} variable. It is highly deprecated and shouldn't
706 be used unless you know what you're doing.
710 This optional header is filled out according to the
711 @code{message-distribution-function} variable. It is a deprecated and
712 much misunderstood header.
716 This extremely optional header should probably not ever be used.
717 However, some @emph{very} old servers require that this header is
718 present. @code{message-user-path} further controls how this
719 @code{Path} header is to look. If is is @code{nil}, the the server name
720 as the leaf node. If is is a string, use the string. If it is neither
721 a string nor @code{nil}, use the user name only. However, it is highly
722 unlikely that you should need to fiddle with this variable at all.
727 In addition, you can enter conses into this list. The car of this cons
728 should be a symbol. This symbol's name is the name of the header, and
729 the cdr can either be a string to be entered verbatim as the value of
730 this header, or it can be a function to be called. This function should
731 return a string to be inserted. For instance, if you want to insert
732 @code{Mime-Version: 1.0}, you should enter @code{(Mime-Version . "1.0")}
733 into the list. If you want to insert a funny quote, you could enter
734 something like @code{(X-Yow . yow)} into the list. The function
735 @code{yow} will then be called without any arguments.
737 If the list contains a cons where the car of the cons is
738 @code{optional}, the cdr of this cons will only be inserted if it is
741 Other variables for customizing outgoing news articles:
745 @item message-syntax-checks
746 @vindex message-syntax-checks
747 If non-@code{nil}, message will attempt to check the legality of the
748 headers, as well as some other stuff, before posting. You can control
749 the granularity of the check by adding or removing elements from this
750 list. Legal elements are:
754 Check the subject for commands.
757 Insert a new @code{Sender} header if the @code{From} header looks odd.
758 @item multiple-headers
759 Check for the existence of multiple equal headers.
762 Check for the existence of version and sendsys commands.
764 Check whether the @code{Message-ID} looks ok.
766 Check whether the @code{From} header seems nice.
769 Check for too long lines.
771 Check for illegal characters.
773 Check for excessive size.
775 Check whether there is any new text in the messages.
777 Check the length of the signature.
780 Check whether the article has an @code{Approved} header, which is
781 something only moderators should include.
783 Check whether the article is empty.
785 Check whether any of the headers are empty.
786 @item existing-newsgroups
787 Check whether the newsgroups mentioned in the Newsgroups and
788 Followup-To headers exist.
789 @item valid-newsgroups
790 Check whether the @code{Newsgroups} and @code{Followup-To} headers
791 are valid syntactially.
794 All these conditions are checked by default.
796 @item message-ignored-news-headers
797 @vindex message-ignored-news-headers
798 Regexp of headers to be removed before posting. The default is
799 @samp{^NNTP-Posting-Host:\\|^Xref:\\|^Bcc:\\|^Gcc:\\|^Fcc:}.
801 @item message-default-news-headers
802 @vindex message-default-news-headers
803 This string is inserted at the end of the headers in all message
804 buffers that are initialized as news.
810 @section News Variables
813 @item message-send-news-function
814 @vindex message-send-news-function
815 Function used to send the current buffer as news. The default is
816 @code{message-send-news}.
818 @item message-post-method
819 @vindex message-post-method
820 Method used for posting a prepared news message.
825 @node Various Message Variables
826 @section Various Message Variables
829 @item message-signature-separator
830 @vindex message-signature-separator
831 Regexp matching the signature separator. It is @samp{^-- *$} by
834 @item mail-header-separator
835 @vindex mail-header-separator
836 String used to separate the headers from the body. It is @samp{--text
837 follows this line--} by default.
839 @item message-directory
840 @vindex message-directory
841 Directory used by many mailey things. The default is @file{~/Mail/}.
843 @item message-autosave-directory
844 @vindex message-autosave-directory
845 Directory where message buffers will be autosaved to.
847 @item message-setup-hook
848 @vindex message-setup-hook
849 Hook run when the message buffer has been initialized.
851 @item message-header-setup-hook
852 @vindex message-header-setup-hook
853 Hook called narrowed to the headers after initializing the headers.
855 @item message-send-hook
856 @vindex message-send-hook
857 Hook run before sending messages.
859 @item message-sent-hook
860 @vindex message-sent-hook
861 Hook run after sending messages.
863 @item message-mode-syntax-table
864 @vindex message-mode-syntax-table
865 Syntax table used in message mode buffers.
871 @node Sending Variables
872 @section Sending Variables
876 @item message-fcc-handler-function
877 @vindex message-fcc-handler-function
878 A function called to save outgoing articles. This function will be
879 called with the name of the file to store the article in. The default
880 function is @code{rmail-output} which saves in Unix mailbox format.
882 @item message-courtesy-message
883 @vindex message-courtesy-message
884 When sending combined messages, this string is inserted at the start of
885 the mailed copy. If this variable is @code{nil}, no such courtesy
886 message will be added.
891 @node Message Actions
892 @section Message Actions
894 When Message is being used from a news/mail reader, the reader is likely
895 to want to perform some task after the message has been sent. Perhaps
896 return to the previous window configuration or mark an article as
899 @vindex message-kill-actions
900 @vindex message-postpone-actions
901 @vindex message-exit-actions
902 @vindex message-send-actions
903 The user may exit from the message buffer in various ways. The most
904 common is @kbd{C-c C-c}, which sends the message and exits. Other
905 possibilities are @kbd{C-c C-s} which just sends the message, @kbd{C-c
906 C-d} which postpones the message editing and buries the message buffer,
907 and @kbd{C-c C-k} which kills the message buffer. Each of these actions
908 have lists associated with them that contains actions to be executed:
909 @code{message-send-actions}, @code{message-exit-actions},
910 @code{message-postpone-actions}, and @code{message-kill-actions}.
912 Message provides a function to interface with these lists:
913 @code{message-add-action}. The first parameter is the action to be
914 added, and the rest of the arguments are which lists to add this action
915 to. Here's an example from Gnus:
919 `(set-window-configuration ,(current-window-configuration))
920 'exit 'postpone 'kill)
923 This restores the Gnus window configuration when the message buffer is
924 killed, postponed or exited.
926 An @dfn{action} can be either a normal function; or a list where the
927 @code{car} is a function and the @code{cdr} is the list of arguments; or
928 a form to be @code{eval}ed.