* message.el (message-setup-1): Don't bind the constant -forbidden-properties.
[gnus] / texi / message.texi
1 \input texinfo                  @c -*-texinfo-*-
2
3 @setfilename message
4 @settitle Message Manual
5 @synindex fn cp
6 @synindex vr cp
7 @synindex pg cp
8 @copying
9 This file documents Message, the Emacs message composition mode.
10
11 Copyright @copyright{} 1996-2011 Free Software Foundation, Inc.
12
13 @quotation
14 Permission is granted to copy, distribute and/or modify this document
15 under the terms of the GNU Free Documentation License, Version 1.3 or
16 any later version published by the Free Software Foundation; with no
17 Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
18 and with the Back-Cover Texts as in (a) below.  A copy of the license
19 is included in the section entitled ``GNU Free Documentation License''.
20
21 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
22 modify this GNU manual.  Buying copies from the FSF supports it in
23 developing GNU and promoting software freedom.''
24 @end quotation
25 @end copying
26
27 @dircategory Emacs
28 @direntry
29 * Message: (message).           Mail and news composition mode that
30                                   goes with Gnus.
31 @end direntry
32 @iftex
33 @finalout
34 @end iftex
35
36 @titlepage
37 @title Message Manual
38
39 @author by Lars Magne Ingebrigtsen
40 @page
41
42 @vskip 0pt plus 1filll
43 @insertcopying
44 @end titlepage
45
46 @summarycontents
47 @contents
48
49 @node Top
50 @top Message
51
52 @ifnottex
53 @insertcopying
54 @end ifnottex
55
56 All message composition from Gnus (both mail and news) takes place in
57 Message mode buffers.
58
59 @menu
60 * Interface::         Setting up message buffers.
61 * Commands::          Commands you can execute in message mode buffers.
62 * Variables::         Customizing the message buffers.
63 * Compatibility::     Making Message backwards compatible.
64 * Appendices::        More technical things.
65 * GNU Free Documentation License:: The license for this documentation.
66 * Index::             Variable, function and concept index.
67 * Key Index::         List of Message mode keys.
68 @end menu
69
70 @c Adjust ../Makefile.in if you change the following lines:
71 Message is distributed with Gnus.  The Gnus distribution
72 @c
73 corresponding to this manual is No Gnus v0.11.
74
75
76 @node Interface
77 @chapter Interface
78
79 When a program (or a person) wants to respond to a message---reply,
80 follow up, forward, cancel---the program (or person) should just put
81 point in the buffer where the message is and call the required command.
82 @code{Message} will then pop up a new @code{message} mode buffer with
83 appropriate headers filled out, and the user can edit the message before
84 sending it.
85
86 @menu
87 * New Mail Message::     Editing a brand new mail message.
88 * New News Message::     Editing a brand new news message.
89 * Reply::                Replying via mail.
90 * Wide Reply::           Responding to all people via mail.
91 * Followup::             Following up via news.
92 * Canceling News::       Canceling a news article.
93 * Superseding::          Superseding a message.
94 * Forwarding::           Forwarding a message via news or mail.
95 * Resending::            Resending a mail message.
96 * Bouncing::             Bouncing a mail message.
97 * Mailing Lists::        Send mail to mailing lists.
98 @end menu
99
100 You can customize the Message Mode tool bar, see @kbd{M-x
101 customize-apropos RET message-tool-bar}.  This feature is only available
102 in Emacs.
103
104 @node New Mail Message
105 @section New Mail Message
106
107 @findex message-mail
108 The @code{message-mail} command pops up a new message buffer.
109
110 Two optional parameters are accepted: The first will be used as the
111 @code{To} header and the second as the @code{Subject} header.  If these
112 are @code{nil}, those two headers will be empty.
113
114
115 @node New News Message
116 @section New News Message
117
118 @findex message-news
119 The @code{message-news} command pops up a new message buffer.
120
121 This function accepts two optional parameters.  The first will be used
122 as the @code{Newsgroups} header and the second as the @code{Subject}
123 header.  If these are @code{nil}, those two headers will be empty.
124
125
126 @node Reply
127 @section Reply
128
129 @findex message-reply
130 The @code{message-reply} function pops up a message buffer that's a
131 reply to the message in the current buffer.
132
133 @vindex message-reply-to-function
134 Message uses the normal methods to determine where replies are to go
135 (@pxref{Responses}), but you can change the behavior to suit your needs
136 by fiddling with the @code{message-reply-to-function} variable.
137
138 If you want the replies to go to the @code{Sender} instead of the
139 @code{From}, you could do something like this:
140
141 @lisp
142 (setq message-reply-to-function
143       (lambda ()
144        (cond ((equal (mail-fetch-field "from") "somebody")
145                (list (cons 'To (mail-fetch-field "sender"))))
146              (t
147               nil))))
148 @end lisp
149
150 This function will be called narrowed to the head of the article that is
151 being replied to.
152
153 As you can see, this function should return a list.  In this case, it
154 returns @code{((To . "Whom"))} if it has an opinion as to what the To
155 header should be.  If it does not, it should just return @code{nil}, and
156 the normal methods for determining the To header will be used.
157
158 Each list element should be a cons, where the @sc{car} should be the
159 name of a header (e.g. @code{Cc}) and the @sc{cdr} should be the header
160 value (e.g. @samp{larsi@@ifi.uio.no}).  All these headers will be
161 inserted into the head of the outgoing mail.
162
163
164 @node Wide Reply
165 @section Wide Reply
166
167 @findex message-wide-reply
168 The @code{message-wide-reply} pops up a message buffer that's a wide
169 reply to the message in the current buffer.  A @dfn{wide reply} is a
170 reply that goes out to all people listed in the @code{To}, @code{From}
171 (or @code{Reply-to}) and @code{Cc} headers.
172
173 @vindex message-wide-reply-to-function
174 Message uses the normal methods to determine where wide replies are to go,
175 but you can change the behavior to suit your needs by fiddling with the
176 @code{message-wide-reply-to-function}.  It is used in the same way as
177 @code{message-reply-to-function} (@pxref{Reply}).
178
179 @vindex message-dont-reply-to-names
180 Addresses that match the @code{message-dont-reply-to-names} regular
181 expression (or list of regular expressions) will be removed from the
182 @code{Cc} header. A value of @code{nil} means exclude your name only.
183
184 @vindex message-prune-recipient-rules
185 @code{message-prune-recipient-rules} is used to prune the addresses
186 used when doing a wide reply.  It's meant to be used to remove
187 duplicate addresses and the like.  It's a list of lists, where the
188 first element is a regexp to match the address to trigger the rule,
189 and the second is a regexp that will be expanded based on the first,
190 to match addresses to be pruned.
191
192 It's complicated to explain, but it's easy to use.
193
194 For instance, if you get an email from @samp{foo@@example.org}, but
195 @samp{foo@@zot.example.org} is also in the @code{Cc} list, then your
196 wide reply will go out to both these addresses, since they are unique.
197
198 To avoid this, do something like the following:
199
200 @lisp
201 (setq message-prune-recipient-rules
202       '(("^\\([^@@]+\\)@@\\(.*\\)" "\\1@@.*[.]\\2")))
203 @end lisp
204
205 If, for instance, you want all wide replies that involve messages from
206 @samp{cvs@@example.org} to go to that address, and nowhere else (i.e.,
207 remove all other recipients if @samp{cvs@@example.org} is in the
208 recipient list:
209
210 @lisp
211 (setq message-prune-recipient-rules
212       '(("cvs@@example.org" ".")))
213 @end lisp
214
215 @vindex message-wide-reply-confirm-recipients
216 If @code{message-wide-reply-confirm-recipients} is non-@code{nil} you
217 will be asked to confirm that you want to reply to multiple
218 recipients.  The default is @code{nil}.
219
220 @node Followup
221 @section Followup
222
223 @findex message-followup
224 The @code{message-followup} command pops up a message buffer that's a
225 followup to the message in the current buffer.
226
227 @vindex message-followup-to-function
228 Message uses the normal methods to determine where followups are to go,
229 but you can change the behavior to suit your needs by fiddling with the
230 @code{message-followup-to-function}.  It is used in the same way as
231 @code{message-reply-to-function} (@pxref{Reply}).
232
233 @vindex message-use-followup-to
234 The @code{message-use-followup-to} variable says what to do about
235 @code{Followup-To} headers.  If it is @code{use}, always use the value.
236 If it is @code{ask} (which is the default), ask whether to use the
237 value.  If it is @code{t}, use the value unless it is @samp{poster}.  If
238 it is @code{nil}, don't use the value.
239
240
241 @node Canceling News
242 @section Canceling News
243
244 @findex message-cancel-news
245 The @code{message-cancel-news} command cancels the article in the
246 current buffer.
247
248 @vindex message-cancel-message
249 The value of @code{message-cancel-message} is inserted in the body of
250 the cancel message.  The default is @samp{I am canceling my own
251 article.}.
252
253 @cindex Cancel Locks
254 @vindex message-insert-canlock
255 @cindex canlock
256 When Message posts news messages, it inserts @code{Cancel-Lock}
257 headers by default.  This is a cryptographic header that ensures that
258 only you can cancel your own messages, which is nice.  The downside
259 is that if you lose your @file{.emacs} file (which is where Gnus
260 stores the secret cancel lock password (which is generated
261 automatically the first time you use this feature)), you won't be
262 able to cancel your message.  If you want to manage a password yourself,
263 you can put something like the following in your @file{~/.gnus.el} file:
264
265 @lisp
266 (setq canlock-password "geheimnis"
267       canlock-password-for-verify canlock-password)
268 @end lisp
269
270 Whether to insert the header or not is controlled by the
271 @code{message-insert-canlock} variable.
272
273 Not many news servers respect the @code{Cancel-Lock} header yet, but
274 this is expected to change in the future.
275
276
277 @node Superseding
278 @section Superseding
279
280 @findex message-supersede
281 The @code{message-supersede} command pops up a message buffer that will
282 supersede the message in the current buffer.
283
284 @vindex message-ignored-supersedes-headers
285 Headers matching the @code{message-ignored-supersedes-headers} are
286 removed before popping up the new message buffer.  The default is@*
287 @samp{^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|@*
288 ^Received:\\|^X-From-Line:\\|^X-Trace:\\|^X-Complaints-To:\\|@*
289 Return-Path:\\|^Supersedes:\\|^NNTP-Posting-Date:\\|^X-Trace:\\|@*
290 ^X-Complaints-To:\\|^Cancel-Lock:\\|^Cancel-Key:\\|^X-Hashcash:\\|@*
291 ^X-Payment:\\|^Approved:}.
292
293
294
295 @node Forwarding
296 @section Forwarding
297
298 @findex message-forward
299 The @code{message-forward} command pops up a message buffer to forward
300 the message in the current buffer.  If given a prefix, forward using
301 news.
302
303 @table @code
304 @item message-forward-ignored-headers
305 @vindex message-forward-ignored-headers
306 All headers that match this regexp will be deleted when forwarding a message.
307
308 @item message-make-forward-subject-function
309 @vindex message-make-forward-subject-function
310 A list of functions that are called to generate a subject header for
311 forwarded messages.  The subject generated by the previous function is
312 passed into each successive function.
313
314 The provided functions are:
315
316 @table @code
317 @item message-forward-subject-author-subject
318 @findex message-forward-subject-author-subject
319 Source of article (author or newsgroup), in brackets followed by the
320 subject.
321
322 @item message-forward-subject-fwd
323 Subject of article with @samp{Fwd:} prepended to it.
324 @end table
325
326 @item message-wash-forwarded-subjects
327 @vindex message-wash-forwarded-subjects
328 If this variable is @code{t}, the subjects of forwarded messages have
329 the evidence of previous forwards (such as @samp{Fwd:}, @samp{Re:},
330 @samp{(fwd)}) removed before the new subject is
331 constructed.  The default value is @code{nil}.
332
333 @item message-forward-as-mime
334 @vindex message-forward-as-mime
335 If this variable is @code{t} (the default), forwarded messages are
336 included as inline @acronym{MIME} RFC822 parts.  If it's @code{nil}, forwarded
337 messages will just be copied inline to the new message, like previous,
338 non @acronym{MIME}-savvy versions of Gnus would do.
339
340 @item message-forward-before-signature
341 @vindex message-forward-before-signature
342 If non-@code{nil}, put forwarded message before signature, else after.
343
344 @end table
345
346
347 @node Resending
348 @section Resending
349
350 @findex message-resend
351 The @code{message-resend} command will prompt the user for an address
352 and resend the message in the current buffer to that address.
353
354 @vindex message-ignored-resent-headers
355 Headers that match the @code{message-ignored-resent-headers} regexp will
356 be removed before sending the message.
357
358
359 @node Bouncing
360 @section Bouncing
361
362 @findex message-bounce
363 The @code{message-bounce} command will, if the current buffer contains a
364 bounced mail message, pop up a message buffer stripped of the bounce
365 information.  A @dfn{bounced message} is typically a mail you've sent
366 out that has been returned by some @code{mailer-daemon} as
367 undeliverable.
368
369 @vindex message-ignored-bounced-headers
370 Headers that match the @code{message-ignored-bounced-headers} regexp
371 will be removed before popping up the buffer.  The default is
372 @samp{^\\(Received\\|Return-Path\\|Delivered-To\\):}.
373
374
375 @node Mailing Lists
376 @section Mailing Lists
377
378 @cindex Mail-Followup-To
379 Sometimes while posting to mailing lists, the poster needs to direct
380 followups to the post to specific places.  The Mail-Followup-To (MFT)
381 was created to enable just this.  Three example scenarios where this is
382 useful:
383
384 @itemize @bullet
385 @item
386 A mailing list poster can use MFT to express that responses should be
387 sent to just the list, and not the poster as well.  This will happen
388 if the poster is already subscribed to the list.
389
390 @item
391 A mailing list poster can use MFT to express that responses should be
392 sent to the list and the poster as well.  This will happen if the poster
393 is not subscribed to the list.
394
395 @item
396 If a message is posted to several mailing lists, MFT may also be used
397 to direct the following discussion to one list only, because
398 discussions that are spread over several lists tend to be fragmented
399 and very difficult to follow.
400
401 @end itemize
402
403 Gnus honors the MFT header in other's messages (i.e. while following
404 up to someone else's post) and also provides support for generating
405 sensible MFT headers for outgoing messages as well.
406
407 @c @menu
408 @c * Honoring an MFT post::        What to do when one already exists
409 @c * Composing with a MFT header:: Creating one from scratch.
410 @c @end menu
411
412 @c @node Composing with a MFT header
413 @subsection  Composing a correct MFT header automagically
414
415 The first step in getting Gnus to automagically generate a MFT header
416 in posts you make is to give Gnus a list of the mailing lists
417 addresses you are subscribed to.  You can do this in more than one
418 way.  The following variables would come in handy.
419
420 @table @code
421
422 @vindex message-subscribed-addresses
423 @item message-subscribed-addresses
424 This should be a list of addresses the user is subscribed to.  Its
425 default value is @code{nil}.  Example:
426 @lisp
427 (setq message-subscribed-addresses
428       '("ding@@gnus.org" "bing@@noose.org"))
429 @end lisp
430
431 @vindex message-subscribed-regexps
432 @item message-subscribed-regexps
433 This should be a list of regexps denoting the addresses of mailing
434 lists subscribed to.  Default value is @code{nil}.  Example: If you
435 want to achieve the same result as above:
436 @lisp
437 (setq message-subscribed-regexps
438       '("\\(ding@@gnus\\)\\|\\(bing@@noose\\)\\.org")
439 @end lisp
440
441 @vindex message-subscribed-address-functions
442 @item message-subscribed-address-functions
443 This can be a list of functions to be called (one at a time!!) to
444 determine the value of MFT headers.  It is advisable that these
445 functions not take any arguments.  Default value is @code{nil}.
446
447 There is a pre-defined function in Gnus that is a good candidate for
448 this variable.  @code{gnus-find-subscribed-addresses} is a function
449 that returns a list of addresses corresponding to the groups that have
450 the @code{subscribed} (@pxref{Group Parameters, ,Group Parameters,
451 gnus, The Gnus Manual}) group parameter set to a non-@code{nil} value.
452 This is how you would do it.
453
454 @lisp
455 (setq message-subscribed-address-functions
456       '(gnus-find-subscribed-addresses))
457 @end lisp
458
459 @vindex message-subscribed-address-file
460 @item message-subscribed-address-file
461 You might be one organized human freak and have a list of addresses of
462 all subscribed mailing lists in a separate file!  Then you can just
463 set this variable to the name of the file and life would be good.
464
465 @end table
466
467 You can use one or more of the above variables.  All their values are
468 ``added'' in some way that works :-)
469
470 Now you are all set.  Just start composing a message as you normally do.
471 And just send it; as always.  Just before the message is sent out, Gnus'
472 MFT generation thingy kicks in and checks if the message already has a
473 MFT field.  If there is one, it is left alone.  (Except if it's empty -
474 in that case, the field is removed and is not replaced with an
475 automatically generated one.  This lets you disable MFT generation on a
476 per-message basis.)  If there is none, then the list of recipient
477 addresses (in the To: and Cc: headers) is checked to see if one of them
478 is a list address you are subscribed to.  If none of them is a list
479 address, then no MFT is generated; otherwise, a MFT is added to the
480 other headers and set to the value of all addresses in To: and Cc:
481
482 @kindex C-c C-f C-a
483 @findex message-generate-unsubscribed-mail-followup-to
484 @kindex C-c C-f C-m
485 @findex message-goto-mail-followup-to
486 Hm.  ``So'', you ask, ``what if I send an email to a list I am not
487 subscribed to?  I want my MFT to say that I want an extra copy.''  (This
488 is supposed to be interpreted by others the same way as if there were no
489 MFT, but you can use an explicit MFT to override someone else's
490 to-address group parameter.)  The function
491 @code{message-generate-unsubscribed-mail-followup-to} might come in
492 handy.  It is bound to @kbd{C-c C-f C-a} by default.  In any case, you
493 can insert a MFT of your own choice; @kbd{C-c C-f C-m}
494 (@code{message-goto-mail-followup-to}) will help you get started.
495
496 @c @node Honoring an MFT post
497 @subsection Honoring an MFT post
498
499 @vindex message-use-mail-followup-to
500 When you followup to a post on a mailing list, and the post has a MFT
501 header, Gnus' action will depend on the value of the variable
502 @code{message-use-mail-followup-to}.  This variable can be one of:
503
504 @table @code
505 @item use
506  Always honor MFTs.  The To: and Cc: headers in your followup will be
507  derived from the MFT header of the original post.  This is the default.
508
509 @item nil
510  Always dishonor MFTs (just ignore the darned thing)
511
512 @item ask
513 Gnus will prompt you for an action.
514
515 @end table
516
517 It is considered good netiquette to honor MFT, as it is assumed the
518 fellow who posted a message knows where the followups need to go
519 better than you do.
520
521 @node Commands
522 @chapter Commands
523
524 @menu
525 * Buffer Entry::        Commands after entering a Message buffer.
526 * Header Commands::     Commands for moving headers or changing headers.
527 * Movement::            Moving around in message buffers.
528 * Insertion::           Inserting things into message buffers.
529 * MIME::                @acronym{MIME} considerations.
530 * IDNA::                Non-@acronym{ASCII} domain name considerations.
531 * Security::            Signing and encrypting messages.
532 * Various Commands::    Various things.
533 * Sending::             Actually sending the message.
534 * Mail Aliases::        How to use mail aliases.
535 * Spelling::            Having Emacs check your spelling.
536 @end menu
537
538
539 @node Buffer Entry
540 @section Buffer Entry
541 @cindex undo
542 @kindex C-_
543
544 You most often end up in a Message buffer when responding to some other
545 message of some sort.  Message does lots of handling of quoted text, and
546 may remove signatures, reformat the text, or the like---depending on
547 which used settings you're using.  Message usually gets things right,
548 but sometimes it stumbles.  To help the user unwind these stumblings,
549 Message sets the undo boundary before each major automatic action it
550 takes.  If you press the undo key (usually located at @kbd{C-_}) a few
551 times, you will get back the un-edited message you're responding to.
552
553
554 @node Header Commands
555 @section Header Commands
556
557 @subsection Commands for moving to headers
558
559 These following commands move to the header in question.  If it doesn't
560 exist, it will be inserted.
561
562 @table @kbd
563
564 @item C-c ?
565 @kindex C-c ?
566 @findex describe-mode
567 Describe the message mode.
568
569 @item C-c C-f C-t
570 @kindex C-c C-f C-t
571 @findex message-goto-to
572 Go to the @code{To} header (@code{message-goto-to}).
573
574 @item C-c C-f C-o
575 @kindex C-c C-f C-o
576 @findex message-goto-from
577 Go to the @code{From} header (@code{message-goto-from}).  (The ``o''
578 in the key binding is for Originator.)
579
580 @item C-c C-f C-b
581 @kindex C-c C-f C-b
582 @findex message-goto-bcc
583 Go to the @code{Bcc} header (@code{message-goto-bcc}).
584
585 @item C-c C-f C-w
586 @kindex C-c C-f C-w
587 @findex message-goto-fcc
588 Go to the @code{Fcc} header (@code{message-goto-fcc}).
589
590 @item C-c C-f C-c
591 @kindex C-c C-f C-c
592 @findex message-goto-cc
593 Go to the @code{Cc} header (@code{message-goto-cc}).
594
595 @item C-c C-f C-s
596 @kindex C-c C-f C-s
597 @findex message-goto-subject
598 Go to the @code{Subject} header (@code{message-goto-subject}).
599
600 @item C-c C-f C-r
601 @kindex C-c C-f C-r
602 @findex message-goto-reply-to
603 Go to the @code{Reply-To} header (@code{message-goto-reply-to}).
604
605 @item C-c C-f C-n
606 @kindex C-c C-f C-n
607 @findex message-goto-newsgroups
608 Go to the @code{Newsgroups} header (@code{message-goto-newsgroups}).
609
610 @item C-c C-f C-d
611 @kindex C-c C-f C-d
612 @findex message-goto-distribution
613 Go to the @code{Distribution} header (@code{message-goto-distribution}).
614
615 @item C-c C-f C-f
616 @kindex C-c C-f C-f
617 @findex message-goto-followup-to
618 Go to the @code{Followup-To} header (@code{message-goto-followup-to}).
619
620 @item C-c C-f C-k
621 @kindex C-c C-f C-k
622 @findex message-goto-keywords
623 Go to the @code{Keywords} header (@code{message-goto-keywords}).
624
625 @item C-c C-f C-u
626 @kindex C-c C-f C-u
627 @findex message-goto-summary
628 Go to the @code{Summary} header (@code{message-goto-summary}).
629
630 @item C-c C-f C-i
631 @kindex C-c C-f C-i
632 @findex message-insert-or-toggle-importance
633 This inserts the @samp{Importance:} header with a value of
634 @samp{high}.  This header is used to signal the importance of the
635 message to the receiver.  If the header is already present in the
636 buffer, it cycles between the three valid values according to RFC
637 1376: @samp{low}, @samp{normal} and @samp{high}.
638
639 @item C-c C-f C-a
640 @kindex C-c C-f C-a
641 @findex message-generate-unsubscribed-mail-followup-to
642 Insert a reasonable @samp{Mail-Followup-To:} header
643 (@pxref{Mailing Lists}) in a post to an
644 unsubscribed list.  When making original posts to a mailing list you are
645 not subscribed to, you have to type in a @samp{Mail-Followup-To:} header
646 by hand.  The contents, usually, are the addresses of the list and your
647 own address.  This function inserts such a header automatically.  It
648 fetches the contents of the @samp{To:} header in the current mail
649 buffer, and appends the current @code{user-mail-address}.
650
651 If the optional argument @code{include-cc} is non-@code{nil}, the
652 addresses in the @samp{Cc:} header are also put into the
653 @samp{Mail-Followup-To:} header.
654
655 @end table
656
657 @subsection  Commands to change headers
658
659 @table @kbd
660
661 @item C-c C-o
662 @kindex C-c C-o
663 @findex message-sort-headers
664 @vindex message-header-format-alist
665 Sort headers according to @code{message-header-format-alist}
666 (@code{message-sort-headers}).
667
668 @item C-c C-t
669 @kindex C-c C-t
670 @findex message-insert-to
671 Insert a @code{To} header that contains the @code{Reply-To} or
672 @code{From} header of the message you're following up
673 (@code{message-insert-to}).
674
675 @item C-c C-n
676 @kindex C-c C-n
677 @findex message-insert-newsgroups
678 Insert a @code{Newsgroups} header that reflects the @code{Followup-To}
679 or @code{Newsgroups} header of the article you're replying to
680 (@code{message-insert-newsgroups}).
681
682 @item C-c C-l
683 @kindex C-c C-l
684 @findex message-to-list-only
685 Send a message to the list only.  Remove all addresses but the list
686 address from @code{To:} and @code{Cc:} headers.
687
688 @item C-c M-n
689 @kindex C-c M-n
690 @findex message-insert-disposition-notification-to
691 Insert a request for a disposition
692 notification.  (@code{message-insert-disposition-notification-to}).
693 This means that if the recipient supports RFC 2298 she might send you a
694 notification that she received the message.
695
696 @item M-x message-insert-importance-high
697 @kindex M-x message-insert-importance-high
698 @findex message-insert-importance-high
699 @cindex Importance
700 Insert an @samp{Importance} header with a value of @samp{high},
701 deleting headers if necessary.
702
703 @item M-x message-insert-importance-low
704 @kindex M-x message-insert-importance-low
705 @findex message-insert-importance-low
706 @cindex Importance
707 Insert an @samp{Importance} header with a value of @samp{low}, deleting
708 headers if necessary.
709
710 @item C-c C-f s
711 @kindex C-c C-f s
712 @findex message-change-subject
713 @cindex Subject
714 Change the current @samp{Subject} header.  Ask for new @samp{Subject}
715 header and append @samp{(was: <Old Subject>)}.  The old subject can be
716 stripped on replying, see @code{message-subject-trailing-was-query}
717 (@pxref{Message Headers}).
718
719 @item C-c C-f x
720 @kindex C-c C-f x
721 @findex message-cross-post-followup-to
722 @vindex message-cross-post-default
723 @vindex message-cross-post-note-function
724 @cindex X-Post
725 @cindex cross-post
726 Set up the @samp{FollowUp-To} header with a target newsgroup for a
727 cross-post, add that target newsgroup to the @samp{Newsgroups} header if
728 it is not a member of @samp{Newsgroups}, and insert a note in the body.
729 If @code{message-cross-post-default} is @code{nil} or if this command is
730 called with a prefix-argument, only the @samp{FollowUp-To} header will
731 be set but the target newsgroup will not be added to the
732 @samp{Newsgroups} header.  The function to insert a note is controlled
733 by the @code{message-cross-post-note-function} variable.
734
735 @item C-c C-f t
736 @kindex C-c C-f t
737 @findex message-reduce-to-to-cc
738 Replace contents of @samp{To} header with contents of @samp{Cc} or
739 @samp{Bcc} header.  (Iff @samp{Cc} header is not present, @samp{Bcc}
740 header will be used instead.)
741
742 @item C-c C-f w
743 @kindex C-c C-f w
744 @findex message-insert-wide-reply
745 Insert @samp{To} and @samp{Cc} headers as if you were doing a wide
746 reply even if the message was not made for a wide reply first.
747
748 @item C-c C-f a
749 @kindex C-c C-f a
750 @findex message-add-archive-header
751 @vindex message-archive-header
752 @vindex message-archive-note
753 @cindex X-No-Archive
754 Insert @samp{X-No-Archive: Yes} in the header and a note in the body.
755 The header and the note can be customized using
756 @code{message-archive-header} and @code{message-archive-note}.  When
757 called with a prefix argument, ask for a text to insert.  If you don't
758 want the note in the body, set @code{message-archive-note} to
759 @code{nil}.
760
761 @end table
762
763
764 @node Movement
765 @section Movement
766
767 @table @kbd
768 @item C-c C-b
769 @kindex C-c C-b
770 @findex message-goto-body
771 Move to the beginning of the body of the message
772 (@code{message-goto-body}).
773
774 @item C-c C-i
775 @kindex C-c C-i
776 @findex message-goto-signature
777 Move to the signature of the message (@code{message-goto-signature}).
778
779 @item C-a
780 @kindex C-a
781 @findex message-beginning-of-line
782 @vindex message-beginning-of-line
783 If at beginning of header value, go to beginning of line, else go to
784 beginning of header value.  (The header value comes after the header
785 name and the colon.)  This behavior can be disabled by toggling
786 the variable @code{message-beginning-of-line}.
787
788 @end table
789
790
791 @node Insertion
792 @section Insertion
793
794 @table @kbd
795
796 @item C-c C-y
797 @kindex C-c C-y
798 @findex message-yank-original
799 Yank the message that's being replied to into the message buffer
800 (@code{message-yank-original}).
801
802 @item C-c C-M-y
803 @kindex C-c C-M-y
804 @findex message-yank-buffer
805 Prompt for a buffer name and yank the contents of that buffer into the
806 message buffer (@code{message-yank-buffer}).
807
808 @item C-c C-q
809 @kindex C-c C-q
810 @findex message-fill-yanked-message
811 Fill the yanked message (@code{message-fill-yanked-message}).  Warning:
812 Can severely mess up the yanked text if its quoting conventions are
813 strange.  You'll quickly get a feel for when it's safe, though.  Anyway,
814 just remember that @kbd{C-x u} (@code{undo}) is available and you'll be
815 all right.
816
817 @item C-c C-w
818 @kindex C-c C-w
819 @findex message-insert-signature
820 Insert a signature at the end of the buffer
821 (@code{message-insert-signature}).
822
823 @item C-c M-h
824 @kindex C-c M-h
825 @findex message-insert-headers
826 Insert the message headers (@code{message-insert-headers}).
827
828 @item C-c M-m
829 @kindex C-c M-m
830 @findex message-mark-inserted-region
831 Mark some region in the current article with enclosing tags.  See
832 @code{message-mark-insert-begin} and @code{message-mark-insert-end}.
833 When called with a prefix argument, use slrn style verbatim marks
834 (@samp{#v+} and @samp{#v-}).
835
836 @item C-c M-f
837 @kindex C-c M-f
838 @findex message-mark-insert-file
839 Insert a file in the current article with enclosing tags.
840 See @code{message-mark-insert-begin} and @code{message-mark-insert-end}.
841 When called with a prefix argument, use slrn style verbatim marks
842 (@samp{#v+} and @samp{#v-}).
843
844 @end table
845
846
847 @node MIME
848 @section MIME
849 @cindex MML
850 @cindex MIME
851 @cindex multipart
852 @cindex attachment
853
854 Message is a @acronym{MIME}-compliant posting agent.  The user generally
855 doesn't have to do anything to make the @acronym{MIME} happen---Message will
856 automatically add the @code{Content-Type} and
857 @code{Content-Transfer-Encoding} headers.
858
859 @findex mml-attach-file
860 @kindex C-c C-a
861 The most typical thing users want to use the multipart things in
862 @acronym{MIME} for is to add ``attachments'' to mail they send out.
863 This can be done with the @kbd{C-c C-a} command (@kbd{M-x mml-attach-file}),
864 which will prompt for a file name and a @acronym{MIME} type.
865
866 @vindex mml-dnd-protocol-alist
867 @vindex mml-dnd-attach-options
868 If your Emacs supports drag and drop, you can also drop the file in the
869 Message buffer.  The variable @code{mml-dnd-protocol-alist} specifies
870 what kind of action is done when you drop a file into the Message
871 buffer.  The variable @code{mml-dnd-attach-options} controls which
872 @acronym{MIME} options you want to specify when dropping a file.  If it
873 is a list, valid members are @code{type}, @code{description} and
874 @code{disposition}.  @code{disposition} implies @code{type}.  If it is
875 @code{nil}, don't ask for options.  If it is @code{t}, ask the user
876 whether or not to specify options.
877
878 You can also create arbitrarily complex multiparts using the @acronym{MML}
879 language (@pxref{Composing, , Composing, emacs-mime, The Emacs MIME
880 Manual}).
881
882 @node IDNA
883 @section IDNA
884 @cindex IDNA
885 @cindex internationalized domain names
886 @cindex non-ascii domain names
887
888 @acronym{IDNA} is a standard way to encode non-@acronym{ASCII} domain
889 names into a readable @acronym{ASCII} string.  The details can be
890 found in RFC 3490.
891
892 Message is a @acronym{IDNA}-compliant posting agent.  The user
893 generally doesn't have to do anything to make the @acronym{IDNA}
894 happen---Message will encode non-@acronym{ASCII} domain names in @code{From},
895 @code{To}, and @code{Cc} headers automatically.
896
897 Until @acronym{IDNA} becomes more well known, Message queries you
898 whether @acronym{IDNA} encoding of the domain name really should
899 occur.  Some users might not be aware that domain names can contain
900 non-@acronym{ASCII} now, so this gives them a safety net if they accidently
901 typed a non-@acronym{ASCII} domain name.
902
903 @vindex message-use-idna
904 The @code{message-use-idna} variable control whether @acronym{IDNA} is
905 used.  If the variable is @code{nil} no @acronym{IDNA} encoding will
906 ever happen, if it is set to the symbol @code{ask} the user will be
907 queried, and if set to @code{t} (which is the default if @acronym{IDNA}
908 is fully available) @acronym{IDNA} encoding happens automatically.
909
910 @findex message-idna-to-ascii-rhs
911 If you want to experiment with the @acronym{IDNA} encoding, you can
912 invoke @kbd{M-x message-idna-to-ascii-rhs RET} in the message buffer
913 to have the non-@acronym{ASCII} domain names encoded while you edit
914 the message.
915
916 Note that you must have @uref{http://www.gnu.org/software/libidn/, GNU
917 Libidn} installed in order to use this functionality.
918
919 @node Security
920 @section Security
921 @cindex Security
922 @cindex S/MIME
923 @cindex PGP
924 @cindex PGP/MIME
925 @cindex sign
926 @cindex encrypt
927 @cindex secure
928
929 Using the @acronym{MML} language, Message is able to create digitally
930 signed and digitally encrypted messages.  Message (or rather
931 @acronym{MML}) currently support @acronym{PGP} (RFC 1991),
932 @acronym{PGP/MIME} (RFC 2015/3156) and @acronym{S/MIME}.
933
934 @menu
935 * Signing and encryption::      Signing and encrypting commands.
936 * Using S/MIME::                Using S/MIME
937 * Using PGP/MIME::              Using PGP/MIME
938 * PGP Compatibility::           Compatibility with older implementations
939 @end menu
940
941 @node Signing and encryption
942 @subsection Signing and encrypting commands
943
944 Instructing @acronym{MML} to perform security operations on a
945 @acronym{MIME} part is done using the @kbd{C-c C-m s} key map for
946 signing and the @kbd{C-c C-m c} key map for encryption, as follows.
947 @table @kbd
948
949 @item C-c C-m s s
950 @kindex C-c C-m s s
951 @findex mml-secure-message-sign-smime
952
953 Digitally sign current message using @acronym{S/MIME}.
954
955 @item C-c C-m s o
956 @kindex C-c C-m s o
957 @findex mml-secure-message-sign-pgp
958
959 Digitally sign current message using @acronym{PGP}.
960
961 @item C-c C-m s p
962 @kindex C-c C-m s p
963 @findex mml-secure-message-sign-pgpmime
964
965 Digitally sign current message using @acronym{PGP/MIME}.
966
967 @item C-c C-m c s
968 @kindex C-c C-m c s
969 @findex mml-secure-message-encrypt-smime
970
971 Digitally encrypt current message using @acronym{S/MIME}.
972
973 @item C-c C-m c o
974 @kindex C-c C-m c o
975 @findex mml-secure-message-encrypt-pgp
976
977 Digitally encrypt current message using @acronym{PGP}.
978
979 @item C-c C-m c p
980 @kindex C-c C-m c p
981 @findex mml-secure-message-encrypt-pgpmime
982
983 Digitally encrypt current message using @acronym{PGP/MIME}.
984
985 @item C-c C-m C-n
986 @kindex C-c C-m C-n
987 @findex mml-unsecure-message
988 Remove security related @acronym{MML} tags from message.
989
990 @end table
991
992 These commands do not immediately sign or encrypt the message, they
993 merely insert the proper @acronym{MML} secure tag to instruct the
994 @acronym{MML} engine to perform that operation when the message is
995 actually sent.  They may perform other operations too, such as locating
996 and retrieving a @acronym{S/MIME} certificate of the person you wish to
997 send encrypted mail to.  When the mml parsing engine converts your
998 @acronym{MML} into a properly encoded @acronym{MIME} message, the secure
999 tag will be replaced with either a part or a multipart tag.  If your
1000 message contains other mml parts, a multipart tag will be used; if no
1001 other parts are present in your message a single part tag will be used.
1002 This way, message mode will do the Right Thing (TM) with
1003 signed/encrypted multipart messages.
1004
1005 Since signing and especially encryption often is used when sensitive
1006 information is sent, you may want to have some way to ensure that your
1007 mail is actually signed or encrypted.  After invoking the above
1008 sign/encrypt commands, it is possible to preview the raw article by
1009 using @kbd{C-u C-c RET P} (@code{mml-preview}).  Then you can
1010 verify that your long rant about what your ex-significant other or
1011 whomever actually did with that funny looking person at that strange
1012 party the other night, actually will be sent encrypted.
1013
1014 @emph{Note!}  Neither @acronym{PGP/MIME} nor @acronym{S/MIME} encrypt/signs
1015 RFC822 headers.  They only operate on the @acronym{MIME} object.  Keep this
1016 in mind before sending mail with a sensitive Subject line.
1017
1018 By default, when encrypting a message, Gnus will use the
1019 ``signencrypt'' mode, which means the message is both signed and
1020 encrypted.  If you would like to disable this for a particular
1021 message, give the @code{mml-secure-message-encrypt-*} command a prefix
1022 argument, e.g., @kbd{C-u C-c C-m c p}.
1023
1024 Actually using the security commands above is not very difficult.  At
1025 least not compared with making sure all involved programs talk with each
1026 other properly.  Thus, we now describe what external libraries or
1027 programs are required to make things work, and some small general hints.
1028
1029 @node Using S/MIME
1030 @subsection Using S/MIME
1031
1032 @emph{Note!}  This section assume you have a basic familiarity with
1033 modern cryptography, @acronym{S/MIME}, various PKCS standards, OpenSSL and
1034 so on.
1035
1036 The @acronym{S/MIME} support in Message (and @acronym{MML}) require
1037 OpenSSL.  OpenSSL performs the actual @acronym{S/MIME} sign/encrypt
1038 operations.  OpenSSL can be found at @uref{http://www.openssl.org/}.
1039 OpenSSL 0.9.6 and later should work.  Version 0.9.5a cannot extract mail
1040 addresses from certificates, and it insert a spurious CR character into
1041 @acronym{MIME} separators so you may wish to avoid it if you would like
1042 to avoid being regarded as someone who send strange mail.  (Although by
1043 sending @acronym{S/MIME} messages you've probably already lost that
1044 contest.)
1045
1046 To be able to send encrypted mail, a personal certificate is not
1047 required.  Message (@acronym{MML}) need a certificate for the person to whom you
1048 wish to communicate with though.  You're asked for this when you type
1049 @kbd{C-c C-m c s}.  Currently there are two ways to retrieve this
1050 certificate, from a local file or from DNS.  If you chose a local
1051 file, it need to contain a X.509 certificate in @acronym{PEM} format.
1052 If you chose DNS, you're asked for the domain name where the
1053 certificate is stored, the default is a good guess.  To my belief,
1054 Message (@acronym{MML}) is the first mail agent in the world to support
1055 retrieving @acronym{S/MIME} certificates from DNS, so you're not
1056 likely to find very many certificates out there.  At least there
1057 should be one, stored at the domain @code{simon.josefsson.org}.  LDAP
1058 is a more popular method of distributing certificates, support for it
1059 is planned.  (Meanwhile, you can use @code{ldapsearch} from the
1060 command line to retrieve a certificate into a file and use it.)
1061
1062 As for signing messages, OpenSSL can't perform signing operations
1063 without some kind of configuration.  Especially, you need to tell it
1064 where your private key and your certificate is stored.  @acronym{MML}
1065 uses an Emacs interface to OpenSSL, aptly named @code{smime.el}, and it
1066 contain a @code{custom} group used for this configuration.  So, try
1067 @kbd{M-x customize-group RET smime RET} and look around.
1068
1069 Currently there is no support for talking to a CA (or RA) to create
1070 your own certificate.  None is planned either.  You need to do this
1071 manually with OpenSSL or using some other program.  I used Netscape
1072 and got a free @acronym{S/MIME} certificate from one of the big CA's on the
1073 net.  Netscape is able to export your private key and certificate in
1074 PKCS #12 format.  Use OpenSSL to convert this into a plain X.509
1075 certificate in PEM format as follows.
1076
1077 @example
1078 $ openssl pkcs12 -in ns.p12 -clcerts -nodes > key+cert.pem
1079 @end example
1080
1081 The @file{key+cert.pem} file should be pointed to from the
1082 @code{smime-keys} variable.  You should now be able to send signed mail.
1083
1084 @emph{Note!}  Your private key is now stored unencrypted in the file,
1085 so take care in handling it.  Storing encrypted keys on the disk are
1086 supported, and Gnus will ask you for a passphrase before invoking
1087 OpenSSL.  Read the OpenSSL documentation for how to achieve this.  If
1088 you use unencrypted keys (e.g., if they are on a secure storage, or if
1089 you are on a secure single user machine) simply press @code{RET} at
1090 the passphrase prompt.
1091
1092 @node Using PGP/MIME
1093 @subsection Using PGP/MIME
1094
1095 @acronym{PGP/MIME} requires an external OpenPGP implementation, such
1096 as @uref{http://www.gnupg.org/, GNU Privacy Guard}. Pre-OpenPGP
1097 implementations such as PGP 2.x and PGP 5.x are also supported. One
1098 Emacs interface to the PGP implementations, PGG (@pxref{Top, ,PGG,
1099 pgg, PGG Manual}), is included, but Mailcrypt is also supported.
1100 @xref{PGP Compatibility}.
1101
1102 @cindex gpg-agent
1103 Message internally calls GnuPG (the @command{gpg} command) to perform
1104 data encryption, and in certain cases (decrypting or signing for
1105 example), @command{gpg} requires user's passphrase.  Currently the
1106 recommended way to supply your passphrase to @command{gpg} is to use the
1107 @command{gpg-agent} program.
1108
1109 To use @command{gpg-agent} in Emacs, you need to run the following
1110 command from the shell before starting Emacs.
1111
1112 @example
1113 eval `gpg-agent --daemon`
1114 @end example
1115
1116 This will invoke @command{gpg-agent} and set the environment variable
1117 @code{GPG_AGENT_INFO} to allow @command{gpg} to communicate with it.
1118 It might be good idea to put this command in your @file{.xsession} or
1119 @file{.bash_profile}.  @xref{Invoking GPG-AGENT, , , gnupg, Using the
1120 GNU Privacy Guard}.
1121
1122 Once your @command{gpg-agent} is set up, it will ask you for a
1123 passphrase as needed for @command{gpg}.  Under the X Window System,
1124 you will see a new passphrase input dialog appear.  The dialog is
1125 provided by PIN Entry (the @command{pinentry} command), and as of
1126 version 0.7.2, @command{pinentry} cannot cooperate with Emacs on a
1127 single tty.  So, if you are using a text console, you may need to put
1128 a passphrase into gpg-agent's cache beforehand.  The following command
1129 does the trick.
1130
1131 @example
1132 gpg --use-agent --sign < /dev/null > /dev/null
1133 @end example
1134
1135 The Lisp variable @code{pgg-gpg-use-agent} controls whether to use
1136 @command{gpg-agent}.  See also @xref{Caching passphrase, , , pgg, The
1137 PGG Manual}.
1138
1139
1140 @node PGP Compatibility
1141 @subsection Compatibility with older implementations
1142
1143 @vindex gpg-temp-directory
1144 Note, if you are using the @code{gpg.el} you must make sure that the
1145 directory specified by @code{gpg-temp-directory} have permissions
1146 0700.
1147
1148 Creating your own key is described in detail in the documentation of
1149 your PGP implementation, so we refer to it.
1150
1151 If you have imported your old PGP 2.x key into GnuPG, and want to send
1152 signed and encrypted messages to your fellow PGP 2.x users, you'll
1153 discover that the receiver cannot understand what you send. One
1154 solution is to use PGP 2.x instead (i.e., if you use @code{pgg}, set
1155 @code{pgg-default-scheme} to @code{pgp}). You could also convince your
1156 fellow PGP 2.x users to convert to GnuPG.
1157 @vindex mml-signencrypt-style-alist
1158 As a final workaround, you can make the sign and encryption work in
1159 two steps; separately sign, then encrypt a message.  If you would like
1160 to change this behavior you can customize the
1161 @code{mml-signencrypt-style-alist} variable.  For example:
1162
1163 @lisp
1164 (setq mml-signencrypt-style-alist '(("smime" separate)
1165                                     ("pgp" separate)
1166                                     ("pgpauto" separate)
1167                                     ("pgpmime" separate)))
1168 @end lisp
1169
1170 This causes to sign and encrypt in two passes, thus generating a
1171 message that can be understood by PGP version 2.
1172
1173 (Refer to @uref{http://www.gnupg.org/gph/en/pgp2x.html} for more
1174 information about the problem.)
1175
1176 @node Various Commands
1177 @section Various Commands
1178
1179 @table @kbd
1180
1181 @item C-c C-r
1182 @kindex C-c C-r
1183 @findex message-caesar-buffer-body
1184 Caesar rotate (aka. rot13) the current message
1185 (@code{message-caesar-buffer-body}).  If narrowing is in effect, just
1186 rotate the visible portion of the buffer.  A numerical prefix says how
1187 many places to rotate the text.  The default is 13.
1188
1189 @item C-c C-e
1190 @kindex C-c C-e
1191 @findex message-elide-region
1192 @vindex message-elide-ellipsis
1193 Elide the text between point and mark (@code{message-elide-region}).
1194 The text is killed and replaced with the contents of the variable
1195 @code{message-elide-ellipsis}.  The default value is to use an ellipsis
1196 (@samp{[...]}).
1197
1198 @item C-c M-k
1199 @kindex C-c M-k
1200 @findex message-kill-address
1201 Kill the address under point.
1202
1203 @item C-c C-z
1204 @kindex C-c C-z
1205 @findex message-kill-to-signature
1206 Kill all the text up to the signature, or if that's missing, up to the
1207 end of the message (@code{message-kill-to-signature}).
1208
1209 @item C-c C-v
1210 @kindex C-c C-v
1211 @findex message-delete-not-region
1212 Delete all text in the body of the message that is outside the region
1213 (@code{message-delete-not-region}).
1214
1215 @item M-RET
1216 @kindex M-RET
1217 @findex message-newline-and-reformat
1218 Insert four newlines, and then reformat if inside quoted text.
1219
1220 Here's an example:
1221
1222 @example
1223 > This is some quoted text.  And here's more quoted text.
1224 @end example
1225
1226 If point is before @samp{And} and you press @kbd{M-RET}, you'll get:
1227
1228 @example
1229 > This is some quoted text.
1230
1231 *
1232
1233 > And here's more quoted text.
1234 @end example
1235
1236 @samp{*} says where point will be placed.
1237
1238 @item C-c M-r
1239 @kindex C-c M-r
1240 @findex message-rename-buffer
1241 Rename the buffer (@code{message-rename-buffer}).  If given a prefix,
1242 prompt for a new buffer name.
1243
1244 @item TAB
1245 @kindex TAB
1246 @findex message-tab
1247 @vindex message-tab-body-function
1248 If @code{message-tab-body-function} is non-@code{nil}, execute the
1249 function it specifies.  Otherwise use the function bound to @kbd{TAB} in
1250 @code{text-mode-map} or @code{global-map}.
1251
1252 @end table
1253
1254
1255 @node Sending
1256 @section Sending
1257
1258 @table @kbd
1259 @item C-c C-c
1260 @kindex C-c C-c
1261 @findex message-send-and-exit
1262 Send the message and bury the current buffer
1263 (@code{message-send-and-exit}).
1264
1265 @item C-c C-s
1266 @kindex C-c C-s
1267 @findex message-send
1268 Send the message (@code{message-send}).
1269
1270 @item C-c C-d
1271 @kindex C-c C-d
1272 @findex message-dont-send
1273 Bury the message buffer and exit (@code{message-dont-send}).
1274
1275 @item C-c C-k
1276 @kindex C-c C-k
1277 @findex message-kill-buffer
1278 Kill the message buffer and exit (@code{message-kill-buffer}).
1279
1280 @end table
1281
1282
1283
1284 @node Mail Aliases
1285 @section Mail Aliases
1286 @cindex mail aliases
1287 @cindex aliases
1288 @cindex completion
1289 @cindex ecomplete
1290
1291 @vindex message-mail-alias-type
1292 The @code{message-mail-alias-type} variable controls what type of mail
1293 alias expansion to use.  Currently two forms are supported:
1294 @code{mailabbrev} and @code{ecomplete}.  If this variable is
1295 @code{nil}, no mail alias expansion will be performed.
1296
1297 @code{mailabbrev} works by parsing the @file{/etc/mailrc} and
1298 @file{~/.mailrc} files.  These files look like:
1299
1300 @example
1301 alias lmi "Lars Magne Ingebrigtsen <larsi@@ifi.uio.no>"
1302 alias ding "ding@@ifi.uio.no (ding mailing list)"
1303 @end example
1304
1305 After adding lines like this to your @file{~/.mailrc} file, you should
1306 be able to just write @samp{lmi} in the @code{To} or @code{Cc} (and so
1307 on) headers and press @kbd{SPC} to expand the alias.
1308
1309 No expansion will be performed upon sending of the message---all
1310 expansions have to be done explicitly.
1311
1312 If you're using @code{ecomplete}, all addresses from @code{To} and
1313 @code{Cc} headers will automatically be put into the
1314 @file{~/.ecompleterc} file.  When you enter text in the @code{To} and
1315 @code{Cc} headers, @code{ecomplete} will check out the values stored
1316 there and ``electrically'' say what completions are possible.  To
1317 choose one of these completions, use the @kbd{M-n} command to move
1318 down to the list.  Use @kbd{M-n} and @kbd{M-p} to move down and up the
1319 list, and @kbd{RET} to choose a completion.
1320
1321 @node Spelling
1322 @section Spelling
1323 @cindex spelling
1324 @findex ispell-message
1325
1326 There are two popular ways to have Emacs spell-check your messages:
1327 @code{ispell} and @code{flyspell}.  @code{ispell} is the older and
1328 probably more popular package.  You typically first write the message,
1329 and then run the entire thing through @code{ispell} and fix all the
1330 typos.  To have this happen automatically when you send a message, put
1331 something like the following in your @file{.emacs} file:
1332
1333 @lisp
1334 (add-hook 'message-send-hook 'ispell-message)
1335 @end lisp
1336
1337 @vindex ispell-message-dictionary-alist
1338 If you're in the habit of writing in different languages, this can be
1339 controlled by the @code{ispell-message-dictionary-alist} variable:
1340
1341 @lisp
1342 (setq ispell-message-dictionary-alist
1343       '(("^Newsgroups:.*\\bde\\." . "deutsch8")
1344         (".*" . "default")))
1345 @end lisp
1346
1347 @code{ispell} depends on having the external @samp{ispell} command
1348 installed.
1349
1350 The other popular method is using @code{flyspell}.  This package checks
1351 your spelling while you're writing, and marks any mis-spelled words in
1352 various ways.
1353
1354 To use @code{flyspell}, put something like the following in your
1355 @file{.emacs} file:
1356
1357 @lisp
1358 (defun my-message-setup-routine ()
1359   (flyspell-mode 1))
1360 (add-hook 'message-setup-hook 'my-message-setup-routine)
1361 @end lisp
1362
1363 @code{flyspell} depends on having the external @samp{ispell} command
1364 installed.
1365
1366
1367 @node Variables
1368 @chapter Variables
1369
1370 @menu
1371 * Message Headers::             General message header stuff.
1372 * Mail Headers::                Customizing mail headers.
1373 * Mail Variables::              Other mail variables.
1374 * News Headers::                Customizing news headers.
1375 * News Variables::              Other news variables.
1376 * Insertion Variables::         Customizing how things are inserted.
1377 * Various Message Variables::   Other message variables.
1378 * Sending Variables::           Variables for sending.
1379 * Message Buffers::             How Message names its buffers.
1380 * Message Actions::             Actions to be performed when exiting.
1381 @end menu
1382
1383
1384 @node Message Headers
1385 @section Message Headers
1386
1387 Message is quite aggressive on the message generation front.  It has to
1388 be---it's a combined news and mail agent.  To be able to send combined
1389 messages, it has to generate all headers itself (instead of letting the
1390 mail/news system do it) to ensure that mail and news copies of messages
1391 look sufficiently similar.
1392
1393 @table @code
1394
1395 @item message-generate-headers-first
1396 @vindex message-generate-headers-first
1397 If @code{t}, generate all required headers before starting to
1398 compose the message.  This can also be a list of headers to generate:
1399
1400 @lisp
1401 (setq message-generate-headers-first
1402       '(References))
1403 @end lisp
1404
1405 @vindex message-required-headers
1406 The variables @code{message-required-headers},
1407 @code{message-required-mail-headers} and
1408 @code{message-required-news-headers} specify which headers are
1409 required.
1410
1411 Note that some headers will be removed and re-generated before posting,
1412 because of the variable @code{message-deletable-headers} (see below).
1413
1414 @item message-draft-headers
1415 @vindex message-draft-headers
1416 When running Message from Gnus, the message buffers are associated
1417 with a draft group.  @code{message-draft-headers} says which headers
1418 should be generated when a draft is written to the draft group.
1419
1420 @item message-from-style
1421 @vindex message-from-style
1422 Specifies how @code{From} headers should look.  There are four valid
1423 values:
1424
1425 @table @code
1426 @item nil
1427 Just the address---@samp{king@@grassland.com}.
1428
1429 @item parens
1430 @samp{king@@grassland.com (Elvis Parsley)}.
1431
1432 @item angles
1433 @samp{Elvis Parsley <king@@grassland.com>}.
1434
1435 @item default
1436 Look like @code{angles} if that doesn't require quoting, and
1437 @code{parens} if it does.  If even @code{parens} requires quoting, use
1438 @code{angles} anyway.
1439
1440 @end table
1441
1442 @item message-deletable-headers
1443 @vindex message-deletable-headers
1444 Headers in this list that were previously generated by Message will be
1445 deleted before posting.  Let's say you post an article.  Then you decide
1446 to post it again to some other group, you naughty boy, so you jump back
1447 to the @code{*post-buf*} buffer, edit the @code{Newsgroups} line, and
1448 ship it off again.  By default, this variable makes sure that the old
1449 generated @code{Message-ID} is deleted, and a new one generated.  If
1450 this isn't done, the entire empire would probably crumble, anarchy would
1451 prevail, and cats would start walking on two legs and rule the world.
1452 Allegedly.
1453
1454 @item message-default-headers
1455 @vindex message-default-headers
1456 Header lines to be inserted in outgoing messages before you edit the
1457 message, so you can edit or delete their lines. If set to a string, it
1458 is directly inserted. If set to a function, it is called and its
1459 result is inserted.
1460
1461 @item message-subject-re-regexp
1462 @vindex message-subject-re-regexp
1463 @cindex Aw
1464 @cindex Sv
1465 @cindex Re
1466 Responses to messages have subjects that start with @samp{Re: }.  This
1467 is @emph{not} an abbreviation of the English word ``response'', but is
1468 Latin, and means ``in response to''.  Some illiterate nincompoops have
1469 failed to grasp this fact, and have ``internationalized'' their software
1470 to use abominations like @samp{Aw: } (``antwort'') or @samp{Sv: }
1471 (``svar'') instead, which is meaningless and evil.  However, you may
1472 have to deal with users that use these evil tools, in which case you may
1473 set this variable to a regexp that matches these prefixes.  Myself, I
1474 just throw away non-compliant mail.
1475
1476 Here's an example of a value to deal with these headers when
1477 responding to a message:
1478
1479 @lisp
1480 (setq message-subject-re-regexp
1481       (concat
1482        "^[ \t]*"
1483          "\\("
1484            "\\("
1485              "[Aa][Nn][Tt][Ww]\\.?\\|"     ; antw
1486              "[Aa][Ww]\\|"                 ; aw
1487              "[Ff][Ww][Dd]?\\|"            ; fwd
1488              "[Oo][Dd][Pp]\\|"             ; odp
1489              "[Rr][Ee]\\|"                 ; re
1490              "[Rr][\311\351][Ff]\\.?\\|"   ; ref
1491              "[Ss][Vv]"                    ; sv
1492            "\\)"
1493            "\\(\\[[0-9]*\\]\\)"
1494            "*:[ \t]*"
1495          "\\)"
1496        "*[ \t]*"
1497        ))
1498 @end lisp
1499
1500 @item message-subject-trailing-was-query
1501 @vindex message-subject-trailing-was-query
1502 @vindex message-subject-trailing-was-ask-regexp
1503 @vindex message-subject-trailing-was-regexp
1504 Controls what to do with trailing @samp{(was: <old subject>)} in subject
1505 lines.  If @code{nil}, leave the subject unchanged.  If it is the symbol
1506 @code{ask}, query the user what to do.  In this case, the subject is
1507 matched against @code{message-subject-trailing-was-ask-regexp}.  If
1508 @code{message-subject-trailing-was-query} is @code{t}, always strip the
1509 trailing old subject.  In this case,
1510 @code{message-subject-trailing-was-regexp} is used.
1511
1512 @item message-alternative-emails
1513 @vindex message-alternative-emails
1514 Regexp matching alternative email addresses.  The first address in the
1515 To, Cc or From headers of the original article matching this variable is
1516 used as the From field of outgoing messages, replacing the default From
1517 value.
1518
1519 For example, if you have two secondary email addresses john@@home.net
1520 and john.doe@@work.com and want to use them in the From field when
1521 composing a reply to a message addressed to one of them, you could set
1522 this variable like this:
1523
1524 @lisp
1525 (setq message-alternative-emails
1526       (regexp-opt '("john@@home.net" "john.doe@@work.com")))
1527 @end lisp
1528
1529 This variable has precedence over posting styles and anything that runs
1530 off @code{message-setup-hook}.
1531
1532 @item message-allow-no-recipients
1533 @vindex message-allow-no-recipients
1534 Specifies what to do when there are no recipients other than
1535 @code{Gcc} or @code{Fcc}.  If it is @code{always}, the posting is
1536 allowed.  If it is @code{never}, the posting is not allowed.  If it is
1537 @code{ask} (the default), you are prompted.
1538
1539 @item message-hidden-headers
1540 @vindex message-hidden-headers
1541 A regexp, a list of regexps, or a list where the first element is
1542 @code{not} and the rest are regexps.  It says which headers to keep
1543 hidden when composing a message.
1544
1545 @lisp
1546 (setq message-hidden-headers
1547       '(not "From" "Subject" "To" "Cc" "Newsgroups"))
1548 @end lisp
1549
1550 Headers are hidden using narrowing, you can use @kbd{M-x widen} to
1551 expose them in the buffer.
1552
1553 @item message-header-synonyms
1554 @vindex message-header-synonyms
1555 A list of lists of header synonyms.  E.g., if this list contains a
1556 member list with elements @code{Cc} and @code{To}, then
1557 @code{message-carefully-insert-headers} will not insert a @code{To}
1558 header when the message is already @code{Cc}ed to the recipient.
1559
1560 @end table
1561
1562
1563 @node Mail Headers
1564 @section Mail Headers
1565
1566 @table @code
1567 @item message-required-mail-headers
1568 @vindex message-required-mail-headers
1569 @xref{News Headers}, for the syntax of this variable.  It is
1570 @code{(From Subject Date (optional . In-Reply-To) Message-ID
1571 (optional . User-Agent))} by default.
1572
1573 @item message-ignored-mail-headers
1574 @vindex message-ignored-mail-headers
1575 Regexp of headers to be removed before mailing.  The default is@*
1576 @samp{^[GF]cc:\\|^Resent-Fcc:\\|^Xref:\\|^X-Draft-From:\\|@*
1577 ^X-Gnus-Agent-Meta-Information:}.
1578
1579 @item message-default-mail-headers
1580 @vindex message-default-mail-headers
1581 This string is inserted at the end of the headers in all message
1582 buffers that are initialized as mail.
1583
1584 @item message-generate-hashcash
1585 @vindex message-generate-hashcash
1586 Variable that indicates whether @samp{X-Hashcash} headers
1587 should be computed for the message.  @xref{Hashcash, ,Hashcash,gnus,
1588 The Gnus Manual}.  If @code{opportunistic}, only generate the headers
1589 when it doesn't lead to the user having to wait.
1590
1591 @end table
1592
1593
1594 @node Mail Variables
1595 @section Mail Variables
1596
1597 @table @code
1598 @item message-send-mail-function
1599 @vindex message-send-mail-function
1600 @findex message-send-mail-function
1601 @findex message-send-mail-with-sendmail
1602 @findex message-send-mail-with-mh
1603 @findex message-send-mail-with-qmail
1604 @findex message-smtpmail-send-it
1605 @findex smtpmail-send-it
1606 @findex feedmail-send-it
1607 @findex message-send-mail-with-mailclient
1608 Function used to send the current buffer as mail.  The default is
1609 @code{message-send-mail-with-sendmail}, or @code{smtpmail-send-it}
1610 according to the system.  Other valid values include
1611 @code{message-send-mail-with-mailclient},
1612 @code{message-send-mail-with-mh}, @code{message-send-mail-with-qmail},
1613 @code{message-smtpmail-send-it} and @code{feedmail-send-it}.
1614
1615 The function
1616 @code{message-send-mail-with-sendmail} pipes your article to the
1617 @code{sendmail} binary for further queuing and sending.  When your local
1618 system is not configured for sending mail using @code{sendmail}, and you
1619 have access to a remote @acronym{SMTP} server, you can set
1620 @code{message-send-mail-function} to @code{smtpmail-send-it} and make
1621 sure to setup the @code{smtpmail} package correctly.  An example:
1622
1623 @lisp
1624 (setq message-send-mail-function 'smtpmail-send-it
1625       smtpmail-default-smtp-server "YOUR SMTP HOST")
1626 @end lisp
1627
1628 To the thing similar to this, there is
1629 @code{message-smtpmail-send-it}.  It is useful if your @acronym{ISP}
1630 requires the @acronym{POP}-before-@acronym{SMTP} authentication.
1631 @xref{POP before SMTP, , POP before SMTP, gnus, The Gnus Manual}.
1632
1633 @item message-mh-deletable-headers
1634 @vindex message-mh-deletable-headers
1635 Most versions of MH doesn't like being fed messages that contain the
1636 headers in this variable.  If this variable is non-@code{nil} (which is
1637 the default), these headers will be removed before mailing when sending
1638 messages via MH.  Set it to @code{nil} if your MH can handle these
1639 headers.
1640
1641 @item message-qmail-inject-program
1642 @vindex message-qmail-inject-program
1643 @cindex qmail
1644 Location of the qmail-inject program.
1645
1646 @item message-qmail-inject-args
1647 @vindex message-qmail-inject-args
1648 Arguments passed to qmail-inject programs.
1649 This should be a list of strings, one string for each argument.  It
1650 may also be a function.
1651
1652 For e.g., if you wish to set the envelope sender address so that bounces
1653 go to the right place or to deal with listserv's usage of that address, you
1654 might set this variable to @code{'("-f" "you@@some.where")}.
1655
1656 @item message-sendmail-f-is-evil
1657 @vindex message-sendmail-f-is-evil
1658 @cindex sendmail
1659 Non-@code{nil} means don't add @samp{-f username} to the sendmail
1660 command line.  Doing so would be even more evil than leaving it out.
1661
1662 @item message-sendmail-envelope-from
1663 @vindex message-sendmail-envelope-from
1664 When @code{message-sendmail-f-is-evil} is @code{nil}, this specifies
1665 the address to use in the @acronym{SMTP} envelope.  If it is
1666 @code{nil}, use @code{user-mail-address}.  If it is the symbol
1667 @code{header}, use the @samp{From} header of the message.
1668
1669 @item message-mailer-swallows-blank-line
1670 @vindex message-mailer-swallows-blank-line
1671 Set this to non-@code{nil} if the system's mailer runs the header and
1672 body together.  (This problem exists on SunOS 4 when sendmail is run
1673 in remote mode.)  The value should be an expression to test whether
1674 the problem will actually occur.
1675
1676 @item message-send-mail-partially-limit
1677 @vindex message-send-mail-partially-limit
1678 @cindex split large message
1679 The limitation of messages sent as message/partial.  The lower bound
1680 of message size in characters, beyond which the message should be sent
1681 in several parts.  If it is @code{nil} (which is the default), the
1682 size is unlimited.
1683
1684 @end table
1685
1686
1687 @node News Headers
1688 @section News Headers
1689
1690 @vindex message-required-news-headers
1691 @code{message-required-news-headers} a list of header symbols.  These
1692 headers will either be automatically generated, or, if that's
1693 impossible, they will be prompted for.  The following symbols are valid:
1694
1695 @table @code
1696
1697 @item From
1698 @cindex From
1699 @findex user-full-name
1700 @findex user-mail-address
1701 This required header will be filled out with the result of the
1702 @code{message-make-from} function, which depends on the
1703 @code{message-from-style}, @code{user-full-name},
1704 @code{user-mail-address} variables.
1705
1706 @item Subject
1707 @cindex Subject
1708 This required header will be prompted for if not present already.
1709
1710 @item Newsgroups
1711 @cindex Newsgroups
1712 This required header says which newsgroups the article is to be posted
1713 to.  If it isn't present already, it will be prompted for.
1714
1715 @item Organization
1716 @cindex organization
1717 @vindex message-user-organization
1718 @vindex message-user-organization-file
1719 This optional header will be filled out depending on the
1720 @code{message-user-organization} variable.
1721 @code{message-user-organization-file} will be used if this variable is
1722 @code{t}.  This variable can also be a string (in which case this string
1723 will be used), or it can be a function (which will be called with no
1724 parameters and should return a string to be used).
1725
1726 @item Lines
1727 @cindex Lines
1728 This optional header will be computed by Message.
1729
1730 @item Message-ID
1731 @cindex Message-ID
1732 @vindex message-user-fqdn
1733 @vindex mail-host-address
1734 @vindex user-mail-address
1735 @findex system-name
1736 @cindex Sun
1737 @cindex i-did-not-set--mail-host-address--so-tickle-me
1738 This required header will be generated by Message.  A unique ID will be
1739 created based on the date, time, user name (for the local part) and the
1740 domain part.  For the domain part, message will look (in this order) at
1741 @code{message-user-fqdn}, @code{system-name}, @code{mail-host-address}
1742 and @code{message-user-mail-address} (i.e. @code{user-mail-address})
1743 until a probably valid fully qualified domain name (FQDN) was found.
1744
1745 @item User-Agent
1746 @cindex User-Agent
1747 This optional header will be filled out according to the
1748 @code{message-newsreader} local variable.
1749
1750 @item In-Reply-To
1751 This optional header is filled out using the @code{Date} and @code{From}
1752 header of the article being replied to.
1753
1754 @item Expires
1755 @cindex Expires
1756 @vindex message-expires
1757 This extremely optional header will be inserted according to the
1758 @code{message-expires} variable.  It is highly deprecated and shouldn't
1759 be used unless you know what you're doing.
1760
1761 @item Distribution
1762 @cindex Distribution
1763 @vindex message-distribution-function
1764 This optional header is filled out according to the
1765 @code{message-distribution-function} variable.  It is a deprecated and
1766 much misunderstood header.
1767
1768 @item Path
1769 @cindex path
1770 @vindex message-user-path
1771 This extremely optional header should probably never be used.
1772 However, some @emph{very} old servers require that this header is
1773 present.  @code{message-user-path} further controls how this
1774 @code{Path} header is to look.  If it is @code{nil}, use the server name
1775 as the leaf node.  If it is a string, use the string.  If it is neither
1776 a string nor @code{nil}, use the user name only.  However, it is highly
1777 unlikely that you should need to fiddle with this variable at all.
1778 @end table
1779
1780 @findex yow
1781 @cindex Mime-Version
1782 In addition, you can enter conses into this list.  The @sc{car} of this cons
1783 should be a symbol.  This symbol's name is the name of the header, and
1784 the @sc{cdr} can either be a string to be entered verbatim as the value of
1785 this header, or it can be a function to be called.  This function should
1786 return a string to be inserted.  For instance, if you want to insert
1787 @code{Mime-Version: 1.0}, you should enter @code{(Mime-Version . "1.0")}
1788 into the list.  If you want to insert a funny quote, you could enter
1789 something like @code{(X-Yow . yow)} into the list.  The function
1790 @code{yow} will then be called without any arguments.
1791
1792 If the list contains a cons where the @sc{car} of the cons is
1793 @code{optional}, the @sc{cdr} of this cons will only be inserted if it is
1794 non-@code{nil}.
1795
1796 If you want to delete an entry from this list, the following Lisp
1797 snippet might be useful.  Adjust accordingly if you want to remove
1798 another element.
1799
1800 @lisp
1801 (setq message-required-news-headers
1802       (delq 'Message-ID message-required-news-headers))
1803 @end lisp
1804
1805 Other variables for customizing outgoing news articles:
1806
1807 @table @code
1808
1809 @item message-syntax-checks
1810 @vindex message-syntax-checks
1811 Controls what syntax checks should not be performed on outgoing posts.
1812 To disable checking of long signatures, for instance, add
1813
1814 @lisp
1815 (signature . disabled)
1816 @end lisp
1817
1818 to this list.
1819
1820 Valid checks are:
1821
1822 @table @code
1823 @item approved
1824 @cindex approved
1825 Check whether the article has an @code{Approved} header, which is
1826 something only moderators should include.
1827 @item continuation-headers
1828 Check whether there are continuation header lines that don't begin with
1829 whitespace.
1830 @item control-chars
1831 Check for invalid characters.
1832 @item empty
1833 Check whether the article is empty.
1834 @item existing-newsgroups
1835 Check whether the newsgroups mentioned in the @code{Newsgroups} and
1836 @code{Followup-To} headers exist.
1837 @item from
1838 Check whether the @code{From} header seems nice.
1839 @item illegible-text
1840 Check whether there is any non-printable character in the body.
1841 @item invisible-text
1842 Check whether there is any invisible text in the buffer.
1843 @item long-header-lines
1844 Check for too long header lines.
1845 @item long-lines
1846 @cindex long lines
1847 Check for too long lines in the body.
1848 @item message-id
1849 Check whether the @code{Message-ID} looks syntactically ok.
1850 @item multiple-headers
1851 Check for the existence of multiple equal headers.
1852 @item new-text
1853 Check whether there is any new text in the messages.
1854 @item newsgroups
1855 Check whether the @code{Newsgroups} header exists and is not empty.
1856 @item quoting-style
1857 Check whether text follows last quoted portion.
1858 @item repeated-newsgroups
1859 Check whether the @code{Newsgroups} and @code{Followup-to} headers
1860 contains repeated group names.
1861 @item reply-to
1862 Check whether the @code{Reply-To} header looks ok.
1863 @item sender
1864 @cindex Sender
1865 Insert a new @code{Sender} header if the @code{From} header looks odd.
1866 @item sendsys
1867 @cindex sendsys
1868 Check for the existence of version and sendsys commands.
1869 @item shoot
1870 Check whether the domain part of the @code{Message-ID} header looks ok.
1871 @item shorten-followup-to
1872 Check whether to add a @code{Followup-to} header to shorten the number
1873 of groups to post to.
1874 @item signature
1875 Check the length of the signature.
1876 @item size
1877 Check for excessive size.
1878 @item subject
1879 Check whether the @code{Subject} header exists and is not empty.
1880 @item subject-cmsg
1881 Check the subject for commands.
1882 @item valid-newsgroups
1883 Check whether the @code{Newsgroups} and @code{Followup-to} headers
1884 are valid syntactically.
1885 @end table
1886
1887 All these conditions are checked by default, except for @code{sender}
1888 for which the check is disabled by default if
1889 @code{message-insert-canlock} is non-@code{nil} (@pxref{Canceling News}).
1890
1891 @item message-ignored-news-headers
1892 @vindex message-ignored-news-headers
1893 Regexp of headers to be removed before posting.  The default is@*
1894 @samp{^NNTP-Posting-Host:\\|^Xref:\\|^[BGF]cc:\\|^Resent-Fcc:\\|@*
1895 ^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:}.
1896
1897 @item message-default-news-headers
1898 @vindex message-default-news-headers
1899 This string is inserted at the end of the headers in all message
1900 buffers that are initialized as news.
1901
1902 @end table
1903
1904
1905 @node News Variables
1906 @section News Variables
1907
1908 @table @code
1909 @item message-send-news-function
1910 @vindex message-send-news-function
1911 Function used to send the current buffer as news.  The default is
1912 @code{message-send-news}.
1913
1914 @item message-post-method
1915 @vindex message-post-method
1916 Gnusish @dfn{select method} (see the Gnus manual for details) used for
1917 posting a prepared news message.
1918
1919 @end table
1920
1921
1922 @node Insertion Variables
1923 @section Insertion Variables
1924
1925 @table @code
1926 @item message-ignored-cited-headers
1927 @vindex message-ignored-cited-headers
1928 All headers that match this regexp will be removed from yanked
1929 messages.  The default is @samp{.}, which means that all headers will be
1930 removed.
1931
1932 @item message-cite-prefix-regexp
1933 @vindex message-cite-prefix-regexp
1934 Regexp matching the longest possible citation prefix on a line.
1935
1936 @item message-citation-line-function
1937 @vindex message-citation-line-function
1938 @cindex attribution line
1939 Function called to insert the citation line.  The default is
1940 @code{message-insert-citation-line}, which will lead to citation lines
1941 that look like:
1942
1943 @example
1944 Hallvard B Furuseth <h.b.furuseth@@usit.uio.no> writes:
1945 @end example
1946
1947 @c FIXME: Add `message-insert-formated-citation-line' and
1948 @c `message-citation-line-format'
1949
1950 Point will be at the beginning of the body of the message when this
1951 function is called.
1952
1953 Note that Gnus provides a feature where clicking on `writes:' hides the
1954 cited text.  If you change the citation line too much, readers of your
1955 messages will have to adjust their Gnus, too.  See the variable
1956 @code{gnus-cite-attribution-suffix}.  @xref{Article Highlighting, ,
1957 Article Highlighting, gnus, The Gnus Manual}, for details.
1958
1959 @item message-yank-prefix
1960 @vindex message-yank-prefix
1961 @cindex yanking
1962 @cindex quoting
1963 When you are replying to or following up an article, you normally want
1964 to quote the person you are answering.  Inserting quoted text is done by
1965 @dfn{yanking}, and each line you yank will have
1966 @code{message-yank-prefix} prepended to it (except for quoted lines
1967 which use @code{message-yank-cited-prefix} and empty lines which use
1968 @code{message-yank-empty-prefix}).  The default is @samp{> }.
1969
1970 @item message-yank-cited-prefix
1971 @vindex message-yank-cited-prefix
1972 @cindex yanking
1973 @cindex cited
1974 @cindex quoting
1975 When yanking text from an article which contains already cited text,
1976 each line will be prefixed with the contents of this variable.  The
1977 default is @samp{>}.  See also @code{message-yank-prefix}.
1978
1979 @item message-yank-empty-prefix
1980 @vindex message-yank-empty-prefix
1981 @cindex yanking
1982 @cindex quoting
1983 When yanking text from an article, each empty line will be prefixed with
1984 the contents of this variable.  The default is @samp{>}.  You can set
1985 this variable to an empty string to split the cited text into paragraphs
1986 automatically.  See also @code{message-yank-prefix}.
1987
1988 @item message-indentation-spaces
1989 @vindex message-indentation-spaces
1990 Number of spaces to indent yanked messages.
1991
1992 @item message-cite-function
1993 @vindex message-cite-function
1994 @findex message-cite-original
1995 @findex message-cite-original-without-signature
1996 Function for citing an original message.  The default is
1997 @code{message-cite-original}, which simply inserts the original message
1998 and prepends @samp{> } to each line.
1999 @code{message-cite-original-without-signature} does the same, but elides
2000 the signature.
2001
2002 @item message-indent-citation-function
2003 @vindex message-indent-citation-function
2004 Function for modifying a citation just inserted in the mail buffer.
2005 This can also be a list of functions.  Each function can find the
2006 citation between @code{(point)} and @code{(mark t)}.  And each function
2007 should leave point and mark around the citation text as modified.
2008
2009 @item message-mark-insert-begin
2010 @vindex message-mark-insert-begin
2011 String to mark the beginning of some inserted text.
2012
2013 @item message-mark-insert-end
2014 @vindex message-mark-insert-end
2015 String to mark the end of some inserted text.
2016
2017 @item message-signature
2018 @vindex message-signature
2019 String to be inserted at the end of the message buffer.  If @code{t}
2020 (which is the default), the @code{message-signature-file} file will be
2021 inserted instead.  If a function, the result from the function will be
2022 used instead.  If a form, the result from the form will be used instead.
2023 If this variable is @code{nil}, no signature will be inserted at all.
2024
2025 @item message-signature-file
2026 @vindex message-signature-file
2027 File containing the signature to be inserted at the end of the buffer.
2028 If a path is specified, the value of
2029 @code{message-signature-directory} is ignored, even if set.
2030 The default is @file{~/.signature}.
2031
2032 @item message-signature-directory
2033 @vindex message-signature-directory
2034 Name of directory containing signature files.  Comes in handy if you
2035 have many such files, handled via Gnus posting styles for instance.
2036 If @code{nil} (the default), @code{message-signature-file} is expected
2037 to specify the directory if needed.
2038
2039
2040 @item message-signature-insert-empty-line
2041 @vindex message-signature-insert-empty-line
2042 If @code{t} (the default value) an empty line is inserted before the
2043 signature separator.
2044
2045 @end table
2046
2047 Note that RFC1036bis says that a signature should be preceded by the three
2048 characters @samp{-- } on a line by themselves.  This is to make it
2049 easier for the recipient to automatically recognize and process the
2050 signature.  So don't remove those characters, even though you might feel
2051 that they ruin your beautiful design, like, totally.
2052
2053 Also note that no signature should be more than four lines long.
2054 Including @acronym{ASCII} graphics is an efficient way to get
2055 everybody to believe that you are silly and have nothing important to
2056 say.
2057
2058
2059 @node Various Message Variables
2060 @section Various Message Variables
2061
2062 @table @code
2063 @item message-default-charset
2064 @vindex message-default-charset
2065 @cindex charset
2066 Symbol naming a @acronym{MIME} charset.  Non-@acronym{ASCII} characters
2067 in messages are assumed to be encoded using this charset.  The default
2068 is @code{iso-8859-1} on non-@sc{mule} Emacsen; otherwise @code{nil},
2069 which means ask the user.  (This variable is used only on non-@sc{mule}
2070 Emacsen.)  @xref{Charset Translation, , Charset Translation, emacs-mime,
2071 Emacs MIME Manual}, for details on the @sc{mule}-to-@acronym{MIME}
2072 translation process.
2073
2074 @item message-fill-column
2075 @vindex message-fill-column
2076 @cindex auto-fill
2077 Local value for the column beyond which automatic line-wrapping should
2078 happen for message buffers.  If non-nil (the default), also turn on
2079 auto-fill in message buffers.
2080
2081 @item message-signature-separator
2082 @vindex message-signature-separator
2083 Regexp matching the signature separator.  It is @samp{^-- *$} by
2084 default.
2085
2086 @item mail-header-separator
2087 @vindex mail-header-separator
2088 String used to separate the headers from the body.  It is @samp{--text
2089 follows this line--} by default.
2090
2091 @item message-directory
2092 @vindex message-directory
2093 Directory used by many mailey things.  The default is @file{~/Mail/}.
2094 All other mail file variables are derived from @code{message-directory}.
2095
2096 @item message-auto-save-directory
2097 @vindex message-auto-save-directory
2098 Directory where Message auto-saves buffers if Gnus isn't running.  If
2099 @code{nil}, Message won't auto-save.  The default is @file{~/Mail/drafts/}.
2100
2101 @item message-signature-setup-hook
2102 @vindex message-signature-setup-hook
2103 Hook run when initializing the message buffer.  It is run after the
2104 headers have been inserted but before the signature has been inserted.
2105
2106 @item message-setup-hook
2107 @vindex message-setup-hook
2108 Hook run as the last thing when the message buffer has been initialized,
2109 but before yanked text is inserted.
2110
2111 @item message-header-setup-hook
2112 @vindex message-header-setup-hook
2113 Hook called narrowed to the headers after initializing the headers.
2114
2115 For instance, if you're running Gnus and wish to insert a
2116 @samp{Mail-Copies-To} header in all your news articles and all messages
2117 you send to mailing lists, you could do something like the following:
2118
2119 @lisp
2120 (defun my-message-header-setup-hook ()
2121   (let ((group (or gnus-newsgroup-name "")))
2122     (when (or (message-fetch-field "newsgroups")
2123               (gnus-group-find-parameter group 'to-address)
2124               (gnus-group-find-parameter group 'to-list))
2125       (insert "Mail-Copies-To: never\n"))))
2126
2127 (add-hook 'message-header-setup-hook
2128           'my-message-header-setup-hook)
2129 @end lisp
2130
2131 @item message-send-hook
2132 @vindex message-send-hook
2133 Hook run before sending messages.
2134
2135 If you want to add certain headers before sending, you can use the
2136 @code{message-add-header} function in this hook.  For instance:
2137 @findex message-add-header
2138
2139 @lisp
2140 (add-hook 'message-send-hook 'my-message-add-content)
2141 (defun my-message-add-content ()
2142   (message-add-header "X-In-No-Sense: Nonsense")
2143   (message-add-header "X-Whatever: no"))
2144 @end lisp
2145
2146 This function won't add the header if the header is already present.
2147
2148 @item message-send-mail-hook
2149 @vindex message-send-mail-hook
2150 Hook run before sending mail messages.  This hook is run very late --
2151 just before the message is actually sent as mail.
2152
2153 @item message-send-news-hook
2154 @vindex message-send-news-hook
2155 Hook run before sending news messages.  This hook is run very late --
2156 just before the message is actually sent as news.
2157
2158 @item message-sent-hook
2159 @vindex message-sent-hook
2160 Hook run after sending messages.
2161
2162 @item message-cancel-hook
2163 @vindex message-cancel-hook
2164 Hook run when canceling news articles.
2165
2166 @item message-mode-syntax-table
2167 @vindex message-mode-syntax-table
2168 Syntax table used in message mode buffers.
2169
2170 @item message-cite-articles-with-x-no-archive
2171 @vindex message-cite-articles-with-x-no-archive
2172 If non-@code{nil}, don't strip quoted text from articles that have
2173 @samp{X-No-Archive} set.  Even if this variable isn't set, you can
2174 undo the stripping by hitting the @code{undo} keystroke.
2175
2176 @item message-strip-special-text-properties
2177 @vindex message-strip-special-text-properties
2178 Emacs has a number of special text properties which can break message
2179 composing in various ways.  If this option is set, message will strip
2180 these properties from the message composition buffer.  However, some
2181 packages requires these properties to be present in order to work.  If
2182 you use one of these packages, turn this option off, and hope the
2183 message composition doesn't break too bad.
2184
2185 @item message-send-method-alist
2186 @vindex message-send-method-alist
2187 @findex message-mail-p
2188 @findex message-news-p
2189 @findex message-send-via-mail
2190 @findex message-send-via-news
2191 Alist of ways to send outgoing messages.  Each element has the form:
2192
2193 @lisp
2194 (@var{type} @var{predicate} @var{function})
2195 @end lisp
2196
2197 @table @var
2198 @item type
2199 A symbol that names the method.
2200
2201 @item predicate
2202 A function called without any parameters to determine whether the
2203 message is a message of type @var{type}.  The function will be called in
2204 the buffer where the message is.
2205
2206 @item function
2207 A function to be called if @var{predicate} returns non-@code{nil}.
2208 @var{function} is called with one parameter---the prefix.
2209 @end table
2210
2211 The default is:
2212
2213 @lisp
2214 ((news message-news-p message-send-via-news)
2215  (mail message-mail-p message-send-via-mail))
2216 @end lisp
2217
2218 The @code{message-news-p} function returns non-@code{nil} if the message
2219 looks like news, and the @code{message-send-via-news} function sends the
2220 message according to the @code{message-send-news-function} variable
2221 (@pxref{News Variables}).  The @code{message-mail-p} function returns
2222 non-@code{nil} if the message looks like mail, and the
2223 @code{message-send-via-mail} function sends the message according to the
2224 @code{message-send-mail-function} variable (@pxref{Mail Variables}).
2225
2226 All the elements in this alist will be tried in order, so a message
2227 containing both a valid @samp{Newsgroups} header and a valid @samp{To}
2228 header, for example, will be sent as news, and then as mail.
2229 @end table
2230
2231
2232
2233 @node Sending Variables
2234 @section Sending Variables
2235
2236 @table @code
2237
2238 @item message-fcc-handler-function
2239 @vindex message-fcc-handler-function
2240 A function called to save outgoing articles.  This function will be
2241 called with the name of the file to store the article in.  The default
2242 function is @code{message-output} which saves in Unix mailbox format.
2243
2244 @item message-courtesy-message
2245 @vindex message-courtesy-message
2246 When sending combined messages, this string is inserted at the start of
2247 the mailed copy.  If the string contains the format spec @samp{%s}, the
2248 newsgroups the article has been posted to will be inserted there.  If
2249 this variable is @code{nil}, no such courtesy message will be added.
2250 The default value is @samp{"The following message is a courtesy copy of
2251 an article\\nthat has been posted to %s as well.\\n\\n"}.
2252
2253 @item message-fcc-externalize-attachments
2254 @vindex message-fcc-externalize-attachments
2255 If @code{nil}, attach files as normal parts in Fcc copies; if it is
2256 non-@code{nil}, attach local files as external parts.
2257
2258 @item message-interactive
2259 @vindex message-interactive
2260 If non-@code{nil} wait for and display errors when sending a message;
2261 if @code{nil} let the mailer mail back a message to report errors.
2262
2263 @item message-confirm-send
2264 @vindex message-confirm-send
2265 When non-@code{nil}, Gnus will ask for confirmation when sending a
2266 message.
2267
2268 @end table
2269
2270
2271 @node Message Buffers
2272 @section Message Buffers
2273
2274 Message will generate new buffers with unique buffer names when you
2275 request a message buffer.  When you send the message, the buffer isn't
2276 normally killed off.  Its name is changed and a certain number of old
2277 message buffers are kept alive.
2278
2279 @table @code
2280 @item message-generate-new-buffers
2281 @vindex message-generate-new-buffers
2282 Controls whether to create a new message buffer to compose a message.
2283 Valid values include:
2284
2285 @table @code
2286 @item nil
2287 Generate the buffer name in the Message way (e.g., *mail*, *news*, *mail
2288 to whom*, *news on group*, etc.) and continue editing in the existing
2289 buffer of that name.  If there is no such buffer, it will be newly
2290 created.
2291
2292 @item unique
2293 @item t
2294 Create the new buffer with the name generated in the Message way.  This
2295 is the default.
2296
2297 @item unsent
2298 Similar to @code{unique} but the buffer name begins with "*unsent ".
2299
2300 @item standard
2301 Similar to @code{nil} but the buffer name is simpler like *mail
2302 message*.
2303 @end table
2304 @table @var
2305 @item function
2306 If this is a function, call that function with three parameters: The
2307 type, the To address and the group name (any of these may be
2308 @code{nil}).  The function should return the new buffer name.
2309 @end table
2310
2311 The default value is @code{unique}.
2312
2313 @item message-max-buffers
2314 @vindex message-max-buffers
2315 This variable says how many old message buffers to keep.  If there are
2316 more message buffers than this, the oldest buffer will be killed.  The
2317 default is 10.  If this variable is @code{nil}, no old message buffers
2318 will ever be killed.
2319
2320 @item message-send-rename-function
2321 @vindex message-send-rename-function
2322 After sending a message, the buffer is renamed from, for instance,
2323 @samp{*reply to Lars*} to @samp{*sent reply to Lars*}.  If you don't
2324 like this, set this variable to a function that renames the buffer in a
2325 manner you like.  If you don't want to rename the buffer at all, you can
2326 say:
2327
2328 @lisp
2329 (setq message-send-rename-function 'ignore)
2330 @end lisp
2331
2332 @item message-kill-buffer-on-exit
2333 @findex message-kill-buffer-on-exit
2334 If non-@code{nil}, kill the buffer immediately on exit.
2335
2336 @end table
2337
2338
2339 @node Message Actions
2340 @section Message Actions
2341
2342 When Message is being used from a news/mail reader, the reader is likely
2343 to want to perform some task after the message has been sent.  Perhaps
2344 return to the previous window configuration or mark an article as
2345 replied.
2346
2347 @vindex message-kill-actions
2348 @vindex message-postpone-actions
2349 @vindex message-exit-actions
2350 @vindex message-send-actions
2351 The user may exit from the message buffer in various ways.  The most
2352 common is @kbd{C-c C-c}, which sends the message and exits.  Other
2353 possibilities are @kbd{C-c C-s} which just sends the message, @kbd{C-c
2354 C-d} which postpones the message editing and buries the message buffer,
2355 and @kbd{C-c C-k} which kills the message buffer.  Each of these actions
2356 have lists associated with them that contains actions to be executed:
2357 @code{message-send-actions}, @code{message-exit-actions},
2358 @code{message-postpone-actions}, and @code{message-kill-actions}.
2359
2360 Message provides a function to interface with these lists:
2361 @code{message-add-action}.  The first parameter is the action to be
2362 added, and the rest of the arguments are which lists to add this action
2363 to.  Here's an example from Gnus:
2364
2365 @lisp
2366   (message-add-action
2367    `(set-window-configuration ,(current-window-configuration))
2368    'exit 'postpone 'kill)
2369 @end lisp
2370
2371 This restores the Gnus window configuration when the message buffer is
2372 killed, postponed or exited.
2373
2374 An @dfn{action} can be either: a normal function, or a list where the
2375 @sc{car} is a function and the @sc{cdr} is the list of arguments, or
2376 a form to be @code{eval}ed.
2377
2378
2379 @node Compatibility
2380 @chapter Compatibility
2381 @cindex compatibility
2382
2383 Message uses virtually only its own variables---older @code{mail-}
2384 variables aren't consulted.  To force Message to take those variables
2385 into account, you can put the following in your @file{.emacs} file:
2386
2387 @lisp
2388 (require 'messcompat)
2389 @end lisp
2390
2391 This will initialize many Message variables from the values in the
2392 corresponding mail variables.
2393
2394
2395 @node Appendices
2396 @chapter Appendices
2397
2398 @menu
2399 * Responses::          Standard rules for determining where responses go.
2400 @end menu
2401
2402
2403 @node Responses
2404 @section Responses
2405
2406 To determine where a message is to go, the following algorithm is used
2407 by default.
2408
2409 @table @dfn
2410 @item reply
2411 A @dfn{reply} is when you want to respond @emph{just} to the person who
2412 sent the message via mail.  There will only be one recipient.  To
2413 determine who the recipient will be, the following headers are
2414 consulted, in turn:
2415
2416 @table @code
2417 @item Reply-To
2418
2419 @item From
2420 @end table
2421
2422
2423 @item wide reply
2424 A @dfn{wide reply} is a mail response that includes @emph{all} entities
2425 mentioned in the message you are responding to.  All mailboxes from the
2426 following headers will be concatenated to form the outgoing
2427 @code{To}/@code{Cc} headers:
2428
2429 @table @code
2430 @item From
2431 (unless there's a @code{Reply-To}, in which case that is used instead).
2432
2433 @item Cc
2434
2435 @item To
2436 @end table
2437
2438 If a @code{Mail-Copies-To} header is present, it will also be included
2439 in the list of mailboxes.  If this header is @samp{never}, that means
2440 that the @code{From} (or @code{Reply-To}) mailbox will be suppressed.
2441
2442
2443 @item followup
2444 A @dfn{followup} is a response sent via news.  The following headers
2445 (listed in order of precedence) determine where the response is to be
2446 sent:
2447
2448 @table @code
2449
2450 @item Followup-To
2451
2452 @item Newsgroups
2453
2454 @end table
2455
2456 If a @code{Mail-Copies-To} header is present, it will be used as the
2457 basis of the new @code{Cc} header, except if this header is
2458 @samp{never}.
2459
2460 @end table
2461
2462
2463 @node GNU Free Documentation License
2464 @chapter GNU Free Documentation License
2465 @include doclicense.texi
2466
2467 @node Index
2468 @chapter Index
2469 @printindex cp
2470
2471 @node Key Index
2472 @chapter Key Index
2473 @printindex ky
2474
2475 @bye
2476
2477 @c End: