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