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 | .\" |
a12ff486 | 6 | .\" @(#)mail.1 8.1 (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 | |
91d7df00 KM |
30 | is a intelligent mail processing system, which has |
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 | |
dcee403d | 39 | delivery are displayed on the users 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 CL |
54 | Inhibits reading |
55 | .Pa /usr/share/misc/Mail.rc | |
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 \&? | |
b14a7a4a CL |
423 | .It Ic hold |
424 | .Pf ( Ic ho , | |
b5dc1377 CL |
425 | also |
426 | .Ic preserve ) | |
427 | Takes a message list and marks each | |
91d7df00 KM |
428 | message therein to be saved in the |
429 | user's system mailbox instead of in | |
b5dc1377 | 430 | .Ar mbox . |
91d7df00 | 431 | Does not override the |
b5dc1377 | 432 | .Ic delete |
91d7df00 | 433 | command. |
b14a7a4a | 434 | .It Ic ignore |
dcee403d | 435 | Add the list of header fields named to the |
b5dc1377 | 436 | .Ar ignored list |
dcee403d | 437 | Header fields in the ignore list are not printed |
b14a7a4a CL |
438 | on your terminal when you print a message. |
439 | This | |
dcee403d | 440 | command is very handy for suppression of certain machine-generated |
b14a7a4a CL |
441 | header fields. |
442 | The | |
b5dc1377 | 443 | .Ic Type |
dcee403d | 444 | and |
b5dc1377 | 445 | .Ic Print |
dcee403d | 446 | commands can be used to print a message in its entirety, including |
b14a7a4a CL |
447 | ignored fields. |
448 | If | |
b5dc1377 | 449 | .Ic ignore |
dcee403d KM |
450 | is executed with no arguments, it lists the current set of |
451 | ignored fields. | |
b14a7a4a CL |
452 | .It Ic mail |
453 | .Pq Ic m | |
b5dc1377 | 454 | Takes as argument login names and distribution group names and sends |
91d7df00 | 455 | mail to those people. |
b14a7a4a | 456 | .It Ic mbox |
dcee403d | 457 | Indicate that a list of messages be sent to |
b5dc1377 | 458 | .Ic mbox |
b14a7a4a CL |
459 | in your home directory when you quit. |
460 | This is the default | |
dcee403d | 461 | action for messages if you do |
b5dc1377 | 462 | .Em not |
dcee403d | 463 | have the |
b5dc1377 | 464 | .Ic hold |
dcee403d | 465 | option set. |
b14a7a4a CL |
466 | .It Ic next |
467 | .Pq Ic n | |
b5dc1377 CL |
468 | like |
469 | .Ic \&+ | |
b14a7a4a CL |
470 | or |
471 | .Tn CR ) | |
472 | Goes to the next message in sequence and types it. | |
91d7df00 | 473 | With an argument list, types the next matching message. |
b14a7a4a CL |
474 | .It Ic preserve |
475 | .Pq Ic pre | |
91d7df00 | 476 | A synonym for |
b5dc1377 | 477 | .Ic hold . |
b14a7a4a CL |
478 | .It Ic print |
479 | .Pq Ic p | |
dcee403d | 480 | Takes a message list and types out each message on the user's terminal. |
b14a7a4a CL |
481 | .It Ic quit |
482 | .Pq Ic q | |
b5dc1377 | 483 | Terminates the session, saving all undeleted, unsaved messages in |
91d7df00 | 484 | the user's |
b5dc1377 | 485 | .Ar mbox |
91d7df00 | 486 | file in his login directory, preserving all messages marked with |
b5dc1377 | 487 | .Ic hold |
91d7df00 | 488 | or |
b5dc1377 | 489 | .Ic preserve |
91d7df00 KM |
490 | or never referenced |
491 | in his system mailbox, and removing all other messages from his system | |
b14a7a4a CL |
492 | mailbox. |
493 | If new mail has arrived during the session, the message | |
494 | .Dq Li "You have new mail" | |
495 | is given. | |
496 | If given while editing a | |
91d7df00 | 497 | mailbox file with the |
b5dc1377 | 498 | .Fl f |
b14a7a4a CL |
499 | flag, then the edit file is rewritten. |
500 | A return to the Shell is | |
91d7df00 KM |
501 | effected, unless the rewrite of edit file fails, in which case the user |
502 | can escape with the | |
b5dc1377 | 503 | .Ic exit |
91d7df00 | 504 | command. |
b14a7a4a CL |
505 | .It Ic reply |
506 | .Pq Ic r | |
dcee403d KM |
507 | Takes a message list and sends mail to the sender and all |
508 | recipients of the specified message. | |
509 | The default message must not be deleted. | |
b14a7a4a | 510 | .It Ic respond |
91d7df00 | 511 | A synonym for |
b5dc1377 | 512 | .Ic reply . |
b14a7a4a | 513 | .It Ic retain |
bb04cec6 | 514 | Add the list of header fields named to the |
b5dc1377 | 515 | .Ar retained list |
bb04cec6 KM |
516 | Only the header fields in the retain list |
517 | are shown on your terminal when you print a message. | |
518 | All other header fields are suppressed. | |
519 | The | |
b5dc1377 | 520 | .Ic Type |
bb04cec6 | 521 | and |
b5dc1377 | 522 | .Ic Print |
bb04cec6 KM |
523 | commands can be used to print a message in its entirety. |
524 | If | |
b5dc1377 | 525 | .Ic retain |
bb04cec6 KM |
526 | is executed with no arguments, it lists the current set of |
527 | retained fields. | |
b14a7a4a CL |
528 | .It Ic save |
529 | .Pq Ic s | |
b5dc1377 | 530 | Takes a message list and a filename and appends each message in |
b14a7a4a CL |
531 | turn to the end of the file. |
532 | The filename in quotes, followed by the line | |
b5dc1377 | 533 | count and character count is echoed on the user's terminal. |
b14a7a4a CL |
534 | .It Ic set |
535 | .Pq Ic se | |
536 | With no arguments, prints all variable values. | |
537 | Otherwise, sets | |
538 | option. | |
539 | Arguments are of the form | |
b5dc1377 | 540 | .Ar option=value |
bb04cec6 | 541 | (no space before or after =) or |
b5dc1377 | 542 | .Ar option . |
692b0644 | 543 | Quotation marks may be placed around any part of the assignment statement to |
b5dc1377 | 544 | quote blanks or tabs, i.e. |
b14a7a4a CL |
545 | .Dq Li "set indentprefix=\*q->\*q" |
546 | .It Ic saveignore | |
b5dc1377 CL |
547 | .Ic Saveignore |
548 | is to | |
549 | .Ic save | |
550 | what | |
551 | .Ic ignore | |
552 | is to | |
553 | .Ic print | |
554 | and | |
555 | .Ic type . | |
556 | Header fields thus marked are filtered out when | |
557 | saving a message by | |
558 | .Ic save | |
559 | or when automatically saving to | |
560 | .Ar mbox . | |
b14a7a4a | 561 | .It Ic saveretain |
b5dc1377 CL |
562 | .Ic Saveretain |
563 | is to | |
564 | .Ic save | |
565 | what | |
566 | .Ic retain | |
567 | is to | |
568 | .Ic print | |
569 | and | |
570 | .Ic type . | |
571 | Header fields thus marked are the only ones saved | |
572 | with a message when saving by | |
573 | .Ic save | |
574 | or when automatically saving to | |
575 | .Ar mbox . | |
576 | .Ic Saveretain | |
577 | overrides | |
578 | .Ic saveignore . | |
b14a7a4a CL |
579 | .It Ic shell |
580 | .Pq Ic sh | |
b5dc1377 | 581 | Invokes an interactive version of the shell. |
b14a7a4a | 582 | .It Ic size |
91d7df00 KM |
583 | Takes a message list and prints out the size in characters of each |
584 | message. | |
b14a7a4a | 585 | .It Ic source |
dcee403d | 586 | The |
b5dc1377 | 587 | .Ic source |
dcee403d | 588 | command reads |
dcee403d | 589 | commands from a file. |
b14a7a4a CL |
590 | .It Ic top |
591 | Takes a message list and prints the top few lines of each. | |
592 | The number of | |
91d7df00 | 593 | lines printed is controlled by the variable |
b5dc1377 | 594 | .Ic toplines |
91d7df00 | 595 | and defaults to five. |
b14a7a4a CL |
596 | .It Ic type |
597 | .Pq Ic t | |
b5dc1377 CL |
598 | A synonym for |
599 | .Ic print . | |
b14a7a4a | 600 | .It Ic unalias |
91d7df00 | 601 | Takes a list of names defined by |
b5dc1377 | 602 | .Ic alias |
b14a7a4a CL |
603 | commands and discards the remembered groups of users. |
604 | The group names | |
91d7df00 | 605 | no longer have any significance. |
b14a7a4a CL |
606 | .It Ic undelete |
607 | .Pq Ic u | |
b5dc1377 CL |
608 | Takes a message list and marks each message as |
609 | .Ic not | |
91d7df00 | 610 | being deleted. |
b14a7a4a CL |
611 | .It Ic unread |
612 | .Pq Ic U | |
b5dc1377 CL |
613 | Takes a message list and marks each message as |
614 | .Ic not | |
634278dc | 615 | having been read. |
b14a7a4a | 616 | .It Ic unset |
91d7df00 KM |
617 | Takes a list of option names and discards their remembered values; |
618 | the inverse of | |
b5dc1377 | 619 | .Ic set . |
b14a7a4a CL |
620 | .It Ic visual |
621 | .Pq Ic v | |
b5dc1377 | 622 | Takes a message list and invokes the display editor on each message. |
b14a7a4a CL |
623 | .It Ic write |
624 | .Pq Ic w | |
b5dc1377 CL |
625 | Similar to |
626 | .Ic save , | |
b3f2d791 | 627 | except that |
b5dc1377 CL |
628 | .Ic only |
629 | the message body | |
b14a7a4a | 630 | .Pq Ar without |
b5dc1377 | 631 | the header) is saved. |
b3f2d791 S |
632 | Extremely useful for such tasks as sending and receiving source |
633 | program text over the message system. | |
b14a7a4a CL |
634 | .It Ic xit |
635 | .Pq Ic x | |
b5dc1377 CL |
636 | A synonym for |
637 | .Ic exit . | |
b14a7a4a | 638 | .It Ic z |
b5dc1377 | 639 | .Nm Mail |
dcee403d | 640 | presents message headers in windowfuls as described under the |
b5dc1377 | 641 | .Ic headers |
b14a7a4a CL |
642 | command. |
643 | You can move | |
644 | .Nm mail Ns 's | |
dcee403d | 645 | attention forward to the next window with the |
b5dc1377 | 646 | .Ic \&z |
b14a7a4a CL |
647 | command. |
648 | Also, you can move to the previous window by using | |
b5dc1377 | 649 | .Ic \&z\&\- . |
b14a7a4a | 650 | .El |
b5dc1377 CL |
651 | .Ss Tilde/Escapes |
652 | .Pp | |
91d7df00 KM |
653 | Here is a summary of the tilde escapes, |
654 | which are used when composing messages to perform | |
b14a7a4a CL |
655 | special functions. |
656 | Tilde escapes are only recognized at the beginning | |
657 | of lines. | |
658 | The name | |
b5dc1377 | 659 | .Dq Em tilde\ escape |
91d7df00 KM |
660 | is somewhat of a misnomer since the actual escape character can be set |
661 | by the option | |
b5dc1377 | 662 | .Ic escape . |
b14a7a4a CL |
663 | .Bl -tag -width Ds |
664 | .It Ic \&~! Ns Ar command | |
91d7df00 | 665 | Execute the indicated shell command, then return to the message. |
b14a7a4a | 666 | .It Ic \&~b Ns Ar name ... |
cb530a2d KM |
667 | Add the given names to the list of carbon copy recipients but do not make |
668 | the names visible in the Cc: line ("blind" carbon copy). | |
b14a7a4a | 669 | .It Ic \&~c Ns Ar name ... |
91d7df00 | 670 | Add the given names to the list of carbon copy recipients. |
b14a7a4a | 671 | .It Ic \&~d |
b5dc1377 CL |
672 | Read the file |
673 | .Dq Pa dead.letter | |
674 | from your home directory into the message. | |
b14a7a4a CL |
675 | .It Ic \&~e |
676 | Invoke the text editor on the message collected so far. | |
677 | After the | |
91d7df00 KM |
678 | editing session is finished, you may continue appending text to the |
679 | message. | |
b14a7a4a | 680 | .It Ic \&~f Ns Ar messages |
dcee403d KM |
681 | Read the named messages into the message being sent. |
682 | If no messages are specified, read in the current message. | |
b5dc1377 CL |
683 | Message headers currently being ignored (by the |
684 | .Ic ignore | |
685 | or | |
686 | .Ic retain | |
84931b71 | 687 | command) are not included. |
b14a7a4a | 688 | .It Ic \&~F Ns Ar messages |
b5dc1377 | 689 | Identical to |
5325ced3 | 690 | .Ic \&~f , |
b5dc1377 | 691 | except all message headers are included. |
b14a7a4a | 692 | .It Ic \&~h |
91d7df00 KM |
693 | Edit the message header fields by typing each one in turn and allowing |
694 | the user to append text to the end or modify the field by using the | |
695 | current terminal erase and kill characters. | |
b14a7a4a | 696 | .It Ic \&~m Ns Ar messages |
0f642f7e | 697 | Read the named messages into the message being sent, indented by a |
b5dc1377 CL |
698 | tab or by the value of |
699 | .Ar indentprefix . | |
700 | If no messages are specified, | |
84931b71 | 701 | read the current message. |
b5dc1377 CL |
702 | Message headers currently being ignored (by the |
703 | .Ic ignore | |
704 | or | |
705 | .Ic retain | |
84931b71 | 706 | command) are not included. |
b14a7a4a | 707 | .It Ic \&~M Ns Ar messages |
b5dc1377 CL |
708 | Identical to |
709 | .Ic \&~m , | |
710 | except all message headers are included. | |
b14a7a4a | 711 | .It Ic \&~p |
91d7df00 KM |
712 | Print out the message collected so far, prefaced by the message header |
713 | fields. | |
b14a7a4a | 714 | .It Ic \&~q |
91d7df00 | 715 | Abort the message being sent, copying the message to |
b5dc1377 | 716 | .Dq Pa dead.letter |
91d7df00 | 717 | in your home directory if |
b5dc1377 | 718 | .Ic save |
91d7df00 | 719 | is set. |
b14a7a4a | 720 | .It Ic \&~r Ns Ar filename |
91d7df00 | 721 | Read the named file into the message. |
b14a7a4a | 722 | .It Ic \&~s Ns Ar string |
91d7df00 | 723 | Cause the named string to become the current subject field. |
b14a7a4a | 724 | .It Ic \&~\&t Ns Ar name ... |
91d7df00 | 725 | Add the given names to the direct recipient list. |
b14a7a4a CL |
726 | .It Ic \&~\&v |
727 | Invoke an alternate editor (defined by the | |
728 | .Ev VISUAL | |
729 | option) on the | |
730 | message collected so far. | |
731 | Usually, the alternate editor will be a | |
732 | screen editor. | |
733 | After you quit the editor, you may resume appending | |
91d7df00 | 734 | text to the end of your message. |
b14a7a4a | 735 | .It Ic \&~w Ns Ar filename |
91d7df00 | 736 | Write the message onto the named file. |
b14a7a4a CL |
737 | .It Ic \&~\&| Ns Ar command |
738 | Pipe the message through the command as a filter. | |
739 | If the command gives | |
91d7df00 | 740 | no output or terminates abnormally, retain the original text of the |
b14a7a4a CL |
741 | message. |
742 | The command | |
743 | .Xr fmt 1 | |
91d7df00 | 744 | is often used as |
b5dc1377 | 745 | .Ic command |
91d7df00 | 746 | to rejustify the message. |
b14a7a4a CL |
747 | .It Ic \&~: Ns Ar mail-command |
748 | Execute the given mail command. | |
749 | Not all commands, however, are allowed. | |
750 | .It Ic \&~~ Ns Ar string | |
751 | Insert the string of text in the message prefaced by a single ~. | |
752 | If | |
91d7df00 KM |
753 | you have changed the escape character, then you should double |
754 | that character in order to send it. | |
b14a7a4a | 755 | .El |
b5dc1377 CL |
756 | .Ss Mail Options |
757 | Options are controlled via | |
758 | .Ic set | |
91d7df00 | 759 | and |
b5dc1377 | 760 | .Ic unset |
b14a7a4a CL |
761 | commands. |
762 | Options may be either binary, in which case it is only | |
bfe02f44 | 763 | significant to see whether they are set or not; or string, in which |
91d7df00 KM |
764 | case the actual value is of interest. |
765 | The binary options include the following: | |
b14a7a4a CL |
766 | .Bl -tag -width append |
767 | .It Ar append | |
91d7df00 | 768 | Causes messages saved in |
b5dc1377 | 769 | .Ar mbox |
91d7df00 | 770 | to be appended to the end rather than prepended. |
5325ced3 CL |
771 | This should always be set (perhaps in |
772 | .Pa /usr/share/misc/Mail.rc ) . | |
b14a7a4a | 773 | .It Ar ask |
91d7df00 | 774 | Causes |
b5dc1377 | 775 | .Nm mail |
b14a7a4a CL |
776 | to prompt you for the subject of each message you send. |
777 | If | |
91d7df00 | 778 | you respond with simply a newline, no subject field will be sent. |
b14a7a4a | 779 | .It Ar askcc |
91d7df00 | 780 | Causes you to be prompted for additional carbon copy recipients at the |
b14a7a4a CL |
781 | end of each message. |
782 | Responding with a newline indicates your | |
91d7df00 | 783 | satisfaction with the current list. |
b14a7a4a | 784 | .It Ar autoprint |
91d7df00 | 785 | Causes the |
b5dc1377 | 786 | .Ic delete |
91d7df00 | 787 | command to behave like |
b5dc1377 | 788 | .Ic dp |
91d7df00 KM |
789 | \- thus, after deleting a message, the next one will be typed |
790 | automatically. | |
b14a7a4a | 791 | .It Ar debug |
dcee403d | 792 | Setting the binary option |
b5dc1377 | 793 | .Ar debug |
dcee403d | 794 | is the same as specifying |
b5dc1377 | 795 | .Fl d |
dcee403d | 796 | on the command line and causes |
b5dc1377 | 797 | .Nm mail |
dcee403d | 798 | to output all sorts of information useful for debugging |
b5dc1377 | 799 | .Nm mail . |
b14a7a4a | 800 | .It Ar dot |
dcee403d | 801 | The binary option |
b5dc1377 | 802 | .Ar dot |
dcee403d | 803 | causes |
b5dc1377 | 804 | .Nm mail |
dcee403d KM |
805 | to interpret a period alone on a line as the terminator |
806 | of a message you are sending. | |
b14a7a4a | 807 | .It Ar hold |
dcee403d KM |
808 | This option is used to hold messages in the system mailbox |
809 | by default. | |
b14a7a4a | 810 | .It Ar ignore |
91d7df00 KM |
811 | Causes interrupt signals from your terminal to be ignored and echoed as |
812 | @'s. | |
b14a7a4a | 813 | .It Ar ignoreeof |
dcee403d | 814 | An option related to |
b5dc1377 | 815 | .Ar dot |
dcee403d | 816 | is |
b5dc1377 | 817 | .Ar ignoreeof |
dcee403d | 818 | which makes |
b5dc1377 | 819 | .Nm mail |
dcee403d | 820 | refuse to accept a control-d as the end of a message. |
b5dc1377 | 821 | .Ar Ignoreeof |
dcee403d | 822 | also applies to |
b5dc1377 | 823 | .Nm mail |
dcee403d | 824 | command mode. |
b14a7a4a | 825 | .It Ar metoo |
91d7df00 | 826 | Usually, when a group is expanded that contains the sender, the sender |
b14a7a4a CL |
827 | is removed from the expansion. |
828 | Setting this option causes the sender | |
91d7df00 | 829 | to be included in the group. |
b14a7a4a | 830 | .It Ar noheader |
84931b71 | 831 | Setting the option |
b5dc1377 | 832 | .Ar noheader |
84931b71 | 833 | is the same as giving the |
b5dc1377 | 834 | .Fl N |
84931b71 | 835 | flag on the command line. |
b14a7a4a | 836 | .It Ar nosave |
b5dc1377 | 837 | Normally, when you abort a message with two |
b14a7a4a | 838 | .Tn RUBOUT |
b5dc1377 CL |
839 | (erase or delete) |
840 | .Nm mail | |
841 | copies the partial letter to the file | |
842 | .Dq Pa dead.letter | |
b14a7a4a CL |
843 | in your home directory. |
844 | Setting the binary option | |
b5dc1377 | 845 | .Ar nosave |
dcee403d | 846 | prevents this. |
b14a7a4a | 847 | .It Ar Replyall |
634278dc | 848 | Reverses the sense of |
b5dc1377 | 849 | .Ic reply |
634278dc | 850 | and |
b5dc1377 | 851 | .Ic Reply |
634278dc | 852 | commands. |
b14a7a4a | 853 | .It Ar quiet |
91d7df00 | 854 | Suppresses the printing of the version when first invoked. |
c2e1b7e6 EW |
855 | .It Ar searchheaders |
856 | If this option is set, then a message-list specifier in the form ``/x:y'' | |
857 | will expand to all messages containing the substring ``y'' in the header | |
858 | field ``x''. The string search is case insensitive. | |
b14a7a4a | 859 | .It Ar verbose |
dcee403d | 860 | Setting the option |
b5dc1377 | 861 | .Ar verbose |
dcee403d | 862 | is the same as using the |
b5dc1377 | 863 | .Fl v |
b14a7a4a CL |
864 | flag on the command line. |
865 | When mail runs in verbose mode, | |
dcee403d KM |
866 | the actual delivery of messages is displayed on he users |
867 | terminal. | |
b14a7a4a | 868 | .El |
b5dc1377 | 869 | .Ss Option String Values |
b14a7a4a CL |
870 | .Bl -tag -width Va |
871 | .It Ev EDITOR | |
91d7df00 | 872 | Pathname of the text editor to use in the |
b5dc1377 CL |
873 | .Ic edit |
874 | command and | |
875 | .Ic \&~e | |
b14a7a4a CL |
876 | escape. |
877 | If not defined, then a default editor is used. | |
878 | .It Ev LISTER | |
84931b71 | 879 | Pathname of the directory lister to use in the |
b5dc1377 | 880 | .Ic folders |
b14a7a4a CL |
881 | command. |
882 | Default is | |
b5dc1377 | 883 | .Pa /bin/ls . |
b14a7a4a | 884 | .It Ev PAGER |
634278dc | 885 | Pathname of the program to use in the |
b5dc1377 | 886 | .Ic more |
634278dc | 887 | command or when |
b5dc1377 | 888 | .Ic crt |
b14a7a4a CL |
889 | variable is set. |
890 | The default paginator | |
b5dc1377 | 891 | .Xr more 1 |
692b0644 | 892 | is used if this option is not defined. |
b14a7a4a | 893 | .It Ev SHELL |
91d7df00 | 894 | Pathname of the shell to use in the |
b5dc1377 CL |
895 | .Ic \&! |
896 | command and the | |
897 | .Ic \&~! | |
b14a7a4a CL |
898 | escape. |
899 | A default shell is used if this option is | |
91d7df00 | 900 | not defined. |
b14a7a4a | 901 | .It Ev VISUAL |
91d7df00 | 902 | Pathname of the text editor to use in the |
b5dc1377 CL |
903 | .Ic visual |
904 | command and | |
905 | .Ic \&~v | |
906 | escape. | |
b14a7a4a | 907 | .It Va crt |
dcee403d | 908 | The valued option |
b5dc1377 | 909 | .Va crt |
dcee403d KM |
910 | is used as a threshold to determine how long a message must |
911 | be before | |
b14a7a4a CL |
912 | .Ev PAGER |
913 | is used to read it. | |
914 | If | |
b5dc1377 CL |
915 | .Va crt |
916 | is set without a value, | |
84931b71 | 917 | then the height of the terminal screen stored in the system |
b5dc1377 CL |
918 | is used to compute the threshold (see |
919 | .Xr stty 1 ) . | |
b14a7a4a | 920 | .It Ar escape |
91d7df00 KM |
921 | If defined, the first character of this option gives the character to |
922 | use in the place of ~ to denote escapes. | |
b14a7a4a | 923 | .It Ar folder |
dcee403d | 924 | The name of the directory to use for storing folders of |
b14a7a4a CL |
925 | messages. |
926 | If this name begins with a `/', | |
b5dc1377 | 927 | .Nm mail |
dcee403d KM |
928 | considers it to be an absolute pathname; otherwise, the |
929 | folder directory is found relative to your home directory. | |
b14a7a4a | 930 | .It Ev MBOX |
b5dc1377 CL |
931 | The name of the |
932 | .Ar mbox | |
b14a7a4a CL |
933 | file. |
934 | It can be the name of a folder. | |
b5dc1377 CL |
935 | The default is |
936 | .Dq Li mbox | |
937 | in the user's home directory. | |
b14a7a4a | 938 | .It Ar record |
91d7df00 | 939 | If defined, gives the pathname of the file used to record all outgoing |
b14a7a4a CL |
940 | mail. |
941 | If not defined, then outgoing mail is not so saved. | |
942 | .It Ar indentprefix | |
0f642f7e | 943 | String used by the ``~m'' tilde escape for indenting messages, in place of |
b14a7a4a CL |
944 | the normal tab character (^I). |
945 | Be sure to quote the value if it contains | |
692b0644 | 946 | spaces or tabs. |
b14a7a4a | 947 | .It Ar toplines |
91d7df00 KM |
948 | If defined, gives the number of lines of a message to be printed out |
949 | with the | |
b5dc1377 | 950 | .Ic top |
91d7df00 | 951 | command; normally, the first five lines are printed. |
b14a7a4a | 952 | .El |
b5dc1377 CL |
953 | .Sh ENVIRONMENT |
954 | .Nm Mail | |
955 | utilizes the | |
956 | .Ev HOME | |
957 | and | |
958 | .Ev USER | |
959 | environment variables. | |
960 | .Sh FILES | |
b14a7a4a CL |
961 | .Bl -tag -width /usr/share/misc/Mail.help* -compact |
962 | .It Pa /var/spool/mail/* | |
963 | Post office. | |
964 | .It ~/mbox | |
965 | User's old mail. | |
966 | .It ~/.mailrc | |
967 | File giving initial mail commands. | |
968 | .It Pa /tmp/R* | |
969 | Temporary files. | |
970 | .It Pa /usr/share/misc/Mail.help* | |
971 | Help files. | |
972 | .It Pa /usr/share/misc/Mail.rc | |
973 | System initialization file. | |
974 | .El | |
b5dc1377 | 975 | .Sh SEE ALSO |
b5dc1377 CL |
976 | .Xr fmt 1 , |
977 | .Xr newaliases 1 , | |
978 | .Xr vacation 1 , | |
979 | .Xr aliases 5 , | |
980 | .Xr mailaddr 7 , | |
981 | .Xr sendmail 8 | |
982 | and | |
b14a7a4a CL |
983 | .Rs |
984 | .%T "The Mail Reference Manual" . | |
985 | .Re | |
b5dc1377 CL |
986 | .Sh HISTORY |
987 | A | |
988 | .Nm mail | |
989 | command | |
b14a7a4a CL |
990 | appeared in |
991 | .At v6 . | |
b5dc1377 | 992 | This man page is derived from |
b14a7a4a | 993 | .%T "The Mail Reference Manual" |
b5dc1377 CL |
994 | originally written by Kurt Shoens. |
995 | .Sh BUGS | |
b14a7a4a CL |
996 | There are some flags that are not documented here. |
997 | Most are | |
dcee403d | 998 | not useful to the general user. |
b5dc1377 | 999 | .Pp |
dcee403d | 1000 | Usually, |
b5dc1377 | 1001 | .Nm mail |
dcee403d | 1002 | is just a link to |
b5dc1377 | 1003 | .Nm Mail , |
dcee403d | 1004 | which can be confusing. |