Annotation of 43BSDReno/share/doc/usd/07.Mail/mail4.nr, revision 1.1.1.1

1.1       root        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: .\"
                      5: .\"    @(#)mail4.nr    6.1 (Berkeley) 5/23/86
                      6: .\"
                      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
                    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
                    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:"
                    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
                    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: brings you to the
                    203: .q "Bcc:"
                    204: ("blind" carbon copy) field, which follows the same rules as the "Cc:"
                    205: field.  Another newline
                    206: leaves you appending text to the end of your message.  You can use
                    207: ~p to print the current text of the header fields and the body
                    208: of the message.
                    209: .pp
                    210: To effect a temporary escape to the shell, the escape
                    211: .(l
                    212: ~!command
                    213: .)l
                    214: is used, which executes
                    215: .i command
                    216: and returns you to mailing mode without altering the text of
                    217: your message.  If you wish, instead, to filter the body of your
                    218: message through a shell command, then you can use
                    219: .(l
                    220: ~|command
                    221: .)l
                    222: which pipes your message through the command and uses the output
                    223: as the new text of your message.  If the command produces no output,
                    224: .i Mail
                    225: assumes that something is amiss and retains the old version
                    226: of your message.  A frequently-used filter is the command
                    227: .i fmt ,
                    228: designed to format outgoing mail.
                    229: .pp
                    230: To effect a temporary escape to
                    231: .i Mail
                    232: command mode instead, you can use the
                    233: .(l
                    234: ~:\fIMail command\fP
                    235: .)l
                    236: escape.  This is especially useful for retyping the message you are
                    237: replying to, using, for example:
                    238: .(l
                    239: ~:t
                    240: .)l
                    241: It is also useful for setting options and modifying aliases.
                    242: .pp
                    243: If you wish abort the current message, you can use the escape
                    244: .(l
                    245: ~q
                    246: .)l
                    247: This will terminate the current message and return you to the
                    248: shell (or \fIMail\fP if you were using the \fBmail\fP command).
                    249: If the \fBsave\fP option is set, the message will be copied
                    250: to the file
                    251: .q dead.letter
                    252: in your home directory.
                    253: .pp
                    254: If you wish (for some reason) to send a message that contains
                    255: a line beginning with a tilde, you must double it.  Thus, for example,
                    256: .(l
                    257: ~~This line begins with a tilde.
                    258: .)l
                    259: sends the line
                    260: .(l
                    261: ~This line begins with a tilde.
                    262: .)l
                    263: .pp
                    264: Finally, the escape
                    265: .(l
                    266: ~?
                    267: .)l
                    268: prints out a brief summary of the available tilde escapes.
                    269: .pp
                    270: On some terminals (particularly ones with no lower case)
                    271: tilde's are difficult to type.
                    272: .i Mail
                    273: allows you to change the escape character with the
                    274: .q escape
                    275: option.  For example, I set
                    276: .(l
                    277: set escape=]
                    278: .)l
                    279: and use a right bracket instead of a tilde.  If I ever need to
                    280: send a line beginning with right bracket, I double it, just as for ~.
                    281: Changing the escape character removes the special meaning of ~.
                    282: .sh 2 "Network access"
                    283: .pp
                    284: This section describes how to send mail to people on other machines.
                    285: Recall that sending to a plain login name sends mail to that person
                    286: on your machine.  If your machine is directly (or sometimes, even,
                    287: indirectly) connected to the Arpanet, you can send messages to people
                    288: on the Arpanet using a name of the form
                    289: .(l
                    290: [email protected]
                    291: .)l
                    292: where
                    293: .i name
                    294: is the login name of the person you're trying to reach,
                    295: .i host
                    296: is the name of the machine on the Arpanet,
                    297: and 
                    298: .i domain
                    299: is the higher-level scope within which the hostname is known, e.g. EDU (for educational
                    300: institutions), COM (for commercial entities), GOV (for governmental agencies),
                    301: ARPA for many other things, BITNET or CSNET for those networks.
                    302: .pp
                    303: If your recipient logs in on a machine connected to yours by
                    304: UUCP (the Bell Laboratories supplied network that communicates
                    305: over telephone lines), sending mail can be a bit more complicated.
                    306: You must know the list of machines through which your message must
                    307: travel to arrive at his site.  So, if his machine is directly connected
                    308: to yours, you can send mail to him using the syntax:
                    309: .(l
                    310: host!name
                    311: .)l
                    312: where, again,
                    313: .i host
                    314: is the name of the machine and
                    315: .i name
                    316: is the login name.
                    317: If your message must go through an intermediary machine first, you
                    318: must use the syntax:
                    319: .(l
                    320: intermediary!host!name
                    321: .)l
                    322: and so on.  It is actually a feature of UUCP that the map of all
                    323: the systems in the network is not known anywhere (except where people
                    324: decide to write it down for convenience).  Talk to your system administrator
                    325: about good ways to get places; the
                    326: .i uuname
                    327: command will tell you systems whose names are recognized, but not which
                    328: ones are frequently called or well-connected.
                    329: .pp
                    330: When you use the
                    331: .b reply
                    332: command to respond to a letter, there is a problem of figuring out the
                    333: names of the users in the
                    334: .q "To:"
                    335: and
                    336: .q "Cc:"
                    337: lists
                    338: .i "relative to the current machine" .
                    339: If the original letter was sent to you by someone on the local machine,
                    340: then this problem does not exist, but if the message came from a remote
                    341: machine, the problem must be dealt with.
                    342: .i Mail
                    343: uses a heuristic to build the correct name for each user relative
                    344: to the local machine.  So, when you
                    345: .b reply
                    346: to remote mail, the names in the
                    347: .q "To:"
                    348: and
                    349: .q "Cc:"
                    350: lists may change somewhat.
                    351: .sh 2 "Special recipients"
                    352: .pp
                    353: As described previously, you can send mail to either user names or
                    354: .b alias
                    355: names.  It is also possible to send messages directly to files or to
                    356: programs, using special conventions.  If a recipient name has a
                    357: `/' in it or begins with a `+', it is assumed to be the
                    358: path name of a file into which
                    359: to send the message.  If the file already exists, the message is
                    360: appended to the end of the file.  If you want to name a file in
                    361: your current directory (ie, one for which a `/' would not usually
                    362: be needed) you can precede the name with `./'
                    363: So, to send mail to the file
                    364: .q memo
                    365: in the current directory, you can give the command:
                    366: .(l
                    367: % Mail ./memo
                    368: .)l
                    369: If the name begins with a `+,' it is expanded into the full path name
                    370: of the folder name in your folder directory.
                    371: This ability to send mail to files can be used for a variety of
                    372: purposes, such as maintaining a journal and keeping a record of
                    373: mail sent to a certain group of users.  The second example can be
                    374: done automatically by including the full pathname of the record
                    375: file in the
                    376: .b alias
                    377: command for the group.  Using our previous
                    378: .b alias
                    379: example, you might give the command:
                    380: .(l
                    381: alias project sam sally steve susan /usr/project/mail_record
                    382: .)l
                    383: Then, all mail sent to "project" would be saved on the file
                    384: .q /usr/project/mail_record
                    385: as well as being sent to the members of the project.  This file
                    386: can be examined using
                    387: .i "Mail \-f" .
                    388: .pp
                    389: It is sometimes useful to send mail directly to a program, for
                    390: example one might write a project billboard program and want to access
                    391: it using
                    392: .i Mail .
                    393: To send messages to the billboard program, one can send mail
                    394: to the special name `|billboard' for example.
                    395: .i Mail
                    396: treats recipient names that begin with a `|' as a program to send
                    397: the mail to.  An
                    398: .b alias
                    399: can be set up to reference a `|' prefaced name if desired.
                    400: .i Caveats :
                    401: the shell treats `|' specially, so it must be quoted on the command
                    402: line.  Also, the `| program' must be presented as a single argument to
                    403: mail.  The safest course is to surround the entire name with double
                    404: quotes.  This also applies to usage in the
                    405: .b alias
                    406: command.  For example, if we wanted to alias `rmsgs' to `rmsgs \-s'
                    407: we would need to say:
                    408: .(l
                    409: alias rmsgs "| rmsgs -s"
                    410: .)l

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.