Comment out description of re-builder.
[bpt/emacs.git] / man / sending.texi
CommitLineData
6bf7aab6 1@c This is part of the Emacs manual.
6ca0edfe
DL
2@c Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 2000
3@c Free Software Foundation, Inc.
6bf7aab6
DL
4@c See file emacs.texi for copying conditions.
5@node Sending Mail, Rmail, Picture, Top
6@chapter Sending Mail
7@cindex sending mail
8@cindex mail
9@cindex message
10
11 To send a message in Emacs, you start by typing a command (@kbd{C-x m})
12to select and initialize the @samp{*mail*} buffer. Then you edit the text
13and headers of the message in this buffer, and type another command
14(@kbd{C-c C-s} or @kbd{C-c C-c}) to send the message.
15
16@table @kbd
17@item C-x m
18Begin composing a message to send (@code{compose-mail}).
19@item C-x 4 m
20Likewise, but display the message in another window
21(@code{compose-mail-other-window}).
22@item C-x 5 m
23Likewise, but make a new frame (@code{compose-mail-other-frame}).
24@item C-c C-s
25In Mail mode, send the message (@code{mail-send}).
26@item C-c C-c
27Send the message and bury the mail buffer (@code{mail-send-and-exit}).
28@end table
29
30@kindex C-x m
31@findex compose-mail
32@kindex C-x 4 m
33@findex compose-mail-other-window
34@kindex C-x 5 m
35@findex compose-mail-other-frame
36 The command @kbd{C-x m} (@code{compose-mail}) selects a buffer named
37@samp{*mail*} and initializes it with the skeleton of an outgoing
38message. @kbd{C-x 4 m} (@code{compose-mail-other-window}) selects the
39@samp{*mail*} buffer in a different window, leaving the previous current
40buffer visible. @kbd{C-x 5 m} (@code{compose-mail-other-frame}) creates
41a new frame to select the @samp{*mail*} buffer.
42
43 Because the mail-composition buffer is an ordinary Emacs buffer, you can
44switch to other buffers while in the middle of composing mail, and switch
45back later (or never). If you use the @kbd{C-x m} command again when you
46have been composing another message but have not sent it, you are asked to
47confirm before the old message is erased. If you answer @kbd{n}, the
48@samp{*mail*} buffer is left selected with its old contents, so you can
49finish the old message and send it. @kbd{C-u C-x m} is another way to do
50this. Sending the message marks the @samp{*mail*} buffer ``unmodified,''
51which avoids the need for confirmation when @kbd{C-x m} is next used.
52
53 If you are composing a message in the @samp{*mail*} buffer and want to
54send another message before finishing the first, rename the
55@samp{*mail*} buffer using @kbd{M-x rename-uniquely} (@pxref{Misc
56Buffer}). Then you can use @kbd{C-x m} or its variants described above
57to make a new @samp{*mail*} buffer. Once you've done that, you can work
58with each mail buffer independently.
59
c016c701
DL
60@cindex directory servers
61@cindex LDAP
62@cindex PH/QI
63@cindex names and addresses
64There is an interface to directory servers using various protocols such
65as LDAP or the CCSO white pages directory system (PH/QI), described in a
66separate manual. It may be useful for looking up names and addresses.
67@xref{Top,,EUDC, eudc, EUDC Manual}.
68
6bf7aab6
DL
69@menu
70* Format: Mail Format. Format of the mail being composed.
71* Headers: Mail Headers. Details of permitted mail header fields.
72* Aliases: Mail Aliases. Abbreviating and grouping mail addresses.
73* Mode: Mail Mode. Special commands for editing mail being composed.
74* Spook: Distracting NSA. How to distract the NSA's attention.
58eca4a5
DL
75* Fortune:: `Fortune' items in signatures.
76* Footnotes: Mail Footnotes. Making footnotes in messages.
2394fd21 77* Methods: Mail Methods. Using alternative mail-composition methods.
6bf7aab6
DL
78@end menu
79
80@node Mail Format
81@section The Format of the Mail Buffer
82
83 In addition to the @dfn{text} or @dfn{body}, a message has @dfn{header
84fields} which say who sent it, when, to whom, why, and so on. Some
85header fields, such as @samp{Date} and @samp{Sender}, are created
86automatically when you send the message. Others, such as the recipient
87names, must be specified by you in order to send the message properly.
88
89 Mail mode provides a few commands to help you edit some header fields,
90and some are preinitialized in the buffer automatically at times. You can
91insert and edit header fields using ordinary editing commands.
92
93 The line in the buffer that says
94
95@example
96--text follows this line--
97@end example
98
99@noindent
100is a special delimiter that separates the headers you have specified from
101the text. Whatever follows this line is the text of the message; the
102headers precede it. The delimiter line itself does not appear in the
103message actually sent. The text used for the delimiter line is controlled
104by the variable @code{mail-header-separator}.
105
106Here is an example of what the headers and text in the mail buffer
107might look like.
108
109@example
110To: gnu@@gnu.org
111CC: lungfish@@spam.org, byob@@spam.org
112Subject: The Emacs Manual
113--Text follows this line--
114Please ignore this message.
115@end example
116
117@node Mail Headers
118@section Mail Header Fields
119@cindex headers (of mail message)
120
121 A header field in the mail buffer starts with a field name at the
122beginning of a line, terminated by a colon. Upper and lower case are
123equivalent in field names (and in mailing addresses also). After the
124colon and optional whitespace comes the contents of the field.
125
126 You can use any name you like for a header field, but normally people
127use only standard field names with accepted meanings. Here is a table
128of fields commonly used in outgoing messages.
129
130@table @samp
131@item To
132This field contains the mailing addresses to which the message is
133addressed. If you list more than one address, use commas, not spaces,
134to separate them.
135
136@item Subject
137The contents of the @samp{Subject} field should be a piece of text
138that says what the message is about. The reason @samp{Subject} fields
139are useful is that most mail-reading programs can provide a summary of
140messages, listing the subject of each message but not its text.
141
142@item CC
143This field contains additional mailing addresses to send the message to,
144like @samp{To} except that these readers should not regard the message
145as directed at them.
146
147@item BCC
148This field contains additional mailing addresses to send the message to,
149which should not appear in the header of the message actually sent.
150Copies sent this way are called @dfn{blind carbon copies}.
151
152@vindex mail-self-blind
c7fa86d5 153@cindex copy of every outgoing message
6bf7aab6 154To send a blind carbon copy of every outgoing message to yourself, set
c7fa86d5
EZ
155the variable @code{mail-self-blind} to @code{t}. To send a blind carbon
156copy of every message to some other @var{address}, set the variable
157@code{mail-default-headers} to @samp{"Bcc: @var{address}\n"}.
6bf7aab6
DL
158
159@item FCC
160This field contains the name of one file and directs Emacs to append a
161copy of the message to that file when you send the message. If the file
162is in Rmail format, Emacs writes the message in Rmail format; otherwise,
163Emacs writes the message in system mail file format.
164
165@vindex mail-archive-file-name
166To put a fixed file name in the @samp{FCC} field each time you start
167editing an outgoing message, set the variable
168@code{mail-archive-file-name} to that file name. Unless you remove the
169@samp{FCC} field before sending, the message will be written into that
170file when it is sent.
171
172@item From
173Use the @samp{From} field to say who you are, when the account you are
174using to send the mail is not your own. The contents of the @samp{From}
175field should be a valid mailing address, since replies will normally go
176there. If you don't specify the @samp{From} field yourself, Emacs uses
177the value of @code{user-mail-address} as the default.
178
179@item Reply-to
180Use this field to direct replies to a different address. Most
181mail-reading programs (including Rmail) automatically send replies to
182the @samp{Reply-to} address in preference to the @samp{From} address.
183By adding a @samp{Reply-to} field to your header, you can work around
184any problems your @samp{From} address may cause for replies.
185
60a96371 186@cindex @env{REPLYTO} environment variable
6bf7aab6
DL
187@vindex mail-default-reply-to
188To put a fixed @samp{Reply-to} address into every outgoing message, set
189the variable @code{mail-default-reply-to} to that address (as a string).
190Then @code{mail} initializes the message with a @samp{Reply-to} field as
191specified. You can delete or alter that header field before you send
192the message, if you wish. When Emacs starts up, if the environment
60a96371 193variable @env{REPLYTO} is set, @code{mail-default-reply-to} is
6bf7aab6
DL
194initialized from that environment variable.
195
196@item In-reply-to
197This field contains a piece of text describing a message you are
198replying to. Some mail systems can use this information to correlate
199related pieces of mail. Normally this field is filled in by Rmail
200when you reply to a message in Rmail, and you never need to
201think about it (@pxref{Rmail}).
202
203@item References
204This field lists the message IDs of related previous messages. Rmail
205sets up this field automatically when you reply to a message.
206@end table
207
208 The @samp{To}, @samp{CC}, @samp{BCC} and @samp{FCC} header fields can
209appear any number of times, and each such header field can contain
210multiple addresses, separated by commas. This way, you can specify any
211number of places to send the message. A @samp{To}, @samp{CC}, or
212@samp{BCC} field can also have continuation lines: one or more lines
213starting with whitespace, following the starting line of the field, are
214considered part of the field. Here's an example of a @samp{To} field
215with a continuation line:@refill
216
217@example
218@group
219To: foo@@here.net, this@@there.net,
220 me@@gnu.cambridge.mass.usa.earth.spiral3281
221@end group
222@end example
223
224@vindex mail-from-style
225 When you send the message, if you didn't write a @samp{From} field
226yourself, Emacs puts in one for you. The variable
227@code{mail-from-style} controls the format:
228
229@table @code
230@item nil
231Use just the email address, as in @samp{king@@grassland.com}.
232@item parens
233Use both email address and full name, as in @samp{king@@grassland.com (Elvis
234Parsley)}.
235@item angles
236Use both email address and full name, as in @samp{Elvis Parsley
237<king@@grassland.com>}.
238@item system-default
239Allow the system to insert the @samp{From} field.
240@end table
241
c7fa86d5
EZ
242@vindex mail-default-headers
243 You can force Emacs to insert specific headers into the outgoing
244message by customizing the variable @code{mail-default-headers}. Its
245value as a string is inserted before you edit the message.
246
6bf7aab6
DL
247@node Mail Aliases
248@section Mail Aliases
249@cindex mail aliases
250@cindex @file{.mailrc} file
251@cindex mailrc file
252
253 You can define @dfn{mail aliases} in a file named @file{~/.mailrc}.
254These are short mnemonic names which stand for mail addresses or groups of
255mail addresses. Like many other mail programs, Emacs expands aliases
256when they occur in the @samp{To}, @samp{From}, @samp{CC}, @samp{BCC}, and
257@samp{Reply-to} fields, plus their @samp{Resent-} variants.
258
259 To define an alias in @file{~/.mailrc}, write a line in the following
260format:
261
262@example
263alias @var{shortaddress} @var{fulladdresses}
264@end example
265
266@noindent
267Here @var{fulladdresses} stands for one or more mail addresses for
268@var{shortaddress} to expand into. Separate multiple addresses with
269spaces; if an address contains a space, quote the whole address with a
270pair of double-quotes.
271
272For instance, to make @code{maingnu} stand for
273@code{gnu@@gnu.org} plus a local address of your own, put in
274this line:@refill
275
276@example
277alias maingnu gnu@@gnu.org local-gnu
278@end example
279
280 Emacs also recognizes include commands in @samp{.mailrc} files.
281They look like this:
282
283@example
284source @var{filename}
285@end example
286
287@noindent
288The file @file{~/.mailrc} is used primarily by other mail-reading
289programs; it can contain various other commands. Emacs ignores
290everything in it except for alias definitions and include commands.
291
292@findex define-mail-alias
293 Another way to define a mail alias, within Emacs alone, is with the
294@code{define-mail-alias} command. It prompts for the alias and then the
295full address. You can use it to define aliases in your @file{.emacs}
296file, like this:
297
298@example
299(define-mail-alias "maingnu" "gnu@@gnu.org")
300@end example
301
302@vindex mail-aliases
303 @code{define-mail-alias} records aliases by adding them to a
304variable named @code{mail-aliases}. If you are comfortable with
305manipulating Lisp lists, you can set @code{mail-aliases} directly. The
306initial value of @code{mail-aliases} is @code{t}, which means that
307Emacs should read @file{.mailrc} to get the proper value.
308
309@vindex mail-personal-alias-file
310 You can specify a different file name to use instead of
311@file{~/.mailrc} by setting the variable
312@code{mail-personal-alias-file}.
313
314@findex expand-mail-aliases
315 Normally, Emacs expands aliases when you send the message. You do not
316need to expand mail aliases before sending the message, but you can
317expand them if you want to see where the mail will actually go. To do
318this, use the command @kbd{M-x expand-mail-aliases}; it expands all mail
319aliases currently present in the mail headers that hold addresses.
320
321 If you like, you can have mail aliases expand as abbrevs, as soon as
322you type them in (@pxref{Abbrevs}). To enable this feature, execute the
323following:
324
325@example
49172314 326(add-hook 'mail-mode-hook 'mail-abbrevs-setup)
6bf7aab6
DL
327@end example
328
329@noindent
330@findex define-mail-abbrev
331@vindex mail-abbrevs
332This can go in your @file{.emacs} file. @xref{Hooks}. If you use this
333feature, you must use @code{define-mail-abbrev} instead of
334@code{define-mail-alias}; the latter does not work with this package.
335Note that the mail abbreviation package uses the variable
336@code{mail-abbrevs} instead of @code{mail-aliases}, and that all alias
337names are converted to lower case.
338
339@kindex C-c C-a @r{(Mail mode)}
340@findex mail-interactive-insert-alias
341 The mail abbreviation package also provides the @kbd{C-c C-a}
342(@code{mail-interactive-insert-alias}) command, which reads an alias
343name (with completion) and inserts its definition at point. This is
344useful when editing the message text itself or a header field such as
345@samp{Subject} in which Emacs does not normally expand aliases.
346
347 Note that abbrevs expand only if you insert a word-separator character
348afterward. However, you can rebind @kbd{C-n} and @kbd{M->} to cause
349expansion as well. Here's how to do that:
350
351@smallexample
49172314 352(add-hook 'mail-mode-hook
43aef553
SM
353 (lambda ()
354 (substitute-key-definition
355 'next-line 'mail-abbrev-next-line
356 mail-mode-map global-map)
357 (substitute-key-definition
358 'end-of-buffer 'mail-abbrev-end-of-buffer
359 mail-mode-map global-map)))
6bf7aab6
DL
360@end smallexample
361
362@node Mail Mode
363@section Mail Mode
364@cindex Mail mode
365@cindex mode, Mail
366
367 The major mode used in the mail buffer is Mail mode, which is much
368like Text mode except that various special commands are provided on the
369@kbd{C-c} prefix. These commands all have to do specifically with
370editing or sending the message. In addition, Mail mode defines the
371character @samp{%} as a word separator; this is helpful for using the
372word commands to edit mail addresses.
373
374 Mail mode is normally used in buffers set up automatically by the
375@code{mail} command and related commands. However, you can also switch
376to Mail mode in a file-visiting buffer. That is a useful thing to do if
377you have saved draft message text in a file.
378
379@menu
380* Mail Sending:: Commands to send the message.
381* Header Editing:: Commands to move to header fields and edit them.
382* Citing Mail:: Copying all or part of a message you are replying to.
383* Mail Mode Misc:: Spell checking, signatures, etc.
384@end menu
385
386@node Mail Sending
387@subsection Mail Sending
388
389 Mail mode has two commands for sending the message you have been
390editing:
391
392@table @kbd
393@item C-c C-s
394Send the message, and leave the mail buffer selected (@code{mail-send}).
395@item C-c C-c
396Send the message, and select some other buffer (@code{mail-send-and-exit}).
397@end table
398
399@kindex C-c C-s @r{(Mail mode)}
400@kindex C-c C-c @r{(Mail mode)}
401@findex mail-send
402@findex mail-send-and-exit
403 @kbd{C-c C-s} (@code{mail-send}) sends the message and marks the mail
404buffer unmodified, but leaves that buffer selected so that you can
405modify the message (perhaps with new recipients) and send it again.
406@kbd{C-c C-c} (@code{mail-send-and-exit}) sends and then deletes the
407window or switches to another buffer. It puts the mail buffer at the
408lowest priority for reselection by default, since you are finished with
409using it. This is the usual way to send the message.
410
411 In a file-visiting buffer, sending the message does not clear the
412modified flag, because only saving the file should do that. As a
413result, you don't get a warning if you try to send the same message
414twice.
415
416@vindex sendmail-coding-system
417 When you send a message that contains non-ASCII characters, they need
418to be encoded with a coding system (@pxref{Coding Systems}). Usually
419the coding system is specified automatically by your chosen language
420environment (@pxref{Language Environments}). You can explicitly specify
421the coding system for outgoing mail by setting the variable
422@code{sendmail-coding-system}.
423
424 If the coding system thus determined does not handle the characters in
425a particular message, Emacs asks you to select the coding system to use,
426showing a list of possible coding systems.
427
428@node Header Editing
429@subsection Mail Header Editing
430
431 Mail mode provides special commands to move to particular header
432fields and to complete addresses in headers.
433
434@table @kbd
435@item C-c C-f C-t
436Move to the @samp{To} header field, creating one if there is none
437(@code{mail-to}).
438@item C-c C-f C-s
439Move to the @samp{Subject} header field, creating one if there is
440none (@code{mail-subject}).
441@item C-c C-f C-c
442Move to the @samp{CC} header field, creating one if there is none
443(@code{mail-cc}).
444@item C-c C-f C-b
445Move to the @samp{BCC} header field, creating one if there is none
446(@code{mail-bcc}).
447@item C-c C-f C-f
448Move to the @samp{FCC} header field, creating one if there is none
449(@code{mail-fcc}).
450@item M-@key{TAB}
451Complete a mailing address (@code{mail-complete}).
452@end table
453
454@kindex C-c C-f C-t @r{(Mail mode)}
455@findex mail-to
456@kindex C-c C-f C-s @r{(Mail mode)}
457@findex mail-subject
458@kindex C-c C-f C-c @r{(Mail mode)}
459@findex mail-cc
460@kindex C-c C-f C-b @r{(Mail mode)}
461@findex mail-bcc
462@kindex C-c C-f C-f @r{(Mail mode)}
463@findex mail-fcc
464 There are five commands to move point to particular header fields, all
465based on the prefix @kbd{C-c C-f} (@samp{C-f} is for ``field''). They
466are listed in the table above. If the field in question does not exist,
467these commands create one. We provide special motion commands for these
468particular fields because they are the fields users most often want to
469edit.
470
471@findex mail-complete
472@kindex M-TAB @r{(Mail mode)}
473 While editing a header field that contains mailing addresses, such as
474@samp{To:}, @samp{CC:} and @samp{BCC:}, you can complete a mailing
475address by typing @kbd{M-@key{TAB}} (@code{mail-complete}). It inserts
476the full name corresponding to the address, if it can determine the full
477name. The variable @code{mail-complete-style} controls whether to insert
478the full name, and what style to use, as in @code{mail-from-style}
479(@pxref{Mail Headers}).
480
481 For completion purposes, the valid mailing addresses are taken to be
482the local users' names plus your personal mail aliases. You can specify
483additional sources of valid addresses; use the customization buffer
484to see the options for this.
485
486 If you type @kbd{M-@key{TAB}} in the body of the message, it invokes
487@code{ispell-complete-word}, as in Text mode.
488
489@node Citing Mail
490@subsection Citing Mail
491@cindex citing mail
492
493 Mail mode also has commands for yanking or @dfn{citing} all or part of
494a message that you are replying to. These commands are active only when
495you started sending a message using an Rmail command.
496
497@table @kbd
498@item C-c C-y
499Yank the selected message from Rmail (@code{mail-yank-original}).
500@item C-c C-r
501Yank the region from the Rmail buffer (@code{mail-yank-region}).
502@item C-c C-q
503Fill each paragraph cited from another message
504(@code{mail-fill-yanked-message}).
505@end table
506
507@kindex C-c C-y @r{(Mail mode)}
508@findex mail-yank-original
509 When mail sending is invoked from the Rmail mail reader using an Rmail
510command, @kbd{C-c C-y} can be used inside the mail buffer to insert
511the text of the message you are replying to. Normally it indents each line
512of that message three spaces and eliminates most header fields. A numeric
513argument specifies the number of spaces to indent. An argument of just
514@kbd{C-u} says not to indent at all and not to eliminate anything.
515@kbd{C-c C-y} always uses the current message from the Rmail buffer,
516so you can insert several old messages by selecting one in Rmail,
517switching to @samp{*mail*} and yanking it, then switching back to
518Rmail to select another.
519
520@vindex mail-yank-prefix
521 You can specify the text for @kbd{C-c C-y} to insert at the beginning
522of each line: set @code{mail-yank-prefix} to the desired string. (A
523value of @code{nil} means to use indentation; this is the default.)
524However, @kbd{C-u C-c C-y} never adds anything at the beginning of the
525inserted lines, regardless of the value of @code{mail-yank-prefix}.
526
527@kindex C-c C-r @r{(Mail mode)}
528@findex mail-yank-region
529 To yank just a part of an incoming message, set the region in Rmail to
530the part you want; then go to the @samp{*Mail*} message and type
531@kbd{C-c C-r} (@code{mail-yank-region}). Each line that is copied is
532indented or prefixed according to @code{mail-yank-prefix}.
533
534@kindex C-c C-q @r{(Mail mode)}
535@findex mail-fill-yanked-message
536 After using @kbd{C-c C-y} or @kbd{C-c C-r}, you can type @kbd{C-c C-q}
537(@code{mail-fill-yanked-message}) to fill the paragraphs of the yanked
538old message or messages. One use of @kbd{C-c C-q} fills all such
539paragraphs, each one individually. To fill a single paragraph of the
540quoted message, use @kbd{M-q}. If filling does not automatically
541handle the type of citation prefix you use, try setting the fill prefix
542explicitly. @xref{Filling}.
543
544@node Mail Mode Misc
545@subsection Mail Mode Miscellany
546
547@table @kbd
548@item C-c C-t
549Move to the beginning of the message body text (@code{mail-text}).
550@item C-c C-w
551Insert the file @file{~/.signature} at the end of the message text
552(@code{mail-signature}).
553@item C-c C-i @var{file} @key{RET}
554Insert the contents of @var{file} at the end of the outgoing message
555(@code{mail-attach-file}).
556@item M-x ispell-message
557Do spelling correction on the message text, but not on citations from
558other messages.
559@end table
560
561@kindex C-c C-t @r{(Mail mode)}
562@findex mail-text
563 @kbd{C-c C-t} (@code{mail-text}) moves point to just after the header
564separator line---that is, to the beginning of the message body text.
565
566@kindex C-c C-w @r{(Mail mode)}
567@findex mail-signature
568@vindex mail-signature
569 @kbd{C-c C-w} (@code{mail-signature}) adds a standard piece of text at
570the end of the message to say more about who you are. The text comes
571from the file @file{~/.signature} in your home directory. To insert
572your signature automatically, set the variable @code{mail-signature} to
573@code{t}; then starting a mail message automatically inserts the
574contents of your @file{~/.signature} file. If you want to omit your
575signature from a particular message, delete it from the buffer before
576you send the message.
577
578 You can also set @code{mail-signature} to a string; then that string
579is inserted automatically as your signature when you start editing a
580message to send. If you set it to some other Lisp expression, the
581expression is evaluated each time, and its value (which should be a
582string) specifies the signature.
583
584@findex ispell-message
585 You can do spelling correction on the message text you have written
586with the command @kbd{M-x ispell-message}. If you have yanked an
587incoming message into the outgoing draft, this command skips what was
588yanked, but it checks the text that you yourself inserted. (It looks
589for indentation or @code{mail-yank-prefix} to distinguish the cited
590lines from your input.) @xref{Spelling}.
591
592@kindex C-c C-i @r{(Mail mode)}
593@findex mail-attach-file
594 To include a file in the outgoing message, you can use @kbd{C-x i},
595the usual command to insert a file in the current buffer. But it is
596often more convenient to use a special command, @kbd{C-c C-i}
597(@code{mail-attach-file}). This command inserts the file contents at
598the end of the buffer, after your signature if any, with a delimiter
599line that includes the file name.
600
601@vindex mail-mode-hook
602@vindex mail-setup-hook
603 Turning on Mail mode (which @kbd{C-x m} does automatically) runs the
604normal hooks @code{text-mode-hook} and @code{mail-mode-hook}.
605Initializing a new outgoing message runs the normal hook
606@code{mail-setup-hook}; if you want to add special fields to your mail
607header or make other changes to the appearance of the mail buffer, use
608that hook. @xref{Hooks}.
609
610 The main difference between these hooks is just when they are
611invoked. Whenever you type @kbd{M-x mail}, @code{mail-mode-hook} runs
612as soon as the @samp{*mail*} buffer is created. Then the
613@code{mail-setup} function puts in the default contents of the buffer.
614After these default contents are inserted, @code{mail-setup-hook} runs.
615
616@node Distracting NSA
617@section Distracting the NSA
618
619@findex spook
620@cindex NSA
621 @kbd{M-x spook} adds a line of randomly chosen keywords to an outgoing
622mail message. The keywords are chosen from a list of words that suggest
623you are discussing something subversive.
624
2394fd21
DL
625 The idea behind this feature is the suspicion that the
626NSA@footnote{The US National Security Agency.} snoops on
6bf7aab6
DL
627all electronic mail messages that contain keywords suggesting they might
628find them interesting. (The NSA says they don't, but that's what they
629@emph{would} say.) The idea is that if lots of people add suspicious
630words to their messages, the NSA will get so busy with spurious input
631that they will have to give up reading it all.
632
633 Here's how to insert spook keywords automatically whenever you start
634entering an outgoing message:
635
636@example
1ee2a6d7 637(setq mail-signature '(spook))
6bf7aab6
DL
638@end example
639
640 Whether or not this confuses the NSA, it at least amuses people.
641
58eca4a5
DL
642@node Fortune
643@section Putting @code{fortune} Items in Signatures
644
645@pindex fortune
646@findex fortune-to-signature
647@findex fortune-from-region
648@cindex signatures, mail/news
649@cindex fortune cookies
2394fd21
DL
650You can use the @code{fortune} program to create signatures for mail or
651network news messages. (@code{fortune} prints a random---with luck,
652interesting---adage, originally inspired by `fortune cookie' messages.)
653To generate signatures, add @code{fortune-to-signature} to
654@code{mail-setup-hook} and/or @code{message-setup-hook} as appropriate.
655You can automatically cut regions to a Fortune file with @kbd{M-x
656fortune-from-region} and compile your own Fortune database.
58eca4a5
DL
657
658@node Mail Footnotes
659@section Making Footnotes
660@cindex footnotes
661
662@findex footnote-mode
663@kbd{M-x footnote-mode} toggles a minor mode for making footnotes in
664mail or network news messages. It is intended for use specifically with
665Message mode but is not specific to that. It provides commands and
666keybindings to insert footnotes, go to a given note, delete a note and
667renumber notes. See the group @code{footnote} for customization and the
668mode's documentation for keybindings. To set up Footnote mode for all
669messages, add @code{footnote-mode} to @code{mail-mode-hook} and/or
670@code{message-mode-hook} as appropriate.
671
6bf7aab6
DL
672@node Mail Methods
673@section Mail-Composition Methods
674@cindex mail-composition methods
675
676 This chapter describes the usual Emacs mode for editing and sending
677mail---Mail mode. Emacs has alternative facilities for editing and
26064e9b
DL
678sending mail, including
679@cindex MH mail interface
680@cindex Message mode for sending mail
681MH-E and Message mode, not documented in this manual.
682@xref{,MH-E,,mh-e, The Emacs Interface to MH}. @xref{,Message,,message,
683Message Manual}. You can choose any of them as your preferred method.
684The commands @code{C-x m}, @code{C-x 4 m} and @code{C-x 5 m} use
685whichever agent you have specified. So do various other Emacs commands
686and facilities that send mail.
6bf7aab6
DL
687
688@vindex mail-user-agent
37ad3ca0 689 To specify your mail-composition method, customize the variable
6bf7aab6 690@code{mail-user-agent}. Currently legitimate values include
37ad3ca0
DL
691@code{sendmail-user-agent}, @code{mh-e-user-agent},
692@code{message-user-agent} and @code{gnus-user-agent}.
6bf7aab6
DL
693
694 If you select a different mail-composition method, the information in
695this chapter about the @samp{*mail*} buffer and Mail mode does not
37ad3ca0
DL
696necessarily apply; other methods may use completely different commands
697with a different format in a differently named buffer.
6bf7aab6 698