Commit | Line | Data |
---|---|---|
e1802a75 KD |
1 | .\" Copyright (c) 1980 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
8c80966d | 5 | .\" @(#)mail4.nr 6.1 (Berkeley) 5/23/86 |
e1802a75 | 6 | .\" |
6d7e256b KD |
7 | .bp |
8 | .sh 1 "More about sending mail" | |
9 | .sh 2 "Tilde escapes" | |
10 | .pp | |
11 | While typing in a message to be sent to others, it is often | |
12 | useful to be able to invoke the text editor on the partial message, | |
13 | print the message, execute a shell command, or do some other | |
14 | auxiliary function. | |
15 | .i Mail | |
16 | provides these capabilities through | |
17 | .i "tilde escapes" , | |
18 | which consist of a tilde (~) at the beginning of a line, followed by | |
19 | a single character which indicates the function to be performed. For | |
20 | example, to print the text of the message so far, use: | |
21 | .(l | |
22 | ~p | |
23 | .)l | |
24 | which will print a line of dashes, the recipients of your message, and | |
25 | the text of the message so far. | |
26 | Since | |
27 | .i Mail | |
28 | requires two consecutive \s-2RUBOUT\s0's to abort a letter, you | |
29 | can use a single \s-2RUBOUT\s0 to abort the output of ~p or any other | |
30 | ~ escape without killing your letter. | |
31 | .pp | |
32 | If you are dissatisfied with the message as | |
33 | it stands, you can invoke the text editor on it using the escape | |
34 | .(l | |
35 | ~e | |
36 | .)l | |
37 | which causes the message to be copied into a temporary file and an | |
38 | instance of the editor to be spawned. After modifying the message to | |
39 | your satisfaction, write it out and quit the editor. | |
40 | .i Mail | |
41 | will respond | |
42 | by typing | |
43 | .(l | |
44 | (continue) | |
45 | .)l | |
46 | after which you may continue typing text which will be appended to your | |
47 | message, or type <control-d> to end the message. | |
48 | A standard text editor is provided by | |
49 | .i Mail . | |
50 | You can override this default by setting the valued option | |
51 | .q EDITOR | |
52 | to something else. For example, you might prefer: | |
53 | .(l | |
54 | set EDITOR=/usr/ucb/ex | |
55 | .)l | |
56 | .pp | |
57 | Many systems offer a screen editor as an alternative to the standard | |
58 | text editor, such as the | |
59 | .i vi | |
60 | editor from UC Berkeley. | |
61 | To use the screen, or | |
62 | .i visual | |
63 | editor, on your current message, you can use the escape, | |
64 | .(l | |
65 | ~v | |
66 | .)l | |
67 | ~v works like ~e, except that the screen editor is invoked instead. | |
68 | A default screen editor is defined by | |
69 | .i Mail . | |
70 | If it does not suit you, you can set the valued option | |
71 | .q VISUAL | |
72 | to the path name of a different editor. | |
73 | .pp | |
74 | It is often useful to be able to include the contents of some | |
75 | file in your message; the escape | |
76 | .(l | |
77 | ~r filename | |
78 | .)l | |
79 | is provided for this purpose, and causes the named file to be appended | |
80 | to your current message. | |
81 | .i Mail | |
82 | complains if the file doesn't exist | |
83 | or can't be read. If the read is successful, the number of lines and | |
84 | characters appended to your message is printed, after which you may continue | |
85 | appending text. The filename may contain shell metacharacters like * and ? | |
86 | which are expanded according to the conventions of your shell. | |
87 | .pp | |
88 | As a special case of ~r, the escape | |
89 | .(l | |
90 | ~d | |
91 | .)l | |
92 | reads in the file | |
93 | .q dead.letter | |
94 | in your home directory. This is often useful since | |
95 | .i Mail | |
96 | copies the text | |
97 | of your message there when you abort a message with \s-2RUBOUT\s0. | |
98 | .pp | |
99 | To save the current text of your message on a file you may use the | |
100 | .(l | |
101 | ~w filename | |
102 | .)l | |
103 | escape. | |
104 | .i Mail | |
105 | will print out the number of lines and characters written | |
106 | to the file, after which you may continue appending text to your message. | |
107 | Shell metacharacters may be used in the filename, as in ~r and are expanded | |
108 | with the conventions of your shell. | |
109 | .pp | |
110 | If you are sending mail from within | |
111 | .i Mail's | |
112 | command mode | |
113 | you can read a message sent to you into the message | |
114 | you are constructing with the escape: | |
115 | .(l | |
116 | ~m 4 | |
117 | .)l | |
118 | which will read message 4 into the current message, shifted right by | |
119 | one tab stop. You can name any non-deleted message, or list of messages. | |
120 | Messages can also be forwarded without shifting by a tab stop with ~f. | |
121 | This is the usual way to forward a message. | |
122 | .pp | |
123 | If, in the process of composing a message, you decide to add additional | |
124 | people to the list of message recipients, you can do so with the escape | |
125 | .(l | |
126 | ~t name1 name2 ... | |
127 | .)l | |
128 | You may name as few or many additional recipients as you wish. Note | |
129 | that the users originally on the recipient list will still receive | |
130 | the message; you cannot remove someone from the recipient | |
131 | list with ~t. | |
132 | .pp | |
133 | If you wish, you can associate a subject with your message by using the | |
134 | escape | |
135 | .(l | |
136 | ~s Arbitrary string of text | |
137 | .)l | |
138 | which replaces any previous subject with | |
139 | .q "Arbitrary string of text." | |
140 | The subject, if given, is sent near the | |
141 | top of the message prefixed with | |
142 | .q "Subject:" | |
143 | You can see what the message will look like by using ~p. | |
144 | .pp | |
145 | For political reasons, one occasionally prefers to list certain | |
146 | people as recipients of carbon copies of a message rather than | |
147 | direct recipients. The escape | |
148 | .(l | |
149 | ~c name1 name2 ... | |
150 | .)l | |
151 | adds the named people to the | |
152 | .q "Cc:" | |
153 | list, similar to ~t. | |
154 | Again, you can execute ~p to see what the message will look like. | |
155 | .pp | |
8c80966d CL |
156 | The escape |
157 | .(l | |
158 | ~b name1 name2 ... | |
159 | .)l | |
160 | adds the named people to the | |
161 | .q "Cc:" | |
162 | list, but does not make the names visible in the | |
163 | .q "Cc:" | |
164 | line ("blind" carbon copy). | |
165 | .pp | |
6d7e256b KD |
166 | The recipients of the message together constitute the |
167 | .q "To:" | |
168 | field, the subject the | |
169 | .q "Subject:" | |
170 | field, and the carbon copies the | |
171 | .q "Cc:" | |
8c80966d CL |
172 | field. If you wish to edit these in ways impossible with the ~t, ~s, ~c |
173 | and ~b escapes, you can use the escape | |
6d7e256b KD |
174 | .(l |
175 | ~h | |
176 | .)l | |
177 | which prints | |
178 | .q "To:" | |
179 | followed by the current list of recipients and leaves the cursor | |
180 | (or printhead) at the end of the line. If you type in ordinary | |
181 | characters, they are appended to the end of the current list of | |
182 | recipients. You can also use your erase character to erase back into | |
183 | the list of recipients, or your kill character to erase them altogether. | |
184 | Thus, for example, if your erase and kill characters are the standard | |
185 | (on printing terminals) # and @ symbols, | |
186 | .(l | |
187 | ~h | |
188 | To: root kurt####bill | |
189 | .)l | |
190 | would change the initial recipients | |
191 | .q "root kurt" | |
192 | to | |
193 | .q "root bill." | |
194 | When you type a newline, | |
195 | .i Mail | |
196 | advances to the | |
197 | .q "Subject:" | |
198 | field, where the same rules apply. Another newline brings you to | |
199 | the | |
200 | .q "Cc:" | |
201 | field, which may be edited in the same fashion. Another newline | |
202 | leaves you appending text to the end of your message. You can use | |
203 | ~p to print the current text of the header fields and the body | |
204 | of the message. | |
205 | .pp | |
206 | To effect a temporary escape to the shell, the escape | |
207 | .(l | |
208 | ~!command | |
209 | .)l | |
210 | is used, which executes | |
211 | .i command | |
212 | and returns you to mailing mode without altering the text of | |
213 | your message. If you wish, instead, to filter the body of your | |
214 | message through a shell command, then you can use | |
215 | .(l | |
216 | ~|command | |
217 | .)l | |
218 | which pipes your message through the command and uses the output | |
219 | as the new text of your message. If the command produces no output, | |
220 | .i Mail | |
221 | assumes that something is amiss and retains the old version | |
222 | of your message. A frequently-used filter is the command | |
223 | .i fmt , | |
224 | designed to format outgoing mail. | |
225 | .pp | |
226 | To effect a temporary escape to | |
227 | .i Mail | |
228 | command mode instead, you can use the | |
229 | .(l | |
230 | ~:\fIMail command\fP | |
231 | .)l | |
232 | escape. This is especially useful for retyping the message you are | |
233 | replying to, using, for example: | |
234 | .(l | |
235 | ~:t | |
236 | .)l | |
237 | It is also useful for setting options and modifying aliases. | |
238 | .pp | |
8c80966d CL |
239 | If you wish abort the current message, you can use the escape |
240 | .(l | |
241 | ~q | |
242 | .)l | |
243 | This will terminate the current message and return you to the | |
244 | shell (or \fIMail\fP if you were using the \fBmail\fP command). | |
245 | If the \fBsave\fP option is set, the message will be copied | |
246 | to the file | |
247 | .q dead.letter | |
248 | in your home directory. | |
249 | .pp | |
6d7e256b KD |
250 | If you wish (for some reason) to send a message that contains |
251 | a line beginning with a tilde, you must double it. Thus, for example, | |
252 | .(l | |
253 | ~~This line begins with a tilde. | |
254 | .)l | |
255 | sends the line | |
256 | .(l | |
257 | ~This line begins with a tilde. | |
258 | .)l | |
259 | .pp | |
260 | Finally, the escape | |
261 | .(l | |
262 | ~? | |
263 | .)l | |
264 | prints out a brief summary of the available tilde escapes. | |
265 | .pp | |
266 | On some terminals (particularly ones with no lower case) | |
267 | tilde's are difficult to type. | |
268 | .i Mail | |
269 | allows you to change the escape character with the | |
270 | .q escape | |
271 | option. For example, I set | |
272 | .(l | |
273 | set escape=] | |
274 | .)l | |
275 | and use a right bracket instead of a tilde. If I ever need to | |
276 | send a line beginning with right bracket, I double it, just as for ~. | |
277 | Changing the escape character removes the special meaning of ~. | |
278 | .sh 2 "Network access" | |
279 | .pp | |
280 | This section describes how to send mail to people on other machines. | |
281 | Recall that sending to a plain login name sends mail to that person | |
282 | on your machine. If your machine is directly (or sometimes, even, | |
283 | indirectly) connected to the Arpanet, you can send messages to people | |
284 | on the Arpanet using a name of the form | |
285 | .(l | |
286 | name@host.domain | |
287 | .)l | |
288 | where | |
289 | .i name | |
290 | is the login name of the person you're trying to reach, | |
291 | .i host | |
292 | is the name of the machine on the Arpanet, | |
293 | and | |
294 | .i domain | |
295 | is the higher-level scope within which the hostname is known, e.g. EDU (for educational | |
296 | institutions), COM (for commercial entities), GOV (for governmental agencies), | |
297 | ARPA for many other things, BITNET or CSNET for those networks. | |
298 | .pp | |
299 | If your recipient logs in on a machine connected to yours by | |
300 | UUCP (the Bell Laboratories supplied network that communicates | |
301 | over telephone lines), sending mail can be a bit more complicated. | |
302 | You must know the list of machines through which your message must | |
303 | travel to arrive at his site. So, if his machine is directly connected | |
304 | to yours, you can send mail to him using the syntax: | |
305 | .(l | |
306 | host!name | |
307 | .)l | |
308 | where, again, | |
309 | .i host | |
310 | is the name of the machine and | |
311 | .i name | |
312 | is the login name. | |
313 | If your message must go through an intermediary machine first, you | |
314 | must use the syntax: | |
315 | .(l | |
316 | intermediary!host!name | |
317 | .)l | |
318 | and so on. It is actually a feature of UUCP that the map of all | |
319 | the systems in the network is not known anywhere (except where people | |
320 | decide to write it down for convenience). Talk to your system administrator | |
321 | about good ways to get places; the | |
322 | .i uuname | |
323 | command will tell you systems whose names are recognized, but not which | |
324 | ones are frequently called or well-connected. | |
325 | .pp | |
326 | When you use the | |
327 | .b reply | |
328 | command to respond to a letter, there is a problem of figuring out the | |
329 | names of the users in the | |
330 | .q "To:" | |
331 | and | |
332 | .q "Cc:" | |
333 | lists | |
334 | .i "relative to the current machine" . | |
335 | If the original letter was sent to you by someone on the local machine, | |
336 | then this problem does not exist, but if the message came from a remote | |
337 | machine, the problem must be dealt with. | |
338 | .i Mail | |
339 | uses a heuristic to build the correct name for each user relative | |
340 | to the local machine. So, when you | |
341 | .b reply | |
342 | to remote mail, the names in the | |
343 | .q "To:" | |
344 | and | |
345 | .q "Cc:" | |
346 | lists may change somewhat. | |
347 | .sh 2 "Special recipients" | |
348 | .pp | |
349 | As described previously, you can send mail to either user names or | |
350 | .b alias | |
351 | names. It is also possible to send messages directly to files or to | |
352 | programs, using special conventions. If a recipient name has a | |
353 | `/' in it or begins with a `+', it is assumed to be the | |
354 | path name of a file into which | |
355 | to send the message. If the file already exists, the message is | |
356 | appended to the end of the file. If you want to name a file in | |
357 | your current directory (ie, one for which a `/' would not usually | |
358 | be needed) you can precede the name with `./' | |
359 | So, to send mail to the file | |
360 | .q memo | |
361 | in the current directory, you can give the command: | |
362 | .(l | |
363 | % Mail ./memo | |
364 | .)l | |
365 | If the name begins with a `+,' it is expanded into the full path name | |
366 | of the folder name in your folder directory. | |
367 | This ability to send mail to files can be used for a variety of | |
368 | purposes, such as maintaining a journal and keeping a record of | |
369 | mail sent to a certain group of users. The second example can be | |
370 | done automatically by including the full pathname of the record | |
371 | file in the | |
372 | .b alias | |
373 | command for the group. Using our previous | |
374 | .b alias | |
375 | example, you might give the command: | |
376 | .(l | |
377 | alias project sam sally steve susan /usr/project/mail_record | |
378 | .)l | |
379 | Then, all mail sent to "project" would be saved on the file | |
380 | .q /usr/project/mail_record | |
381 | as well as being sent to the members of the project. This file | |
382 | can be examined using | |
383 | .i "Mail \-f" . | |
384 | .pp | |
385 | It is sometimes useful to send mail directly to a program, for | |
386 | example one might write a project billboard program and want to access | |
387 | it using | |
388 | .i Mail . | |
389 | To send messages to the billboard program, one can send mail | |
390 | to the special name `|billboard' for example. | |
391 | .i Mail | |
392 | treats recipient names that begin with a `|' as a program to send | |
393 | the mail to. An | |
394 | .b alias | |
395 | can be set up to reference a `|' prefaced name if desired. | |
396 | .i Caveats : | |
397 | the shell treats `|' specially, so it must be quoted on the command | |
398 | line. Also, the `| program' must be presented as a single argument to | |
399 | mail. The safest course is to surround the entire name with double | |
400 | quotes. This also applies to usage in the | |
401 | .b alias | |
402 | command. For example, if we wanted to alias `rmsgs' to `rmsgs \-s' | |
403 | we would need to say: | |
404 | .(l | |
405 | alias rmsgs "| rmsgs -s" | |
406 | .)l |