1 .\" Copyright (c) 1980, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)mail4.nr 8.1 (Berkeley) 6/8/93
35 .sh 1 "More about sending mail"
38 While typing in a message to be sent to others, it is often
39 useful to be able to invoke the text editor on the partial message,
40 print the message, execute a shell command, or do some other
43 provides these capabilities through
45 which consist of a tilde (~) at the beginning of a line, followed by
46 a single character which indicates the function to be performed. For
47 example, to print the text of the message so far, use:
51 which will print a line of dashes, the recipients of your message, and
52 the text of the message so far.
55 requires two consecutive \s-2RUBOUT\s0's to abort a letter, you
56 can use a single \s-2RUBOUT\s0 to abort the output of ~p or any other
57 ~ escape without killing your letter.
59 If you are dissatisfied with the message as
60 it stands, you can invoke the text editor on it using the escape
64 which causes the message to be copied into a temporary file and an
65 instance of the editor to be spawned. After modifying the message to
66 your satisfaction, write it out and quit the editor.
73 after which you may continue typing text which will be appended to your
74 message, or type <control-d> to end the message.
75 A standard text editor is provided by
77 You can override this default by setting the valued option
79 to something else. For example, you might prefer:
81 set EDITOR=/usr/bin/ex
84 Many systems offer a screen editor as an alternative to the standard
85 text editor, such as the
87 editor from UC Berkeley.
90 editor, on your current message, you can use the escape,
94 ~v works like ~e, except that the screen editor is invoked instead.
95 A default screen editor is defined by
97 If it does not suit you, you can set the valued option
99 to the path name of a different editor.
101 It is often useful to be able to include the contents of some
102 file in your message; the escape
106 is provided for this purpose, and causes the named file to be appended
107 to your current message.
109 complains if the file doesn't exist
110 or can't be read. If the read is successful, the number of lines and
111 characters appended to your message is printed, after which you may continue
112 appending text. The filename may contain shell metacharacters like * and ?
113 which are expanded according to the conventions of your shell.
115 As a special case of ~r, the escape
121 in your home directory. This is often useful since
124 of your message there when you abort a message with \s-2RUBOUT\s0.
126 To save the current text of your message on a file you may use the
132 will print out the number of lines and characters written
133 to the file, after which you may continue appending text to your message.
134 Shell metacharacters may be used in the filename, as in ~r and are expanded
135 with the conventions of your shell.
137 If you are sending mail from within
140 you can read a message sent to you into the message
141 you are constructing with the escape:
145 which will read message 4 into the current message, shifted right by
146 one tab stop. You can name any non-deleted message, or list of messages.
147 Messages can also be forwarded without shifting by a tab stop with ~f.
148 This is the usual way to forward a message.
150 If, in the process of composing a message, you decide to add additional
151 people to the list of message recipients, you can do so with the escape
155 You may name as few or many additional recipients as you wish. Note
156 that the users originally on the recipient list will still receive
157 the message; you cannot remove someone from the recipient
160 If you wish, you can associate a subject with your message by using the
163 ~s Arbitrary string of text
165 which replaces any previous subject with
166 .q "Arbitrary string of text."
167 The subject, if given, is sent near the
168 top of the message prefixed with
170 You can see what the message will look like by using ~p.
172 For political reasons, one occasionally prefers to list certain
173 people as recipients of carbon copies of a message rather than
174 direct recipients. The escape
178 adds the named people to the
181 Again, you can execute ~p to see what the message will look like.
187 adds the named people to the
189 list, but does not make the names visible in the
191 line ("blind" carbon copy).
193 The recipients of the message together constitute the
195 field, the subject the
197 field, and the carbon copies the
199 field. If you wish to edit these in ways impossible with the ~t, ~s, ~c
200 and ~b escapes, you can use the escape
206 followed by the current list of recipients and leaves the cursor
207 (or printhead) at the end of the line. If you type in ordinary
208 characters, they are appended to the end of the current list of
209 recipients. You can also use your erase character to erase back into
210 the list of recipients, or your kill character to erase them altogether.
211 Thus, for example, if your erase and kill characters are the standard
212 (on printing terminals) # and @ symbols,
215 To: root kurt####bill
217 would change the initial recipients
221 When you type a newline,
225 field, where the same rules apply. Another newline brings you to
228 field, which may be edited in the same fashion. Another newline
231 ("blind" carbon copy) field, which follows the same rules as the "Cc:"
232 field. Another newline
233 leaves you appending text to the end of your message. You can use
234 ~p to print the current text of the header fields and the body
237 To effect a temporary escape to the shell, the escape
241 is used, which executes
243 and returns you to mailing mode without altering the text of
244 your message. If you wish, instead, to filter the body of your
245 message through a shell command, then you can use
249 which pipes your message through the command and uses the output
250 as the new text of your message. If the command produces no output,
252 assumes that something is amiss and retains the old version
253 of your message. A frequently-used filter is the command
255 designed to format outgoing mail.
257 To effect a temporary escape to
259 command mode instead, you can use the
263 escape. This is especially useful for retyping the message you are
264 replying to, using, for example:
268 It is also useful for setting options and modifying aliases.
270 If you wish abort the current message, you can use the escape
274 This will terminate the current message and return you to the
275 shell (or \fIMail\fP if you were using the \fBmail\fP command).
276 If the \fBsave\fP option is set, the message will be copied
279 in your home directory.
281 If you wish (for some reason) to send a message that contains
282 a line beginning with a tilde, you must double it. Thus, for example,
284 ~~This line begins with a tilde.
288 ~This line begins with a tilde.
295 prints out a brief summary of the available tilde escapes.
297 On some terminals (particularly ones with no lower case)
298 tilde's are difficult to type.
300 allows you to change the escape character with the
302 option. For example, I set
306 and use a right bracket instead of a tilde. If I ever need to
307 send a line beginning with right bracket, I double it, just as for ~.
308 Changing the escape character removes the special meaning of ~.
309 .sh 2 "Network access"
311 This section describes how to send mail to people on other machines.
312 Recall that sending to a plain login name sends mail to that person
313 on your machine. If your machine is directly (or sometimes, even,
314 indirectly) connected to the Arpanet, you can send messages to people
315 on the Arpanet using a name of the form
321 is the login name of the person you're trying to reach,
323 is the name of the machine on the Arpanet,
326 is the higher-level scope within which the hostname is known, e.g. EDU (for educational
327 institutions), COM (for commercial entities), GOV (for governmental agencies),
328 ARPA for many other things, BITNET or CSNET for those networks.
330 If your recipient logs in on a machine connected to yours by
331 UUCP (the Bell Laboratories supplied network that communicates
332 over telephone lines), sending mail can be a bit more complicated.
333 You must know the list of machines through which your message must
334 travel to arrive at his site. So, if his machine is directly connected
335 to yours, you can send mail to him using the syntax:
341 is the name of the machine and
344 If your message must go through an intermediary machine first, you
347 intermediary!host!name
349 and so on. It is actually a feature of UUCP that the map of all
350 the systems in the network is not known anywhere (except where people
351 decide to write it down for convenience). Talk to your system administrator
352 about good ways to get places; the
354 command will tell you systems whose names are recognized, but not which
355 ones are frequently called or well-connected.
359 command to respond to a letter, there is a problem of figuring out the
360 names of the users in the
365 .i "relative to the current machine" .
366 If the original letter was sent to you by someone on the local machine,
367 then this problem does not exist, but if the message came from a remote
368 machine, the problem must be dealt with.
370 uses a heuristic to build the correct name for each user relative
371 to the local machine. So, when you
373 to remote mail, the names in the
377 lists may change somewhat.
378 .sh 2 "Special recipients"
380 As described previously, you can send mail to either user names or
382 names. It is also possible to send messages directly to files or to
383 programs, using special conventions. If a recipient name has a
384 `/' in it or begins with a `+', it is assumed to be the
385 path name of a file into which
386 to send the message. If the file already exists, the message is
387 appended to the end of the file. If you want to name a file in
388 your current directory (ie, one for which a `/' would not usually
389 be needed) you can precede the name with `./'
390 So, to send mail to the file
392 in the current directory, you can give the command:
396 If the name begins with a `+,' it is expanded into the full path name
397 of the folder name in your folder directory.
398 This ability to send mail to files can be used for a variety of
399 purposes, such as maintaining a journal and keeping a record of
400 mail sent to a certain group of users. The second example can be
401 done automatically by including the full pathname of the record
404 command for the group. Using our previous
406 example, you might give the command:
408 alias project sam sally steve susan /usr/project/mail_record
410 Then, all mail sent to "project" would be saved on the file
411 .q /usr/project/mail_record
412 as well as being sent to the members of the project. This file
413 can be examined using
416 It is sometimes useful to send mail directly to a program, for
417 example one might write a project billboard program and want to access
420 To send messages to the billboard program, one can send mail
421 to the special name `|billboard' for example.
423 treats recipient names that begin with a `|' as a program to send
426 can be set up to reference a `|' prefaced name if desired.
428 the shell treats `|' specially, so it must be quoted on the command
429 line. Also, the `| program' must be presented as a single argument to
430 mail. The safest course is to surround the entire name with double
431 quotes. This also applies to usage in the
433 command. For example, if we wanted to alias `rmsgs' to `rmsgs \-s'
434 we would need to say:
436 alias rmsgs "| rmsgs -s"