1 .\" $NetBSD: mail.1,v 1.55 2009/03/23 17:02:06 joerg Exp $
3 .\" Copyright (c) 1980, 1990, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)mail.1 8.8 (Berkeley) 4/28/95
39 .Nd send and receive mail
49 .Op - Ar sendmail-flags
52 .Op Fl H Ns Op colon-modifier
57 .Op Fl H Ns Op colon-modifier
61 is an intelligent mail processing system, which has
62 a command syntax reminiscent of
64 with lines replaced by messages.
72 Send blind carbon copies to
74 List should be a comma-separated list of names.
80 Don't send messages with an empty body.
81 This is useful for piping errors from cron scripts.
83 Read in the contents of your
85 (or the specified file)
86 for processing; when you
89 writes undeleted messages back to this file.
91 Print the header summaries and exit.
92 The optional colon-modifier string must begin with a
94 and be followed by one or more of the characters described in the
95 .Sx Specifying messages
102 will display just new message headers.
104 Forces mail to run in interactive mode even when
105 input isn't a terminal.
109 character when sending mail is only active in interactive mode.
111 Ignore tty interrupt signals.
112 This is particularly useful when using
114 on noisy phone lines.
116 Inhibits the initial display of message headers
117 when reading mail or editing a mail folder.
123 Specify an alternate user rcfile to load.
124 This overrides the value specified in the environment variable
126 which in turn overrides the default
130 Specify subject on command line
131 (only the first argument after the
133 flag is used as a subject; be careful to quote subjects
138 .Dl mail -f /var/mail/user
141 The details of delivery are displayed on the user's terminal.
144 To send a message to one or more people,
146 can be invoked with arguments which are the names of people to
147 whom the mail will be sent.
148 You are then expected to type in your message, followed by a
150 at the beginning of a line.
152 Any flags following the list of recipients, will be passed, together
153 with their arguments, directly to
155 For example to change your
158 .Dv somebody@somewhere.net
161 .Dl mail recipient -f somebody@somewhere.net
163 To prevent multiple copies of a message being sent to the same
164 address, duplicate addresses (after alias expansion) are removed from
171 In addition, addresses on the
175 lists are removed if they occur on the
177 list and addresses on the
179 list are removed if they occur on the
184 list is empty after these deletions, most systems will insert the line
185 .Dq To: undisclosed recipients:; .
188 .Sx Replying to or originating mail ,
189 describes some features of
191 available to help you compose your letter.
195 is given no arguments and checks your mail out of the post office,
196 then prints out a one line header of each message found.
197 The current message is initially the first message (numbered 1)
198 and can be printed using the
200 command (which can be abbreviated
202 You can move among the messages much as you move between lines in
208 moving backwards and forwards, and simple numbers.
209 .Ss Disposing of mail
210 After examining a message you can
219 program to forget about the message.
220 This is not irreversible; the message can be
223 by giving its number, or the
225 session can be aborted by giving the
229 Deleted messages will, however, usually disappear never to be seen again.
230 .Ss Specifying messages
236 accept a list of messages as an argument.
237 Messages may be specified by their message number, by a range of
238 messages, or by a pattern string matching certain fields in the header
242 may be combined by the usual binary boolean operations
247 which denote, respectively, a logical
252 Logical expressions may be grouped with parentheses
259 If the binary operator is missing between two message specs, it is
262 This is for simplicity, backwards compatibility, and also to to
265 symbol to denote a pipe.
269 Besides the obvious (base10) message numbers, the characters
276 denote, respectively, the first message, the message before the
278 .Pq the current message ,
281 message, the message following the
283 and the last message.
287 consists of two message numbers separated by a
291 denotes all messages and is equivalent to
294 A pattern is a string (not beginning with any of the above special
296 If it does not begin with a
298 it is compared with the senders address.
303 is not defined, the remainder of the string is compared with the
307 for searching other header fields or the message body.)
310 is not defined, then the comparison is a simple case insensitive
314 for regular expression matches.)
316 A list of messages may be restricted by a
320 followed by one or more of the characters:
321 .Bd -literal -offset indent
332 ! invert the meaning of the colon-modifiers
335 If there are no address specifications other than colon-modifiers,
336 the colon-modifiers apply to all messages.
338 .Dq Li from netbsd :n
339 would display the headers of all new messages with
341 in the sender's address, while
345 would both display all new and unread messages.
346 Multiple colon-modifiers may be specified and a single
348 with no letters following indicates the colon-modifier from the
352 .Bd -literal -offset indent
356 would display the headers from messages 1, 3, 4, 5, and 12.
357 .Bd -literal -offset indent
358 from anon \*[Am] ( /foo | /bar )
361 would display all headers that had
363 in the sender's address and either
369 Generally, commands cannot select messages that are not displayed,
370 such as deleted or hidden messages, the exception being the
373 .Ss Replying to or originating mail
376 command to set up a response to a message, sending it back to the
377 person who it was from.
378 Text you then type in, up to an end-of-file,
379 defines the contents of the message.
380 While you are composing a message,
382 treats lines beginning with the character
387 (alone on a line) will place a copy
388 of the current message into the response right shifting it by a tab stop
392 Other escapes will set up subject fields, add and delete recipients
393 to the message, and allow you to escape to an editor to revise the
394 message or to a shell to run some commands.
395 (These options are given in the summary below.)
396 .Ss Ending a mail processing session
403 Messages which have been examined go to your
405 file unless they have been deleted in which case they are discarded.
406 Unexamined messages go back to the post office.
410 .Ss Personal and system wide distribution lists
411 It is also possible to create a personal distribution lists so that,
412 for instance, you can send mail to
415 to a group of people.
416 Such lists can be defined by placing a line like
418 .Dl alias cohorts bill ozalp jkf mark kridle@ucbcory
422 in your home directory.
423 The current list of such aliases can be displayed with the
427 System wide distribution lists can be created by editing
428 .Pa /etc/mail/aliases ,
433 these are kept in a different syntax.
434 In mail you send, personal aliases will be expanded in mail sent
435 to others so that they will be able to
440 are not expanded when the mail is sent,
441 but any reply returned to the machine will have the system wide
442 alias expanded as all mail goes through
444 .Ss Network mail (ARPA, UUCP, Berknet)
447 for a description of network addresses.
450 has a number of options which can be set in the
452 file to alter its behavior; thus
457 (These options are summarized below.)
460 .Dq Mail Reference Manual )
462 Each command is typed on a line by itself, and may take arguments
463 following the command word.
464 The command need not be typed in its
465 entirety \- the first command which matches the typed prefix is used.
466 For commands which take message lists as arguments, if no message
467 list is given, then the next message forward which satisfies the
468 command's requirements is used.
469 If there are no messages forward of the current message, the search
470 proceeds backwards, and if there are no good messages at all,
473 .Dq Li \&No applicable messages
474 and aborts the command.
475 .Bl -tag -width delete
482 command which follows.
484 Print out the preceding message.
490 previous message and prints it.
492 With no argument, it displays the current message number.
493 Otherwise, set the current message number to its first argument.
495 Prints a brief summary of commands.
497 Pipe the current message body through the shell
502 command which follows.
506 but also saves MIME parts that don't have a filename associated with
508 For the unnamed parts, a filename is suggested containing the message
509 and part numbers, and the subtype.
512 Specify or show additional header fields.
513 This is intended for adding extra header fields like
519 .Bd -literal -offset 0
520 Header X-Mailer: NetBSD mail(1) 9.1
524 .Dq X-Mailer: NetBSD mail(1) 9.1
525 line to the message header.
526 Without any arguments, the extra header fields are displayed.
527 With only a header name (including the
529 it will delete all extra header fields with that name.
530 Note: Although some syntax checking is done on the header line, care
531 should be taken to ensure that it complies with RFC 2821 and 2822.
532 Also, the extra header lines are not currently displayed by the
534 tilde command when sending mail (use
541 but also prints out ignored header fields.
550 but also prints out ignored header fields.
563 Does not reply to other recipients of the original message.
570 except that all header fields are saved ignoring the
584 but has the opposite MIME decoding behavior.
586 .Ar mime-decode-message
590 With no arguments, prints out all currently-defined aliases.
591 With one argument, prints out that alias.
592 With more than one argument, creates
593 a new alias or changes an old one.
598 command is useful if you have accounts on several machines.
599 It can be used to inform
601 that the listed addresses are really you.
606 will not send a copy of the message to any of the addresses
612 command is given with no argument, the current set of alternative
615 Takes a list of messages and prompts for an address to bounce the
617 If no message is specified, the current message is used.
618 All the original header fields are preserved except for the
626 field contains the bounce address(es) plus any addresses in the old
628 field minus the user's local address and any on the alternates list.
634 Changes the user's working directory to that specified, if given.
635 If no directory is given, then changes to the user's login directory.
640 command does the same thing that
642 does, except that it does not mark the messages it
643 is used on for deletion when you quit.
645 Delete duplicate messages based on their
647 field, keeping the first one in the current sort order.
648 This can be useful with replies to a mailing list that are also CCed
650 (The same thing can also be accomplished with the threading and
654 Takes a list of messages as an argument and marks them all as deleted.
655 Deleted messages will not be saved in
657 nor will they be available for most other commands.
659 Takes a message list followed by a target directory as arguments,
660 decodes each MIME part in the message list, and saves it in the target
662 If the message list is empty, use the current message.
663 If the directory is not specified, use the directory specified by
665 variable and, if that is empty, default to the directory
668 For each MIME part in the message list, the filename is displayed for
669 confirmation or changes.
670 If an empty name is entered, the part is skipped.
671 If the filename already exists, the user will be prompted before
674 .Ar mime-detach-batch
676 .Ar mime-detach-overwrite
677 variables to change this behavior.)
678 Only MIME parts with an associated filename in the
681 .Ql Content-Disposition
685 to detach all parts.)
686 The MIME extension hooks and character set conversion are ignored.
690 Deletes the current message and prints the next message.
691 If there is no next message,
696 Go down one level in the thread.
697 If given a message number, it descends the thread below that message,
698 otherwise it descends from the current message (dot).
701 Takes a list of messages and points the text editor at each one in
703 On return from the editor, the message is read back in.
705 Switch the command execution condition set by the previous
723 Effects an immediate return to the Shell without
724 modifying the user's system mailbox, his
726 file, or his edit file in
729 Expose the thread structure so all messages appear in header listings.
733 The default header prompt will indent each header line one space for
734 each level in the threading.
737 format string does this.
743 For each message number in the argument list, or the current thread if
744 no message list is given, promote all exposed children to the same
747 List the names of the folders in your folder directory.
752 command switches to a new mail file or folder.
753 With no arguments, it tells you which file you are currently reading.
754 If you give it an argument, it will write out changes (such
755 as deletions) you have made in the current file and read in
757 Some special conventions are recognized for the name.
759 means the previous file,
761 means your system mailbox,
763 means user's system mailbox,
769 means a file in your folder directory.
771 Takes a list of messages and prompts for an address (or addresses) to
772 forward each message to.
773 If no message list is specified, the current message is used.
774 The mail editor is run for each message allowing the user to enter a
775 message that will precede the forward message.
776 The message is sent as a multipart/mixed MIME encoded message.
777 All header fields except the
782 Takes a list of messages and prints their message headers.
785 Lists the current range of headers, which is an 18\-message group.
788 argument is given, then the next 18\-message group is printed, and
791 argument is given, the previous 18\-message group is printed.
796 Collapse the threads so that only the head of each thread is shown,
797 hiding the subthreads.
802 Restrict the display to untagged messages.
803 In threaded mode, subthreads that connect directly to an untagged
804 message are also displayed, including tagged messages in the
814 Takes a message list and marks each message therein to be saved in
815 the user's system mailbox instead of in
817 Does not override the
821 Execute commands that follow depending on the operating mode.
822 The current supported modes are
827 For example, one use might be something like:
828 .Bd -literal -offset 0
830 set header-format="%P%Q%3i %-21.20f %m/%d %R %3K \\"%q\\""
832 set header-format="%P%Q%?\*[Am] ?%3i %-21.20f %a %b %e %R %3K/%-5O \\"%q\\""
836 Execute commands that follow if the specified variable is defined.
837 Note: This includes environment variables.
839 Execute commands that follow if the specified variable is not
842 Add the list of header fields named to the
844 Header fields in the ignore list are not printed
845 on your terminal when you print a message.
846 This command is very handy for suppression of certain machine-generated
852 commands can be used to print a message in its entirety, including
856 is executed with no arguments, it lists the current set of
859 Incorporate any new messages that have arrived while mail
861 The new messages are added to the end of the message list,
862 and the current message is reset to be the first new mail message.
863 This does not renumber the existing message list, nor does
864 it cause any changes made so far to be saved.
866 Invert the tags on a list of messages or the current message if none
868 Note: this will not affect any currently deleted messages.
871 Takes as argument login names and distribution group names and sends
872 mail to those people.
874 Indicate that a list of messages be sent to
876 in your home directory when you quit.
877 This is the default action for messages if you do
884 Takes a message list and marks each message as
888 Takes a message list and invokes the pager on that list.
895 Goes to the next message in sequence and types it.
896 With an argument list, types the next matching message.
907 Takes a message list and types out each message on the user's terminal.
910 Terminates the session, saving all undeleted, unsaved messages in
913 file in his login directory, preserving all messages marked with
917 or never referenced in his system mailbox, and removing all other
918 messages from his system mailbox.
919 If new mail has arrived during the session, the message
920 .Dq Li "You have new mail"
922 If given while editing a mailbox file with the
924 flag, then the edit file is rewritten.
925 A return to the Shell is effected, unless the rewrite of edit file
926 fails, in which case the user can escape with the
931 Takes a message list and sends mail to the sender and all
932 recipients of the specified message.
933 The default message must not be deleted.
943 Add the list of header fields named to the
945 Only the header fields in the retained list
946 are shown on your terminal when you print a message.
947 All other header fields are suppressed.
952 commands can be used to print a message in its entirety.
955 is executed with no arguments, it lists the current set of
961 Reverse the order of the messages in at the current thread level.
962 This is completely equivalent to
966 Takes a message list and a filename and appends each message in
967 turn to the end of the file.
968 The filename in quotes, followed by the line
969 count and character count is echoed on the user's terminal.
972 With no arguments, prints all variable values.
973 Otherwise, sets option.
974 Arguments are of the form
976 (no space before or after =) or
978 Quotation marks may be placed around any part of the assignment
979 statement to quote blanks or tabs, i.e.
980 .Dq Li "set indentprefix=\*q-\*[Gt]\*q"
981 Inside single quotes everything is parsed literally, including
986 character escapes are interpreted.
987 This is an extension as POSIX specifies that
989 should be left uninterpreted for both single and double quoted strings.
1000 Header fields thus marked are filtered out when
1003 or when automatically saving to
1016 Header fields thus marked are the only ones saved
1017 with a message when saving by
1019 or when automatically saving to
1026 Invokes an interactive version of the shell.
1029 Takes a list of variables and prints out their values in the form
1031 If the list is empty, all variable values are shown.
1033 Display all current messages, tagged or not, unless they are in a
1039 Takes a message list and prints out the size in characters of each
1044 followed by the sendmail flags that should be used when sending mail
1045 to an address that matches that
1047 If no sendmail flags are specified, then list the sendmail flags in
1052 is also omitted, then list all
1057 may be an alias, address, domain (beginning with a
1062 If mail is sent to multiple users, the sendmail flags are
1063 used only if the flags are the same for each recipients.
1066 is set, then you will be asked to verify the sendmail flags (if there
1067 are any) before the mail is sent.
1068 Address matching is case insensitive and done from most specific to
1073 .Bd -literal -offset indent
1074 smopts mylist -F "List Maintainer"
1075 smopts @NetBSD.org -f anon@somewhere.net -F "Anon Ymous"
1076 smopts friend@NetBSD.org ""
1079 then mail sent to any of the addresses that the
1081 alias expands to would have the sender's name set to
1082 .Ql List Maintainer .
1083 Mail sent to anyone at NetBSD.org other than
1084 .Ql friend@NetBSD.org
1085 would look like it was sent from
1086 .Ql anon@somewhere.net
1090 .Ql friend@NetBSD.org
1091 would not have any sendmail flags set (unless they are set by the
1098 Otherwise it will sort based on the header field name given as an
1100 A few names are special:
1101 .Bd -literal -offset indent
1102 blines sort based on the number of body lines.
1103 hlines sort on the number of header lines.
1104 tlines sort on the total number of lines.
1105 size sort on the message size
1106 sday sent day (ignores the hour/min/sec)
1107 rday received day (ignores the hour/min/sec)
1110 subject sort on the subject, ignoring "Re:" prefixes.
1111 from sort on the sender's address.
1114 The check for these special names is case sensitive while the header
1115 field name comparisons are case insensitive, so changing the case on
1116 any of these special names will sort based on the header field
1117 ignoring the special keyword.
1119 There are also three modifiers which may precede the argument:
1120 .Bd -literal -offset indent
1121 \&! reverse the sorting order.
1122 \&^ case insensitive sorting.
1123 \&- skin the field (removing RFC 822 comments and
1127 The same keywords and modifiers also apply to threading.
1134 has no effect on the threading, sorting only on the heads
1135 of the threads if threads exist.
1140 command reads commands from a file.
1142 Tag a list of messages or the current message if none are given.
1143 In hidden thread mode, the entire thread will be tagged, i.e.,
1147 Tag all messages of the current thread below the level of the
1148 current message (dot) or the supplied message number if given.
1150 By default this threads the current message list based on the
1154 header fields (intended for this purpose by RFC 2822).
1155 If given an argument, it will thread on that header field name
1157 The same field keywords and modifiers recognized by the sort command
1158 are also recognized here.
1159 Display of the threads is controlled by the
1163 commands; navigation of threads is done with the
1171 .Ar recursive-commands
1172 is defined, many commands (e.g.,
1174 act on the entire thread (when it is hidden), otherwise they act on
1175 just the current message.
1181 header fields are necessary to do threading correctly.
1184 now emits these header fields when replying.
1186 Takes a message list and prints the top few lines of each.
1187 The number of lines printed is controlled by the variable
1189 and defaults to five.
1191 Set the current thread (thread set) so that the supplied message
1192 number (or the current message if no argument is given) is at the top
1193 level of the current thread.
1199 Takes a list of names defined by
1201 commands and discards the remembered groups of users.
1202 The group names no longer have any significance.
1205 Takes a message list and marks each message as
1210 Takes a message list and marks each message as
1214 Takes a list of option names and discards their remembered values;
1222 commands and discards them from the smopts database.
1224 Untag a list of messages or the current message if none are given.
1229 is recursive on hidden threads.
1231 Undo all threading and sorting, restoring the original display order,
1232 i.e., the order in the mail file.
1234 Go up one level in the thread.
1235 This also takes an optional (positive) argument to go up multiple
1236 levels in the thread.
1241 but has the opposite MIME decoding behavior.
1243 .Ar mime-decode-message
1247 Takes a message list and invokes the display editor on each message.
1256 the header) is saved.
1257 Extremely useful for such tasks as sending and receiving source
1258 program text over the message system.
1265 presents message headers in windowfuls as described under the
1270 attention forward to the next window with the
1273 Also, you can move to the previous window by using
1277 Here is a summary of the tilde escapes, which are used when composing
1278 messages to perform special functions.
1279 Tilde escapes are only recognized at the beginning of lines.
1281 .Dq Em tilde\ escape
1282 is somewhat of a misnomer since the actual escape character can be set
1286 .It Ic \&~! Ns Ar command
1287 Execute the indicated shell command, then return to the message.
1288 .It Ic \&~@ Op Ar filelist
1289 Add the files in the white-space delimited
1291 to the attachment list.
1294 is omitted, edit the attachment list, possibly appending to it: For
1295 each file in the list the user is prompted to change its attachment
1297 Changing the filename to empty will delete it from the list.
1298 Upon reaching the end of the attachment list, the user is prompted for
1299 additional files to attach until an empty filename is given.
1300 Filenames containing white-space can only be added in this
1304 Inserts the autograph string from the sign= option into the message.
1306 Inserts the autograph string from the Sign= option into the message.
1307 .It Ic \&~b Ns Ar name ...
1308 Add the given names to the list of carbon copy recipients but do not make
1309 the names visible in the Cc: line
1312 .It Ic \&~c Ns Ar name ...
1313 Add the given names to the list of carbon copy recipients.
1317 from your home directory into the message.
1319 Invoke the text editor on the message collected so far.
1320 After the editing session is finished, you may continue appending
1321 text to the message.
1322 .It Ic \&~f Ns Ar messages
1323 Read the named messages into the message being sent.
1324 If no messages are specified, read in the current message.
1325 Message headers currently being ignored (by the
1329 command) are not included.
1333 except all message headers are included.
1335 Edit the message header fields, and the options passed to sendmail (the
1337 by typing each one in turn and allowing the user to append text to the
1338 end or modify the field by using the current terminal erase and kill
1342 support is included, then that line editor is used.
1343 .It Ic \&~i Ns Ar string
1344 Inserts the value of the named option into the text of the message.
1345 .It Ic \&~m Ns Ar messages
1346 Read the named messages into the message being sent, indented by a
1347 tab or by the value of
1349 If no messages are specified, read the current message.
1350 Message headers currently being ignored (by the
1354 command) are not included.
1355 .It Ic \&~M Ns Ar messages
1358 except all message headers are included.
1360 Print out the message collected so far, prefaced by the message header
1363 Abort the message being sent, copying the message to
1365 in your home directory if
1369 Exits as with \&~q, except the message is not saved in
1370 .Dq Pa dead.letter .
1371 .It Ic \&~r Ns Ar filename
1372 .It Ic \&~\*[Lt] Ns Ar filename
1373 Reads the named file into the message.
1374 If the argument begins with
1376 the rest of the string is taken as an arbitrary system command and is
1377 executed, with the standard output inserted into the message.
1378 .It Ic \&~s Ns Ar string
1379 Cause the named string to become the current subject field.
1380 .It Ic \&~\&t Ns Ar name ...
1381 Add the given names to the direct recipient list.
1383 Invoke an alternative editor (defined by the
1385 option) on the message collected so far.
1386 Usually, the alternative editor will be a screen editor.
1387 After you quit the editor, you may resume appending
1388 text to the end of your message.
1389 .It Ic \&~w Ns Ar filename
1390 Write the message onto the named file.
1391 .It Ic \&~\&| Ns Ar command
1392 Pipe the message body through the command as a filter.
1393 If the command gives no output or terminates abnormally, retain the
1394 original text of the message.
1399 to rejustify the message.
1400 .It Ic \&~: Ns Ar mail-command
1401 Execute the given mail command.
1402 Not all commands, however, are allowed.
1403 .It Ic \&~~ Ns Ar string
1404 Insert the string of text in the message prefaced by a single ~.
1405 If you have changed the escape character, then you should double
1406 that character in order to send it.
1409 Options are controlled via
1414 Options may be either binary, in which case it is only
1415 significant to see whether they are set or not; or string, in which
1416 case the actual value is of interest.
1417 The binary options include the following:
1418 .Bl -tag -width append
1420 Causes messages saved in
1422 to be appended to the end rather than prepended.
1423 This should always be set (perhaps in
1424 .Pa /etc/mail.rc ) .
1425 .It Ar ask , Ar asksub
1428 to prompt you for the subject of each message you send.
1429 If you respond with simply a newline, no subject field will be sent.
1431 Causes you to be prompted for additional carbon copy recipients at
1432 the end of each message.
1433 Responding with a newline indicates your
1434 satisfaction with the current list.
1436 Causes new mail to be automatically incorporated when it arrives.
1437 Setting this is similar to issuing the
1439 command at each prompt, except that the current message is not
1440 reset when new mail arrives.
1442 Causes you to be prompted for additional blind carbon copy recipients
1443 at the end of each message.
1444 Responding with a newline indicates your
1445 satisfaction with the current list.
1449 command to behave like
1451 \- thus, after deleting a message, the next one will be typed
1458 will be used for the
1465 Normally these commands do not invoke the pager.
1469 Setting the binary option
1471 is the same as specifying
1473 on the command line and causes
1475 to output all sorts of information useful for debugging
1482 to interpret a period alone on a line as the terminator
1483 of a message you are sending.
1485 If defined, the output of most commands can be piped into a shell
1486 command or redirected to a file.
1487 The pipe/redirection is signaled by the first occurrence of a
1491 character that is not in a quoted string or in a parenthetical
1493 This character terminates the mail command line and the remaining
1494 string is passed to the shell.
1495 For example, assuming normal headers, something like
1496 .Bd -literal -offset indent
1497 from john@ | fgrep -i ' "Re:' | wc
1500 could be used to count how may replies were made by senders with
1502 in their address and
1503 .Bd -literal -offset indent
1504 from john@ \*[Gt]\*[Gt] /tmp/john
1507 would append all the headers from such senders to /tmp/john.
1509 Note: With piping enabled, you cannot use the
1513 operator outside of a parenthetical group.
1514 This should not be a problem as it is the default logical operator.
1516 .Sx Specifying messages
1519 This option is used to hold messages in the system mailbox
1522 Causes interrupt signals from your terminal to be ignored and echoed as
1525 Usually, when a group is expanded that contains the sender, the sender
1526 is removed from the expansion.
1527 Setting this option causes the sender to be included in the group.
1528 .It Ar mime-attach-list
1529 If set, the command line flag
1531 will accept a whitespace delimited list of files.
1532 Otherwise, its argument is interpreted as a single filename.
1533 Warning: If enabled, care must be taken to properly quote files that
1534 contain whitespace, both from the shell and from this second expansion
1537 .It Ar mime-decode-header
1538 If set, decode the headers along with the body when
1539 .Ar mime-decode-message
1541 The header decode follows the same rules as the body (see
1542 .Ar mime-decode-message ) .
1543 .It Ar mime-decode-insert
1545 a message into the mail buffer
1550 the text inserted will be decoded according to the settings of the
1551 .Ar mime-decode-message
1553 .Ar mime-decode-header
1555 .It Ar mime-decode-message
1566 commands will display decoded the MIME messages.
1567 Otherwise, they display the undecoded message.
1572 commands always have the opposite MIME decoding behavior from these
1574 .It Ar mime-decode-quote
1576 a message into the mail buffer
1581 the text inserted will be decoded according to the settings of the
1582 .Ar mime-decode-message
1584 .Ar mime-decode-header
1586 .It Ar mime-detach-batch
1587 If set, the detach command does not prompt for anything
1589 .Ar mime-detach-overwrite
1593 overwriting target files depending on the setting of
1594 .Ar mime-detach-overwrite .
1598 is the same as giving the
1600 flag on the command line.
1602 Normally, when you abort a message with two
1606 copies the partial letter to the file
1608 in your home directory.
1609 Setting the binary option
1613 A comma or whitespace delimited list of additional commands to page.
1614 The comparisons are case insensitive, so if
1616 is in the list, both
1622 If set, disable the pager on all commands.
1624 Suppresses the printing of the version when first invoked.
1625 .It Ar recursive-commands
1626 When defined, and threading is in effect, the following commands
1627 operate on the entire thread (if it is
1629 rather than just the top displayed message of the thread:
1630 .Bd -literal -offset indent
1631 More Page Print Type View more page print type view
1633 Save copy save write
1638 mbox mkread touch unread
1642 If not defined, or if the threads are
1644 commands behave exactly as they do in non-threaded mode, i.e., each
1645 operates on individual messages.
1647 Reverses the sense of
1652 .It Ar searchheaders
1653 If this option is set, then a message-list specifier in the form
1655 will expand to all messages containing the substring
1659 The string search is case insensitive.
1662 is omitted, it will default to the
1667 is omitted, only those messages that contain the field
1676 The first will match all messages which contain the substring
1678 in the headline (which is added locally at receipt time and begins
1681 The second will match all messages containing the substring
1689 The third will match all messages which contain the substring
1691 in a line of the message body.
1697 is case sensitive, so that
1701 can be used to search the
1705 fields, respectively.
1707 .Ar "regex-search" . )
1708 .It Ar smopts-verify
1709 Verify the sendmail options used on outgoing mail if they were obtained from a
1712 This has no effect if there are no sendmail flags or if the flags
1719 is the same as using the
1721 flag on the command line.
1722 When mail runs in verbose mode, the actual delivery of messages is
1723 displayed on the user's terminal.
1725 .Ss Option String Values
1728 Pathname of the text editor to use in the
1733 If not defined, then a default editor is used.
1735 Pathname of the directory lister to use in the
1741 Pathname of the program to use in the
1746 The default paginator
1748 is used if this option is not defined.
1750 Pathname of the shell to use in the
1755 A default shell is used if this option is not defined.
1757 Pathname of the text editor to use in the
1762 .It Ar el-completion-keys
1763 A comma or space delimited list of keys to do
1767 .Nm set el-completion-keys=^I,^D
1768 will bind completion to both the tab and CTRL-D keys.
1773 The line editing mode: must be
1777 If unset, editing is not enabled.
1781 .It Ar el-history-size
1782 The number of lines of history to remember.
1783 If unset, history is not enable.
1788 If defined, the first character of this option gives the character to
1793 The name of the directory to use for storing folders of
1795 If this name begins with a
1798 considers it to be an absolute pathname; otherwise, the
1799 folder directory is found relative to your home directory.
1800 .It Ar header-format
1801 If set, use this format string when displaying headers in command
1803 The format string supports the following conversions in addition to
1807 .Bl -tag -width ".Ar \&%?key?" -compact
1809 The header field with name
1815 and extract the address
1816 portion of the field (i.e.,
1826 This is intended to be used when displaying an
1827 .Dq exposed thread .
1828 .It Ar \&%?\*[Am]string?
1831 but uses the depth relative to the current depth rather than the
1834 The number of header lines in the message.
1836 The number of body lines in the message.
1838 The total number of lines in the message.
1840 The sender's full name (as in the
1853 The message status flag.
1855 The time zone name (if it exists).
1857 The email address of sender.
1861 The sender's login name (taken from the address).
1865 The total number of messages.
1867 The GMT offset (if found).
1870 If the format string begins with
1872 then the date will be extracted from the headline.
1873 Otherwise it will be extracted from the
1875 header falling back to the headline if that extraction fails.
1876 For example, the default format is:
1877 .Bd -literal -offset 0
1878 set header-format=\&"\&%??%P%Q%?* ?%3i \&%-21.20f \&%a \&%b \&%e \&%R \&%3K/%-5O \&\\"%q\\""
1881 Note 1: The message status flag
1883 will display the single character
1885 for the parent of a subthread.
1886 This will be overwritten by a
1894 indicating, respectively, a tagged, modified, saved, preserved,
1895 unread, new, or modified message, in that order with the last matching
1896 condition being the one displayed.
1897 In the case of hidden threads, the entire subthread is searched and
1898 the letters above will be displayed in lower case if the property is
1899 that of a hidden child with the case
1910 were redundant with \\t and \\n, respectively, so nothing is lost
1913 An option related to
1921 as the end of a message.
1922 If given a numeric argument
1926 will be accepted after
1933 .It Ar indentpreamble
1934 If set, this format string will be inserted before quoting a message
1939 The format syntax is the same as for
1941 For example, the following:
1942 .Bd -literal -offset 0
1944 \&"On \&%b \&%e \&%T, \&%Y \&%z (%Z), \&%n (%.50N) wrote:\\n-- Subject: \&%.65q\\n"
1947 would insert something like
1948 .Bd -literal -offset 0
1949 On Oct 27 11:00:07, 2006 -0400 (EDT), anon (Anon Ymous) wrote:
1950 -- Subject: suggestions for mail(1)
1953 before the quoted message.
1959 tilde escapes for indenting messages, in place of
1960 the normal tab character
1962 Be sure to quote the value if it contains
1964 .It Ar indentpostscript
1965 If set, this format string will be inserted after quoting a message
1970 The format syntax is the same as for
1972 For example, the following:
1973 .Bd -literal -offset 0
1974 set indentpostscript="-- End of excerpt from \&%.50N"
1977 would insert something like
1978 .Bd -literal -offset 0
1979 -- End of excerpt from Anon Ymous
1982 after the quoted message.
1983 .It Ar mime-body-TYPE-SUBTYPE
1984 MIME-hook for the body of a MIME block of
1985 .Ql "Content-Type: TYPE/SUBTYPE" .
1987 .Sy MIME Enhancements
1991 .Ql "Content-type: text"
1992 messages to this character set or
1994 if the value is empty.
1995 If unset, no character set conversion is done.
1996 .It Ar mime-detach-dir
1997 The directory to detach files to if the
1999 command is given no arguments.
2002 .It Ar mime-detach-overwrite
2003 This controls overwriting of existing files by the detach command.
2006 the user will be prompted before overwriting a file.
2009 or to the empty string, existing target files will be overwritten.
2012 no target files will be overwritten.
2013 .It Ar mime-encode-message
2014 If set, encode the body of the message as required.
2015 Typically, this is just an issue of whether
2016 .Ql quoted-printable
2017 encoding is used or not.
2018 If it has a value, then use it to determine the encoding type.
2023 .Ql quoted-printable ,
2026 .It Ar mime-head-TYPE-SUBTYPE
2027 MIME-hook for the header of a MIME block of
2028 .Ql "Content-Type: TYPE/SUBTYPE" .
2030 .Sy MIME Enhancements
2032 .It Ar mime-hook-TYPE-SUBTYPE
2033 MIME-hook for MIME block of
2034 .Ql "Content-Type: TYPE/SUBTYPE" .
2036 .Sy MIME Enhancements
2042 It can be the name of a folder.
2045 in the user's home directory.
2047 If defined, it specifies the prompt to use when in command mode.
2048 Otherwise, the default
2051 The format syntax is the same as for
2054 If defined, gives the pathname of the file used to record all outgoing
2056 If not defined, then outgoing mail is not so saved.
2058 If set, regular expression searches are used, instead of simple case
2059 insensitive substring matches, when determining message lists by
2060 searching sender names, subjects, or header fields (if
2062 is defined); see the
2063 .Sx Specifying message
2065 The value of the variable is a space or comma delimited list of
2069 to do case insensitive searches,
2071 to use extended (rather than basic) regular expressions, and
2073 to turn off all special character meanings and do literal string
2079 are not compatible (see
2081 .It Ar ReplyAsRecipient
2082 This is used when replying to email (see the
2087 It is useful if you have multiple email addresses and wish to ensure
2088 that replies respect them.
2089 If set, grab the email address(es) from the
2091 field of the message being replied to.
2092 If there is only one such address, and if it does not match any
2093 address in the value of
2094 .Ar ReplyAsRecipient
2095 (a comma or space delimited list of addresses, possibly empty), then
2096 use this address in the
2099 This is accomplished by passing the address to
2104 Note: the sendmail options can be edited with the
2111 If defined, gives the number of lines of a message to be printed out
2114 command; normally, the first five lines are printed.
2116 .Ss MIME Enhancements
2117 A MIME message is (recursively) divided into a series of MIME parts
2118 that can be thought of as sub-messages, each with a header and body.
2119 When MIME support is enabled (by setting
2120 .Ar mime-decode-message ) ,
2122 splits a message into a series of its smallest MIME parts and
2123 processes those parts as if they were messages themselves, passing the
2124 header and body through a pipeline of the form:
2126 .Dl mail -\*[Gt] MIME-decoder -\*[Gt] MIME-hook -\*[Gt] pager -\*[Gt] screen
2133 .Ql quoted-printable
2134 encoding and is enabled according to the
2135 .Ql Content-Transfer-Encoding
2139 is an external program to further process the part (see below).
2142 is the program that pages the message
2145 Any of these intermediate pipe stages may be missing and/or different
2146 for the head and body of each MIME part.
2149 may disable the entire pipeline (e.g.,
2150 .Ql application/octet ) .
2154 stage is not present unless one of the following variables is set:
2155 .Bd -literal -offset indent
2156 mime-hook-TYPE-SUBTYPE applies to the entire MIME part
2157 mime-head-TYPE-SUBTYPE applies to the header of the MIME part
2158 mime-body-TYPE-SUBTYPE applies to the body of the MIME part
2161 where TYPE and SUBTYPE are the
2164 (respectively) of the MIME part to which the hook applies.
2167 is missing, any subtype is matched.
2168 The value of these variables has the format:
2169 .Bd -filled -offset indent
2176 is expected to read from stdin and write to stdout, and the possible
2178 .Bl -tag -width Ds -offset indent
2182 in a sub-shell rather than doing an
2187 Use this hook when selecting the part to display in a
2188 .Ql multipart/alternative
2190 Multipart blocks contain
2192 versions with the same information, in increasing order of preference
2193 (and decoding complexity).
2194 The last one the mail agent understands is the one to be displayed.
2195 This is typically used for sending a message in both
2199 but more complex subtypes are also possible.
2201 Do not decode before executing
2207 begins with one of these flags, precede it with a space to signal the
2210 WARNING: automatically running a program is a potential security risk
2211 if that program has bugs, so be careful what you run.
2215 .Ql "Content-Type: image/jpeg"
2218 (assuming it is installed):
2220 .Dl set mime-body-image-jpeg="/usr/pkg/bin/xv -"
2223 .Ql "Content-Type: images/*"
2226 (assuming it is installed), placing the results in
2229 .Dl set mime-hook-image="-/usr/pkg/bin/uudeview -p /tmp -i -a +o -q -"
2232 .Ql "Content-Type: text/html"
2235 (assuming it is installed) and add this support to
2236 .Ql multipart/alternative
2239 .Bd -literal -offset indent
2240 set mime-body-text-html="+/usr/pkg/bin/lynx -force_html -dump -stdin"
2249 environment variables.
2251 .Bl -tag -width /usr/share/misc/mail.*help -compact
2257 File giving initial mail commands.
2258 This can be overridden by setting the
2260 environment variable.
2263 .It Pa /usr/share/misc/mail.*help
2266 System initialization file.
2277 .%T "The Mail Reference Manual"
2285 This man page is derived from
2286 .%T "The Mail Reference Manual"
2287 originally written by Kurt Shoens.
2289 There are some flags and commands that are not documented here.
2290 Most are not useful to the general user.
2296 which can be confusing.
2300 list is incorrect English (it should be
2301 .Dq alternatives ) ,
2302 but is retained for compatibility.
2304 There must be sufficient space on $TMPDIR for various temporary files.
2306 If an unrecoverable character set conversion error occurs (during
2307 display), the message is truncated and a warning is printed.
2308 This seems to be rare, but probably the remainder of the message
2309 should be printed without conversion.
2311 The internal sh-like parser is not terribly sh-like.
2313 Selecting messages by their content (i.e., with