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