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