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. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)mail4.nr 8.1 (Berkeley) 6/8/93
31 .sh 1 "More about sending mail"
34 While typing in a message to be sent to others, it is often
35 useful to be able to invoke the text editor on the partial message,
36 print the message, execute a shell command, or do some other
39 provides these capabilities through
41 which consist of a tilde (~) at the beginning of a line, followed by
42 a single character which indicates the function to be performed. For
43 example, to print the text of the message so far, use:
47 which will print a line of dashes, the recipients of your message, and
48 the text of the message so far.
51 requires two consecutive \s-2RUBOUT\s0's to abort a letter, you
52 can use a single \s-2RUBOUT\s0 to abort the output of ~p or any other
53 ~ escape without killing your letter.
55 If you are dissatisfied with the message as
56 it stands, you can invoke the text editor on it using the escape
60 which causes the message to be copied into a temporary file and an
61 instance of the editor to be spawned. After modifying the message to
62 your satisfaction, write it out and quit the editor.
69 after which you may continue typing text which will be appended to your
70 message, or type <control-d> to end the message.
71 A standard text editor is provided by
73 You can override this default by setting the valued option
75 to something else. For example, you might prefer:
77 set EDITOR=/usr/bin/ex
80 Many systems offer a screen editor as an alternative to the standard
81 text editor, such as the
83 editor from UC Berkeley.
86 editor, on your current message, you can use the escape,
90 ~v works like ~e, except that the screen editor is invoked instead.
91 A default screen editor is defined by
93 If it does not suit you, you can set the valued option
95 to the path name of a different editor.
97 It is often useful to be able to include the contents of some
98 file in your message; the escape
102 is provided for this purpose, and causes the named file to be appended
103 to your current message.
105 complains if the file doesn't exist
106 or can't be read. If the read is successful, the number of lines and
107 characters appended to your message is printed, after which you may continue
108 appending text. The filename may contain shell metacharacters like * and ?
109 which are expanded according to the conventions of your shell.
111 As a special case of ~r, the escape
117 in your home directory. This is often useful since
120 of your message there when you abort a message with \s-2RUBOUT\s0.
122 To save the current text of your message on a file you may use the
128 will print out the number of lines and characters written
129 to the file, after which you may continue appending text to your message.
130 Shell metacharacters may be used in the filename, as in ~r and are expanded
131 with the conventions of your shell.
133 If you are sending mail from within
136 you can read a message sent to you into the message
137 you are constructing with the escape:
141 which will read message 4 into the current message, shifted right by
142 one tab stop. You can name any non-deleted message, or list of messages.
143 Messages can also be forwarded without shifting by a tab stop with ~f.
144 This is the usual way to forward a message.
146 If, in the process of composing a message, you decide to add additional
147 people to the list of message recipients, you can do so with the escape
151 You may name as few or many additional recipients as you wish. Note
152 that the users originally on the recipient list will still receive
153 the message; you cannot remove someone from the recipient
156 If you wish, you can associate a subject with your message by using the
159 ~s Arbitrary string of text
161 which replaces any previous subject with
162 .q "Arbitrary string of text."
163 The subject, if given, is sent near the
164 top of the message prefixed with
166 You can see what the message will look like by using ~p.
168 For political reasons, one occasionally prefers to list certain
169 people as recipients of carbon copies of a message rather than
170 direct recipients. The escape
174 adds the named people to the
177 Again, you can execute ~p to see what the message will look like.
183 adds the named people to the
185 list, but does not make the names visible in the
187 line ("blind" carbon copy).
189 The recipients of the message together constitute the
191 field, the subject the
193 field, and the carbon copies the
195 field. If you wish to edit these in ways impossible with the ~t, ~s, ~c
196 and ~b escapes, you can use the escape
202 followed by the current list of recipients and leaves the cursor
203 (or printhead) at the end of the line. If you type in ordinary
204 characters, they are appended to the end of the current list of
205 recipients. You can also use your erase character to erase back into
206 the list of recipients, or your kill character to erase them altogether.
207 Thus, for example, if your erase and kill characters are the standard
208 (on printing terminals) # and @ symbols,
211 To: root kurt####bill
213 would change the initial recipients
217 When you type a newline,
221 field, where the same rules apply. Another newline brings you to
224 field, which may be edited in the same fashion. Another newline
227 ("blind" carbon copy) field, which follows the same rules as the "Cc:"
228 field. Another newline
229 leaves you appending text to the end of your message. You can use
230 ~p to print the current text of the header fields and the body
233 To effect a temporary escape to the shell, the escape
237 is used, which executes
239 and returns you to mailing mode without altering the text of
240 your message. If you wish, instead, to filter the body of your
241 message through a shell command, then you can use
245 which pipes your message through the command and uses the output
246 as the new text of your message. If the command produces no output,
248 assumes that something is amiss and retains the old version
249 of your message. A frequently-used filter is the command
251 designed to format outgoing mail.
253 To effect a temporary escape to
255 command mode instead, you can use the
259 escape. This is especially useful for retyping the message you are
260 replying to, using, for example:
264 It is also useful for setting options and modifying aliases.
266 If you wish abort the current message, you can use the escape
270 This will terminate the current message and return you to the
271 shell (or \fIMail\fP if you were using the \fBmail\fP command).
272 If the \fBsave\fP option is set, the message will be copied
275 in your home directory.
277 If you wish (for some reason) to send a message that contains
278 a line beginning with a tilde, you must double it. Thus, for example,
280 ~~This line begins with a tilde.
284 ~This line begins with a tilde.
291 prints out a brief summary of the available tilde escapes.
293 On some terminals (particularly ones with no lower case)
294 tilde's are difficult to type.
296 allows you to change the escape character with the
298 option. For example, I set
302 and use a right bracket instead of a tilde. If I ever need to
303 send a line beginning with right bracket, I double it, just as for ~.
304 Changing the escape character removes the special meaning of ~.
305 .sh 2 "Network access"
307 This section describes how to send mail to people on other machines.
308 Recall that sending to a plain login name sends mail to that person
309 on your machine. If your machine is directly (or sometimes, even,
310 indirectly) connected to the Arpanet, you can send messages to people
311 on the Arpanet using a name of the form
317 is the login name of the person you're trying to reach,
319 is the name of the machine on the Arpanet,
322 is the higher-level scope within which the hostname is known, e.g. EDU (for educational
323 institutions), COM (for commercial entities), GOV (for governmental agencies),
324 ARPA for many other things, BITNET or CSNET for those networks.
326 If your recipient logs in on a machine connected to yours by
327 UUCP (the Bell Laboratories supplied network that communicates
328 over telephone lines), sending mail can be a bit more complicated.
329 You must know the list of machines through which your message must
330 travel to arrive at his site. So, if his machine is directly connected
331 to yours, you can send mail to him using the syntax:
337 is the name of the machine and
340 If your message must go through an intermediary machine first, you
343 intermediary!host!name
345 and so on. It is actually a feature of UUCP that the map of all
346 the systems in the network is not known anywhere (except where people
347 decide to write it down for convenience). Talk to your system administrator
348 about good ways to get places; the
350 command will tell you systems whose names are recognized, but not which
351 ones are frequently called or well-connected.
355 command to respond to a letter, there is a problem of figuring out the
356 names of the users in the
361 .i "relative to the current machine" .
362 If the original letter was sent to you by someone on the local machine,
363 then this problem does not exist, but if the message came from a remote
364 machine, the problem must be dealt with.
366 uses a heuristic to build the correct name for each user relative
367 to the local machine. So, when you
369 to remote mail, the names in the
373 lists may change somewhat.
374 .sh 2 "Special recipients"
376 As described previously, you can send mail to either user names or
378 names. It is also possible to send messages directly to files or to
379 programs, using special conventions. If a recipient name has a
380 `/' in it or begins with a `+', it is assumed to be the
381 path name of a file into which
382 to send the message. If the file already exists, the message is
383 appended to the end of the file. If you want to name a file in
384 your current directory (ie, one for which a `/' would not usually
385 be needed) you can precede the name with `./'
386 So, to send mail to the file
388 in the current directory, you can give the command:
392 If the name begins with a `+,' it is expanded into the full path name
393 of the folder name in your folder directory.
394 This ability to send mail to files can be used for a variety of
395 purposes, such as maintaining a journal and keeping a record of
396 mail sent to a certain group of users. The second example can be
397 done automatically by including the full pathname of the record
400 command for the group. Using our previous
402 example, you might give the command:
404 alias project sam sally steve susan /usr/project/mail_record
406 Then, all mail sent to "project" would be saved on the file
407 .q /usr/project/mail_record
408 as well as being sent to the members of the project. This file
409 can be examined using
412 It is sometimes useful to send mail directly to a program, for
413 example one might write a project billboard program and want to access
416 To send messages to the billboard program, one can send mail
417 to the special name `|billboard' for example.
419 treats recipient names that begin with a `|' as a program to send
422 can be set up to reference a `|' prefaced name if desired.
424 the shell treats `|' specially, so it must be quoted on the command
425 line. Also, the `| program' must be presented as a single argument to
426 mail. The safest course is to surround the entire name with double
427 quotes. This also applies to usage in the
429 command. For example, if we wanted to alias `rmsgs' to `rmsgs \-s'
430 we would need to say:
432 alias rmsgs "| rmsgs -s"