]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/mail/mail.1
MFS: tweak my wording a little.
[FreeBSD/FreeBSD.git] / usr.bin / mail / mail.1
1 .\" Copyright (c) 1980, 1990, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)mail.1      8.2 (Berkeley) 12/30/93
33 .\" $FreeBSD$
34 .\"
35 .Dd December 30, 1993
36 .Dt MAIL 1
37 .Os BSD 4
38 .Sh NAME
39 .Nm mail
40 .Nd send and receive mail
41 .Sh SYNOPSIS
42 .Nm mail
43 .Op Fl iInv
44 .Op Fl s Ar subject
45 .Op Fl c Ar cc-addr
46 .Op Fl b Ar bcc-addr
47 .Ar to-addr ...
48 .Op \&- Ar sendmail-option ...
49 .Nm mail
50 .Op Fl iInNv
51 .Fl f
52 .Op Ar name
53 .Nm mail
54 .Op Fl iInNv
55 .Op Fl u Ar user
56 .Sh INTRODUCTION
57 .Nm Mail
58 is an intelligent mail processing system, which has
59 a command syntax reminiscent of
60 .Xr \&ed 1
61 with lines replaced by messages.
62 .Pp
63 .Bl -tag -width flag
64 .It Fl v
65 Verbose mode.
66 The details of
67 delivery are displayed on the user's terminal.
68 .It Fl i
69 Ignore tty interrupt signals.
70 This is
71 particularly useful when using
72 .Nm mail
73 on noisy phone lines.
74 .It Fl I
75 Forces mail to run in interactive mode even when
76 input isn't a terminal.
77 In particular, the
78 .Sq Ic \&~
79 special
80 character when sending mail is only active in interactive mode.
81 .It Fl n
82 Inhibits reading the system-wide
83 .Pa mail.rc
84 files upon startup.
85 .It Fl N
86 Inhibits the initial display of message headers
87 when reading mail or editing a mail folder.
88 .It Fl s
89 Specify subject on command line
90 (only the first argument after the
91 .Fl s
92 flag is used as a subject; be careful to quote subjects
93 containing spaces.)
94 .It Fl c
95 Send carbon copies to
96 .Ar list
97 of users.
98 .It Fl b
99 Send blind carbon copies to
100 .Ar list .
101 List should be a comma-separated list of names.
102 .It Fl f
103 Read in the contents of your
104 .Ar mbox
105 (or the specified file)
106 for processing; when you
107 .Ar quit  ,
108 .Nm mail
109 writes undeleted messages back to this file.
110 .It Fl u
111 Is equivalent to:
112 .Pp
113 .Dl mail -f /var/mail/user
114 .El
115 .Ss Sending mail
116 To send a message to one or more people,
117 .Nm mail
118 can be invoked with arguments which are the names of people to
119 whom the mail will be sent.
120 You are then expected to type in
121 your message, followed
122 by a
123 .Sq Li control\-D
124 at the beginning of a line.
125 The section below
126 .Ar Replying to or originating mail ,
127 describes some features of
128 .Nm mail
129 available to help you compose your letter.
130 .Pp
131 .Ss Reading mail
132 In normal usage
133 .Nm mail
134 is given no arguments and checks your mail out of the
135 post office, then
136 prints out a one line header of each message found.
137 The current message is initially the first message (numbered 1)
138 and can be printed using the
139 .Ic print
140 command (which can be abbreviated
141 .Ql Ic p ) .
142 You can move among the messages much as you move between lines in
143 .Xr \&ed 1 ,
144 with the commands
145 .Ql Ic \&+
146 and
147 .Ql Ic \&\-
148 moving backwards and forwards, and
149 simple numbers.
150 .Pp
151 .Ss Disposing of mail.
152 After examining a message you can
153 .Ic delete
154 .Pq Ic d
155 the message or
156 .Ic reply
157 .Pq Ic r
158 to it.
159 Deletion causes the
160 .Nm mail
161 program to forget about the message.
162 This is not irreversible; the message can be
163 .Ic undeleted
164 .Pq Ic u
165 by giving its number, or the
166 .Nm mail
167 session can be aborted by giving the
168 .Ic exit
169 .Pq Ic x
170 command.
171 Deleted messages will, however, usually disappear never to be seen again.
172 .Pp
173 .Ss Specifying messages
174 Commands such as
175 .Ic print
176 and
177 .Ic delete
178 can be given a list of message numbers as arguments to apply
179 to a number of messages at once.
180 Thus
181 .Dq Li delete 1 2
182 deletes messages 1 and 2, while
183 .Dq Li delete 1\-5
184 deletes messages 1 through 5.
185 The special name
186 .Ql Li \&*
187 addresses all messages, and
188 .Ql Li \&$
189 addresses
190 the last message; thus the command
191 .Ic top
192 which prints the first few lines of a message could be used in
193 .Dq Li top \&*
194 to print the first few lines of all messages.
195 .Pp
196 .Ss Replying to or originating mail.
197 You can use the
198 .Ic reply
199 command to
200 set up a response to a message, sending it back to the
201 person who it was from.
202 Text you then type in, up to an end-of-file,
203 defines the contents of the message.
204 While you are composing a message,
205 .Nm mail
206 treats lines beginning with the character
207 .Ql Ic \&~
208 specially.
209 For instance, typing
210 .Ql Ic \&~m
211 (alone on a line) will place a copy
212 of the current message into the response right shifting it by a tabstop
213 (see
214 .Em indentprefix
215 variable, below).
216 Other escapes will set up subject fields, add and delete recipients
217 to the message and allow you to escape to an editor to revise the
218 message or to a shell to run some commands.
219 (These options
220 are given in the summary below.)
221 .Pp
222 .Ss Ending a mail processing session.
223 You can end a
224 .Nm mail
225 session with the
226 .Ic quit
227 .Pq Ic q
228 command.
229 Messages which have been examined go to your
230 .Ar mbox
231 file unless they have been deleted in which case they are discarded.
232 Unexamined messages go back to the post office.
233 (See the
234 .Fl f
235 option above).
236 .Pp
237 .Ss Personal and system wide distribution lists.
238 It is also possible to create a personal distribution lists so that,
239 for instance, you can send mail to
240 .Dq Li cohorts
241 and have it go
242 to a group of people.
243 Such lists can be defined by placing a line like
244 .Pp
245 .Dl alias cohorts bill ozalp jkf mark kridle@ucbcory
246 .Pp
247 in the file
248 .Pa \&.mailrc
249 in your home directory.
250 The current list of such aliases can be displayed with the
251 .Ic alias
252 command in
253 .Nm mail  .
254 System wide distribution lists can be created by editing
255 .Pa /etc/aliases ,
256 see
257 .Xr aliases  5
258 and
259 .Xr sendmail  8  ;
260 these are kept in a different syntax.
261 In mail you send, personal aliases will be expanded in mail sent
262 to others so that they will be able to
263 .Ic reply
264 to the recipients.
265 System wide
266 .Ic aliases
267 are not expanded when the mail is sent,
268 but any reply returned to the machine will have the system wide
269 alias expanded as all mail goes through
270 .Xr sendmail  .
271 .Pp
272 .Ss Network mail (ARPA, UUCP, Berknet)
273 See
274 .Xr mailaddr 7
275 for a description of network addresses.
276 .Pp
277 .Nm Mail
278 has a number of options which can be set in the
279 .Pa .mailrc
280 file to alter its behavior; thus
281 .Dq Li set askcc
282 enables the
283 .Ar askcc
284 feature.
285 (These options are summarized below.)
286 .Sh SUMMARY
287 (Adapted from the `Mail Reference Manual')
288 .Pp
289 Each command is typed on a line by itself, and may take arguments
290 following the command word.
291 The command need not be typed in its
292 entirety \- the first command which matches the typed prefix is used.
293 For commands which take message lists as arguments, if no message
294 list is given, then the next message forward which satisfies the
295 command's requirements is used.
296 If there are no messages forward of
297 the current message, the search proceeds backwards, and if there are no
298 good messages at all,
299 .Nm mail
300 types
301 .Dq Li No applicable messages
302 and
303 aborts the command.
304 .Bl -tag -width delete
305 .It Ic \&\-
306 Print out the preceding message.
307 If given a numeric
308 argument
309 .Ar n  ,
310 goes to the
311 .Ar n Ns 'th
312 previous message and prints it.
313 .It Ic \&#
314 ignore the remainder of the line as a comment.
315 .It Ic \&?
316 Prints a brief summary of commands.
317 .It Ic \&!
318 Executes the shell
319 (see
320 .Xr sh 1
321 and
322 .Xr csh 1 )
323 command which follows.
324 .It Ic Print
325 .Pq Ic P
326 Like
327 .Ic print
328 but also prints out ignored header fields.
329 See also
330 .Ic print ,
331 .Ic ignore
332 and
333 .Ic retain .
334 .It Ic Reply
335 .Pq Ic R
336 Reply to originator.
337 Does not reply to other
338 recipients of the original message.
339 .It Ic Type
340 .Pq Ic T
341 Identical to the
342 .Ic Print
343 command.
344 .It Ic alias
345 .Pq Ic a
346 With no arguments, prints out all currently-defined aliases.
347 With one
348 argument, prints out that alias.
349 With more than one argument, creates
350 a new alias or changes an old one.
351 .It Ic alternates
352 .Pq Ic alt
353 The
354 .Ic alternates
355 command is useful if you have accounts on several machines.
356 It can be used to inform
357 .Nm mail
358 that the listed addresses are really you.
359 When you
360 .Ic reply
361 to messages,
362 .Nm mail
363 will not send a copy of the message to any of the addresses
364 listed on the
365 .Ic alternates
366 list.
367 If the
368 .Ic alternates
369 command is given with no argument, the current set of alternate
370 names is displayed.
371 .It Ic chdir
372 .Pq Ic c
373 Changes the user's working directory to that specified, if given.
374 If
375 no directory is given, then changes to the user's login directory.
376 .It Ic copy
377 .Pq Ic co
378 The
379 .Ic copy
380 command does the same thing that
381 .Ic save
382 does, except that it does not mark the messages it
383 is used on for deletion when you quit.
384 .It Ic delete
385 .Pq Ic d
386 Takes a list of messages as argument and marks them all as deleted.
387 Deleted messages will not be saved in
388 .Ar mbox  ,
389 nor will they be available for most other commands.
390 .It Ic dp
391 (also
392 .Ic dt )
393 Deletes the current message and prints the next message.
394 If there is no next message,
395 .Nm mail
396 says
397 .Dq Li "at EOF" .
398 .It Ic edit
399 .Pq Ic e
400 Takes a list of messages and points the text editor at each one in
401 turn.
402 On return from the editor, the message is read back in.
403 .It Ic exit
404 .Pf ( Ic ex
405 or
406 .Ic x )
407 Effects an immediate return to the Shell without
408 modifying the user's system mailbox, his
409 .Ar mbox
410 file, or his edit file in
411 .Fl f  .
412 .It Ic file
413 .Pq Ic fi
414 The same as
415 .Ic folder  .
416 .It Ic folders
417 List the names of the folders in your folder directory.
418 .It Ic folder
419 .Pq Ic fo
420 The
421 .Ic folder
422 command switches to a new mail file or folder.
423 With no
424 arguments, it tells you which file you are currently reading.
425 If you give it an argument, it will write out changes (such
426 as deletions) you have made in the current file and read in
427 the new file.
428 Some special conventions are recognized for
429 the name.
430 # means the previous file, % means your system
431 mailbox, %user means user's system mailbox, & means
432 your
433 .Ar mbox
434 file, and
435 \&+\&folder means a file in your folder
436 directory.
437 .It Ic from
438 .Pq Ic f
439 Takes a list of messages and prints their message headers.
440 .It Ic headers
441 .Pq Ic h
442 Lists the current range of headers, which is an 18\-message group.
443 If
444 a
445 .Ql \&+
446 argument is given, then the next 18\-message group is printed, and if
447 a
448 .Ql \&\-
449 argument is given, the previous 18\-message group is printed.
450 .It Ic help
451 A synonym for
452 .Ic \&?
453 .It Ic hold
454 .Pf ( Ic ho ,
455 also
456 .Ic preserve )
457 Takes a message list and marks each
458 message therein to be saved in the
459 user's system mailbox instead of in
460 .Ar mbox  .
461 Does not override the
462 .Ic delete
463 command.
464 .It Ic ignore
465 Add the list of header fields named to the
466 .Ar ignored list .
467 Header fields in the ignore list are not printed
468 on your terminal when you print a message.
469 This
470 command is very handy for suppression of certain machine-generated
471 header fields.
472 The
473 .Ic Type
474 and
475 .Ic Print
476 commands can be used to print a message in its entirety, including
477 ignored fields.
478 If
479 .Ic ignore
480 is executed with no arguments, it lists the current set of
481 ignored fields.
482 .It Ic mail
483 .Pq Ic m
484 Takes as argument login names and distribution group names and sends
485 mail to those people.
486 .It Ic more
487 .Pq Ic \mo
488 Takes a list of messages and invokes the pager on that list.
489 .It Ic mbox
490 Indicate that a list of messages be sent to
491 .Ic mbox
492 in your home directory when you quit.
493 This is the default
494 action for messages if you do
495 .Em not
496 have the
497 .Ic hold
498 option set.
499 .It Ic next
500 .Pq Ic n
501 like
502 (
503 .Ic \&+
504 or
505 .Tn CR )
506 Goes to the next message in sequence and types it.
507 With an argument list, types the next matching message.
508 .It Ic preserve
509 .Pq Ic pre
510 A synonym for
511 .Ic hold  .
512 .It Ic print
513 .Pq Ic p
514 Takes a message list and types out each message on the user's terminal.
515 .It Ic quit
516 .Pq Ic q
517 Terminates the session, saving all undeleted, unsaved messages in
518 the user's
519 .Ar mbox
520 file in his login directory, preserving all messages marked with
521 .Ic hold
522 or
523 .Ic preserve
524 or never referenced
525 in his system mailbox, and removing all other messages from his system
526 mailbox.
527 If new mail has arrived during the session, the message
528 .Dq Li "You have new mail"
529 is given.
530 If given while editing a
531 mailbox file with the
532 .Fl f
533 flag, then the edit file is rewritten.
534 A return to the Shell is
535 effected, unless the rewrite of edit file fails, in which case the user
536 can escape with the
537 .Ic exit
538 command.
539 .It Ic reply
540 .Pq Ic r
541 Takes a message list and sends mail to the sender and all
542 recipients of the specified message.
543 The default message must not be deleted.
544 .It Ic respond
545 A synonym for
546 .Ic reply  .
547 .It Ic retain
548 Add the list of header fields named to the
549 .Ar retained list
550 Only the header fields in the retain list
551 are shown on your terminal when you print a message.
552 All other header fields are suppressed.
553 The
554 .Ic Type
555 and
556 .Ic Print
557 commands can be used to print a message in its entirety.
558 If
559 .Ic retain
560 is executed with no arguments, it lists the current set of
561 retained fields.
562 .It Ic save
563 .Pq Ic s
564 Takes a message list and a filename and appends each message in
565 turn to the end of the file.
566 The filename in quotes, followed by the line
567 count and character count is echoed on the user's terminal.
568 .It Ic set
569 .Pq Ic se
570 With no arguments, prints all variable values.
571 Otherwise, sets
572 option.
573 Arguments are of the form
574 .Ar option=value
575 (no space before or after =) or
576 .Ar option .
577 Quotation marks may be placed around any part of the assignment statement to
578 quote blanks or tabs, i.e.
579 .Dq Li "set indentprefix=\*q->\*q"
580 .It Ic saveignore
581 .Ic Saveignore
582 is to
583 .Ic save
584 what
585 .Ic ignore
586 is to
587 .Ic print
588 and
589 .Ic type  .
590 Header fields thus marked are filtered out when
591 saving a message by
592 .Ic save
593 or when automatically saving to
594 .Ar mbox  .
595 .It Ic saveretain
596 .Ic Saveretain
597 is to
598 .Ic save
599 what
600 .Ic retain
601 is to
602 .Ic print
603 and
604 .Ic type  .
605 Header fields thus marked are the only ones saved
606 with a message when saving by
607 .Ic save
608 or when automatically saving to
609 .Ar mbox  .
610 .Ic Saveretain
611 overrides
612 .Ic saveignore  .
613 .It Ic shell
614 .Pq Ic sh
615 Invokes an interactive version of the shell.
616 .It Ic size
617 Takes a message list and prints out the size in characters of each
618 message.
619 .It Ic source
620 The
621 .Ic source
622 command reads
623 commands from a file.
624 .It Ic top
625 Takes a message list and prints the top few lines of each.
626 The number of
627 lines printed is controlled by the variable
628 .Ic toplines
629 and defaults to five.
630 .It Ic type
631 .Pq Ic t
632 A synonym for
633 .Ic print  .
634 .It Ic unalias
635 Takes a list of names defined by
636 .Ic alias
637 commands and discards the remembered groups of users.
638 The group names
639 no longer have any significance.
640 .It Ic undelete
641 .Pq Ic u
642 Takes a message list and marks each message as
643 .Ic not
644 being deleted.
645 .It Ic unread
646 .Pq Ic U
647 Takes a message list and marks each message as
648 .Ic not
649 having been read.
650 .It Ic unset
651 Takes a list of option names and discards their remembered values;
652 the inverse of
653 .Ic set  .
654 .It Ic visual
655 .Pq Ic v
656 Takes a message list and invokes the display editor on each message.
657 .It Ic write
658 .Pq Ic w
659 Similar to
660 .Ic save  ,
661 except that
662 .Ic only
663 the message body
664 .Pq Ar without
665 the header) is saved.
666 Extremely useful for such tasks as sending and receiving source
667 program text over the message system.
668 .It Ic xit
669 .Pq Ic x
670 A synonym for
671 .Ic exit  .
672 .It Ic z
673 .Nm Mail
674 presents message headers in windowfuls as described under the
675 .Ic headers
676 command.
677 You can move
678 .Nm mail Ns 's
679 attention forward to the next window with the
680 .Ic \&z
681 command.
682 Also, you can move to the previous window by using
683 .Ic \&z\&\-  .
684 .El
685 .Ss Tilde/Escapes
686 .Pp
687 Here is a summary of the tilde escapes,
688 which are used when composing messages to perform
689 special functions.
690 Tilde escapes are only recognized at the beginning
691 of lines.
692 The name
693 .Dq Em tilde\ escape
694 is somewhat of a misnomer since the actual escape character can be set
695 by the option
696 .Ic escape .
697 .Bl -tag -width Ds
698 .It Ic \&~! Ns Ar command
699 Execute the indicated shell command, then return to the message.
700 .It Ic \&~b Ns Ar name ...
701 Add the given names to the list of carbon copy recipients but do not make
702 the names visible in the Cc: line ("blind" carbon copy).
703 .It Ic \&~c Ns Ar name ...
704 Add the given names to the list of carbon copy recipients.
705 .It Ic \&~d
706 Read the file
707 .Dq Pa dead.letter
708 from your home directory into the message.
709 .It Ic \&~e
710 Invoke the text editor on the message collected so far.
711 After the
712 editing session is finished, you may continue appending text to the
713 message.
714 .It Ic \&~f Ns Ar messages
715 Read the named messages into the message being sent.
716 If no messages are specified, read in the current message.
717 Message headers currently being ignored (by the
718 .Ic ignore
719 or
720 .Ic retain
721 command) are not included.
722 .It Ic \&~F Ns Ar messages
723 Identical to
724 .Ic \&~f ,
725 except all message headers are included.
726 .It Ic \&~h
727 Edit the message header fields by typing each one in turn and allowing
728 the user to append text to the end or modify the field by using the
729 current terminal erase and kill characters.
730 .It Ic \&~m Ns Ar messages
731 Read the named messages into the message being sent, indented by a
732 tab or by the value of
733 .Ar indentprefix  .
734 If no messages are specified,
735 read the current message.
736 Message headers currently being ignored (by the
737 .Ic ignore
738 or
739 .Ic retain
740 command) are not included.
741 .It Ic \&~M Ns Ar messages
742 Identical to
743 .Ic \&~m ,
744 except all message headers are included.
745 .It Ic \&~p
746 Print out the message collected so far, prefaced by the message header
747 fields.
748 .It Ic \&~q
749 Abort the message being sent, copying the message to
750 .Dq Pa dead.letter
751 in your home directory if
752 .Ic save
753 is set.
754 .It Ic \&~r Ns Ar filename
755 Read the named file into the message.
756 .It Ic \&~R Ns Ar string
757 Use
758 .Ar string
759 as the Reply-To field.
760 .It Ic \&~s Ns Ar string
761 Cause the named string to become the current subject field.
762 .It Ic \&~\&t Ns Ar name ...
763 Add the given names to the direct recipient list.
764 .It Ic \&~\&v
765 Invoke an alternate editor (defined by the
766 .Ev VISUAL
767 option) on the
768 message collected so far.
769 Usually, the alternate editor will be a
770 screen editor.
771 After you quit the editor, you may resume appending
772 text to the end of your message.
773 .It Ic \&~w Ns Ar filename
774 Write the message onto the named file.
775 .It Ic \&~\&| Ns Ar command
776 Pipe the message through the command as a filter.
777 If the command gives
778 no output or terminates abnormally, retain the original text of the
779 message.
780 The command
781 .Xr fmt 1
782 is often used as
783 .Ic command
784 to rejustify the message.
785 .It Ic \&~: Ns Ar mail-command
786 Execute the given mail command.
787 Not all commands, however, are allowed.
788 .It Ic \&~~ Ns Ar string
789 Insert the string of text in the message prefaced by a single ~.
790 If
791 you have changed the escape character, then you should double
792 that character in order to send it.
793 .El
794 .Ss Mail Options
795 Options are controlled via
796 .Ic set
797 and
798 .Ic unset
799 commands.
800 Options may be either binary, in which case it is only
801 significant to see whether they are set or not; or string, in which
802 case the actual value is of interest.
803 The binary options include the following:
804 .Bl -tag -width append
805 .It Ar append
806 Causes messages saved in
807 .Ar mbox
808 to be appended to the end rather than prepended.
809 This should always be set (preferably in one of the system-wide
810 .Pa mail.rc
811 files).
812 .It Ar ask
813 Causes
814 .Nm mail
815 to prompt you for the subject of each message you send.
816 If
817 you respond with simply a newline, no subject field will be sent.
818 .It Ar askcc
819 Causes you to be prompted for additional carbon copy recipients at the
820 end of each message.
821 Responding with a newline indicates your
822 satisfaction with the current list.
823 .It Ar autoprint
824 Causes the
825 .Ic delete
826 command to behave like
827 .Ic dp
828 \- thus, after deleting a message, the next one will be typed
829 automatically.
830 .It Ar debug
831 Setting the binary option
832 .Ar debug
833 is the same as specifying
834 .Fl d
835 on the command line and causes
836 .Nm mail
837 to output all sorts of information useful for debugging
838 .Nm mail  .
839 .It Ar dot
840 The binary option
841 .Ar dot
842 causes
843 .Nm mail
844 to interpret a period alone on a line as the terminator
845 of a message you are sending.
846 .It Ar hold
847 This option is used to hold messages in the system mailbox
848 by default.
849 .It Ar ignore
850 Causes interrupt signals from your terminal to be ignored and echoed as
851 @'s.
852 .It Ar ignoreeof
853 An option related to
854 .Ar dot
855 is
856 .Ar ignoreeof
857 which makes
858 .Nm mail
859 refuse to accept a control-d as the end of a message.
860 .Ar Ignoreeof
861 also applies to
862 .Nm mail
863 command mode.
864 .It Ar metoo
865 Usually, when a group is expanded that contains the sender, the sender
866 is removed from the expansion.
867 Setting this option causes the sender
868 to be included in the group.
869 .It Ar noheader
870 Setting the option
871 .Ar noheader
872 is the same as giving the
873 .Fl N
874 flag on the command line.
875 .It Ar nosave
876 Normally, when you abort a message with two
877 .Tn RUBOUT
878 (erase or delete)
879 .Nm mail
880 copies the partial letter to the file
881 .Dq Pa dead.letter
882 in your home directory.
883 Setting the binary option
884 .Ar nosave
885 prevents this.
886 .It Ar Replyall
887 Reverses the sense of
888 .Ic reply
889 and
890 .Ic Reply
891 commands.
892 .It Ar quiet
893 Suppresses the printing of the version when first invoked.
894 .It Ar searchheaders
895 If this option is set, then a message-list specifier in the form ``/x:y''
896 will expand to all messages containing the substring ``y'' in the header
897 field ``x''.  The string search is case insensitive.
898 .It Ar verbose
899 Setting the option
900 .Ar verbose
901 is the same as using the
902 .Fl v
903 flag on the command line.
904 When mail runs in verbose mode,
905 the actual delivery of messages is displayed on the user's
906 terminal.
907 .El
908 .Ss Option String Values
909 .Bl -tag -width Va
910 .It Ev EDITOR
911 Pathname of the text editor to use in the
912 .Ic edit
913 command and
914 .Ic \&~e
915 escape.
916 If not defined, then a default editor is used.
917 .It Ev LISTER
918 Pathname of the directory lister to use in the
919 .Ic folders
920 command.
921 Default is
922 .Pa /bin/ls .
923 .It Ev PAGER
924 Pathname of the program to use in the
925 .Ic more
926 command or when
927 .Ic crt
928 variable is set.
929 The default paginator
930 .Xr more 1
931 is used if this option is not defined.
932 .It Ev REPLYTO
933 If set, will be used to initialize the Reply-To field for outgoing
934 messages.
935 .It Ev SHELL
936 Pathname of the shell to use in the
937 .Ic \&!
938 command and the
939 .Ic \&~!
940 escape.
941 A default shell is used if this option is
942 not defined.
943 .It Ev VISUAL
944 Pathname of the text editor to use in the
945 .Ic visual
946 command and
947 .Ic \&~v
948 escape.
949 .It Va crt
950 The valued option
951 .Va crt
952 is used as a threshold to determine how long a message must
953 be before
954 .Ev PAGER
955 is used to read it.
956 If
957 .Va crt
958 is set without a value,
959 then the height of the terminal screen stored in the system
960 is used to compute the threshold (see
961 .Xr stty 1 ) .
962 .It Ar escape
963 If defined, the first character of this option gives the character to
964 use in the place of ~ to denote escapes.
965 .It Ar folder
966 The name of the directory to use for storing folders of
967 messages.
968 If this name begins with a `/',
969 .Nm mail
970 considers it to be an absolute pathname; otherwise, the
971 folder directory is found relative to your home directory.
972 .It Ev MBOX
973 The name of the
974 .Ar mbox
975 file.
976 It can be the name of a folder.
977 The default is
978 .Dq Li mbox
979 in the user's home directory.
980 .It Ar record
981 If defined, gives the pathname of the file used to record all outgoing
982 mail.
983 If not defined, then outgoing mail is not so saved.
984 .It Ar indentprefix
985 String used by the ``~m'' tilde escape for indenting messages, in place of
986 the normal tab character (^I).
987 Be sure to quote the value if it contains
988 spaces or tabs.
989 .It Ar toplines
990 If defined, gives the number of lines of a message to be printed out
991 with the
992 .Ic top
993 command; normally, the first five lines are printed.
994 .El
995 .Sh ENVIRONMENT
996 .Nm Mail
997 utilizes the
998 .Ev HOME
999 and
1000 .Ev USER
1001 environment variables.  Also, if the
1002 .Ev MAIL
1003 environment variable is set, it is used as the
1004 location of the user's mailbox instead of the
1005 default in /var/mail.
1006 .Sh FILES
1007 .Bl -tag -width /usr/share/misc/mail.*help -compact
1008 .It Pa /var/mail/*
1009 Post office.
1010 .It ~/mbox
1011 User's old mail.
1012 .It ~/.mailrc
1013 File giving initial mail commands.
1014 .It Pa /tmp/R*
1015 Temporary files.
1016 .It Pa /usr/share/misc/mail.*help
1017 Help files.
1018 .sp
1019 .It Pa /usr/share/misc/mail.rc
1020 .It Pa /usr/local/etc/mail.rc
1021 .It Pa /etc/mail.rc
1022 System-wide initialization files. Each file will be sourced, in order,
1023 if it exists.
1024 .El
1025 .Sh SEE ALSO
1026 .Xr fmt 1 ,
1027 .Xr newaliases 1 ,
1028 .Xr vacation 1 ,
1029 .Xr aliases 5 ,
1030 .Xr mailaddr 7 ,
1031 .Xr sendmail 8
1032 and
1033 .Rs
1034 .%T "The Mail Reference Manual" .
1035 .Re
1036 .Sh HISTORY
1037 A
1038 .Nm
1039 command
1040 appeared in
1041 .At v1 .
1042 This man page is derived from
1043 .%T "The Mail Reference Manual"
1044 originally written by Kurt Shoens.
1045 .Sh BUGS
1046 There are some flags that are not documented here.
1047 Most are
1048 not useful to the general user.
1049 .Pp
1050 Usually,
1051 .Nm mail
1052 is just a link to
1053 .Nm Mail  ,
1054 which can be confusing.