1 .\" $NetBSD: mail4.nr,v 1.3 1998/01/09 08:05:55 perry Exp $
3 .\" Copyright (c) 1980, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)mail4.nr 8.2 (Berkeley) 5/16/94
32 .sh 1 "More about sending mail"
35 While typing in a message to be sent to others, it is often
36 useful to be able to invoke the text editor on the partial message,
37 print the message, execute a shell command, or do some other
40 provides these capabilities through
42 which consist of a tilde (~) at the beginning of a line, followed by
43 a single character which indicates the function to be performed. For
44 example, to print the text of the message so far, use:
48 which will print a line of dashes, the recipients of your message, and
49 the text of the message so far.
52 requires two consecutive \s-2RUBOUT\s0's to abort a letter, you
53 can use a single \s-2RUBOUT\s0 to abort the output of ~p or any other
54 ~ escape without killing your letter.
56 If you are dissatisfied with the message as
57 it stands, you can invoke the text editor on it using the escape
61 which causes the message to be copied into a temporary file and an
62 instance of the editor to be spawned. After modifying the message to
63 your satisfaction, write it out and quit the editor.
70 after which you may continue typing text which will be appended to your
71 message, or type <control-d> to end the message.
72 A standard text editor is provided by
74 You can override this default by setting the valued option
76 to something else. For example, you might prefer:
78 set EDITOR=/usr/ucb/ex
81 Many systems offer a screen editor as an alternative to the standard
82 text editor, such as the
84 editor from UC Berkeley.
87 editor, on your current message, you can use the escape,
91 ~v works like ~e, except that the screen editor is invoked instead.
92 A default screen editor is defined by
94 If it does not suit you, you can set the valued option
96 to the path name of a different editor.
98 It is often useful to be able to include the contents of some
99 file in your message; the escape
103 is provided for this purpose, and causes the named file to be appended
104 to your current message.
106 complains if the file doesn't exist
107 or can't be read. If the read is successful, the number of lines and
108 characters appended to your message is printed, after which you may continue
109 appending text. The filename may contain shell metacharacters like * and ?
110 which are expanded according to the conventions of your shell.
112 As a special case of ~r, the escape
118 in your home directory. This is often useful since
121 of your message there when you abort a message with \s-2RUBOUT\s0.
123 To save the current text of your message on a file you may use the
129 will print out the number of lines and characters written
130 to the file, after which you may continue appending text to your message.
131 Shell metacharacters may be used in the filename, as in ~r and are expanded
132 with the conventions of your shell.
134 If you are sending mail from within
137 you can read a message sent to you into the message
138 you are constructing with the escape:
142 which will read message 4 into the current message, shifted right by
143 one tab stop. You can name any non-deleted message, or list of messages.
144 Messages can also be forwarded without shifting by a tab stop with ~f.
145 This is the usual way to forward a message.
147 If, in the process of composing a message, you decide to add additional
148 people to the list of message recipients, you can do so with the escape
152 You may name as few or many additional recipients as you wish. Note
153 that the users originally on the recipient list will still receive
154 the message; you cannot remove someone from the recipient
157 If you wish, you can associate a subject with your message by using the
160 ~s Arbitrary string of text
162 which replaces any previous subject with
163 .q "Arbitrary string of text."
164 The subject, if given, is sent near the
165 top of the message prefixed with
167 You can see what the message will look like by using ~p.
169 For political reasons, one occasionally prefers to list certain
170 people as recipients of carbon copies of a message rather than
171 direct recipients. The escape
175 adds the named people to the
178 Again, you can execute ~p to see what the message will look like.
184 adds the named people to the
186 list, but does not make the names visible in the
188 line ("blind" carbon copy).
190 The recipients of the message together constitute the
192 field, the subject the
194 field, and the carbon copies the
196 field. If you wish to edit these in ways impossible with the ~t, ~s, ~c
197 and ~b escapes, you can use the escape
203 followed by the current list of recipients and leaves the cursor
204 (or printhead) at the end of the line. If you type in ordinary
205 characters, they are appended to the end of the current list of
206 recipients. You can also use your erase character to erase back into
207 the list of recipients, or your kill character to erase them altogether.
208 Thus, for example, if your erase and kill characters are the standard
209 (on printing terminals) # and @ symbols,
212 To: root kurt####bill
214 would change the initial recipients
218 When you type a newline,
222 field, where the same rules apply. Another newline brings you to
225 field, which may be edited in the same fashion. Another newline
228 ("blind" carbon copy) field, which follows the same rules as the "Cc:"
229 field. Another newline
230 leaves you appending text to the end of your message. You can use
231 ~p to print the current text of the header fields and the body
234 To effect a temporary escape to the shell, the escape
238 is used, which executes
240 and returns you to mailing mode without altering the text of
241 your message. If you wish, instead, to filter the body of your
242 message through a shell command, then you can use
246 which pipes your message through the command and uses the output
247 as the new text of your message. If the command produces no output,
249 assumes that something is amiss and retains the old version
250 of your message. A frequently-used filter is the command
252 designed to format outgoing mail.
254 To effect a temporary escape to
256 command mode instead, you can use the
260 escape. This is especially useful for retyping the message you are
261 replying to, using, for example:
265 It is also useful for setting options and modifying aliases.
267 If you wish abort the current message, you can use the escape
271 This will terminate the current message and return you to the
272 shell (or \fIMail\fP if you were using the \fBmail\fP command).
273 If the \fBsave\fP option is set, the message will be copied
276 in your home directory.
278 If you wish (for some reason) to send a message that contains
279 a line beginning with a tilde, you must double it. Thus, for example,
281 ~~This line begins with a tilde.
285 ~This line begins with a tilde.
292 prints out a brief summary of the available tilde escapes.
294 On some terminals (particularly ones with no lower case)
295 tilde's are difficult to type.
297 allows you to change the escape character with the
299 option. For example, I set
303 and use a right bracket instead of a tilde. If I ever need to
304 send a line beginning with right bracket, I double it, just as for ~.
305 Changing the escape character removes the special meaning of ~.
306 .sh 2 "Network access"
308 This section describes how to send mail to people on other machines.
309 Recall that sending to a plain login name sends mail to that person
310 on your machine. If your machine is directly (or sometimes, even,
311 indirectly) connected to the Arpanet, you can send messages to people
312 on the Arpanet using a name of the form
318 is the login name of the person you're trying to reach,
320 is the name of the machine on the Arpanet,
323 is the higher-level scope within which the hostname is known, e.g. EDU (for educational
324 institutions), COM (for commercial entities), GOV (for governmental agencies),
325 ARPA for many other things, BITNET or CSNET for those networks.
327 If your recipient logs in on a machine connected to yours by
328 UUCP (the Bell Laboratories supplied network that communicates
329 over telephone lines), sending mail can be a bit more complicated.
330 You must know the list of machines through which your message must
331 travel to arrive at his site. So, if his machine is directly connected
332 to yours, you can send mail to him using the syntax:
338 is the name of the machine and
341 If your message must go through an intermediary machine first, you
344 intermediary!host!name
346 and so on. It is actually a feature of UUCP that the map of all
347 the systems in the network is not known anywhere (except where people
348 decide to write it down for convenience). Talk to your system administrator
349 about good ways to get places; the
351 command will tell you systems whose names are recognized, but not which
352 ones are frequently called or well-connected.
356 command to respond to a letter, there is a problem of figuring out the
357 names of the users in the
362 .i "relative to the current machine" .
363 If the original letter was sent to you by someone on the local machine,
364 then this problem does not exist, but if the message came from a remote
365 machine, the problem must be dealt with.
367 uses a heuristic to build the correct name for each user relative
368 to the local machine. So, when you
370 to remote mail, the names in the
374 lists may change somewhat.
375 .sh 2 "Special recipients"
377 As described previously, you can send mail to either user names or
379 names. It is also possible to send messages directly to files or to
380 programs, using special conventions. If a recipient name has a
381 `/' in it or begins with a `+', it is assumed to be the
382 path name of a file into which
383 to send the message. If the file already exists, the message is
384 appended to the end of the file. If you want to name a file in
385 your current directory (ie, one for which a `/' would not usually
386 be needed) you can precede the name with `./'
387 So, to send mail to the file
389 in the current directory, you can give the command:
393 If the name begins with a `+,' it is expanded into the full path name
394 of the folder name in your folder directory.
395 This ability to send mail to files can be used for a variety of
396 purposes, such as maintaining a journal and keeping a record of
397 mail sent to a certain group of users. The second example can be
398 done automatically by including the full pathname of the record
401 command for the group. Using our previous
403 example, you might give the command:
405 alias project sam sally steve susan /usr/project/mail_record
407 Then, all mail sent to "project" would be saved on the file
408 .q /usr/project/mail_record
409 as well as being sent to the members of the project. This file
410 can be examined using
413 It is sometimes useful to send mail directly to a program, for
414 example one might write a project billboard program and want to access
417 To send messages to the billboard program, one can send mail
418 to the special name `|billboard' for example.
420 treats recipient names that begin with a `|' as a program to send
423 can be set up to reference a `|' prefaced name if desired.
425 the shell treats `|' specially, so it must be quoted on the command
426 line. Also, the `| program' must be presented as a single argument to
427 mail. The safest course is to surround the entire name with double
428 quotes. This also applies to usage in the
430 command. For example, if we wanted to alias `rmsgs' to `rmsgs \-s'
431 we would need to say:
433 alias rmsgs "| rmsgs -s"