next up previous contents
Next: How to Know When Up: Using Electronic Mail in Previous: Forwarding Mail to Another

Subsections


     
Customizing Mail

Suppose you'd like to reference someone's message to you in a reply, but you don't want to retype the old message. You can customize Mail to copy previous messages into your current message, and mark the reference with characters you specify. You can also customize Mail to delete excessive headers. These are only a few ways you can customize your Mail system. Each section below describes how to make the items described above work for you.

     
Creating a Custom Mail File (.mailrc)

The key to customizing Mail is to create a file called .mailrc and put certain commands in the file that will affect your mail environment. To create the file, simply type this at the shell prompt:
cat > .mailrc
Anything you type after issuing the command shown above is entered into the file you just created. Type any of the commands described in the sections below. When you're done, move the cursor to a blank line and press Return, then CTRL-d. You can edit the file at any time with an editor such as vi or emacs.

Changes to your .mailrc file will take effect the next time you run mail.

Creating Mail Aliases

Mail aliases enable you to designate a single word for a long mail address. You can also use a mail alias to send mail to a group of people.

This feature can come in handy if you often send mail to someone at an address such as jvp5001@yahoo.com. Rather than typing the complete address every time you want to send your friend or colleague a message, you can set up a mail alias that will allow you to type one word to signify the entire mail address.

Mail aliases are stored in the .mailrc file.

Creating a Single Alias

To alias a name to just one address: in the .mailrc file, enter an alias using this format:

alias name address
replacing name with the alias you want to use, and address with the person's actual email address. For example,
alias joe jvp5001@yahoo.com
would allow you to address electronic mail simply to joe, and it would be routed to the correct email address.

Creating a Group Alias

You can also create a mail alias that will route a message to a group of people. To do this, enter the aliases in the .mailrc file using this format:

alias name address-or-alias address-or-alias ...
replacing name with the alias you want to give the group, and address-or-alias with electronic mail addresses or aliases that you have already defined. The entire alias must be on one line, you can not press return in the middle of the list.

For example, the alias

alias team doylez jb_doej@yahoo.com

would allow you to address mail to team, which would send the message to doylez on the RCS system and doej on Yahoo.

Listing Aliases

To list aliases that are currently created, you can use the alias command at the & prompt inside mail. Just type

alias

at the & prompt, and a list of aliases you have created will be printed.

     
Referencing Messages


NOTE: The commands in this section do not work on IBM workstations. They do work on Sun workstations.


You might have already sent a message to someone and received a message back that looked something like this:

Message  1:
From aultj@rpi.edu Tue Sep 18 15:01:24 1990
To: doylel@rpi.edu
Subject: Re: mail style question
In-Reply-To: Your message of "Mon, 10 Jun 93 15:40:19 EDT."
             <9009171940.AA15060@rpi.edu>
Date: Tue, 11 Jun 93 15:03:55 -0400
From: James Ault <aultj@rpi.edu>
 
 
>I was wondering if you could tell me how to
> reference previous messages I have received in
> my replies.
>
> I can't imagine that people retype all that stuff.
You're right, there is a simple way to do this. 
It's all explained in memo 115.
Just look in the section on customizing
mail. Good luck.
There is actually a command in mail that enables you to copy a previously received message or even a file into the message you are currently writing. The first step however, is to tell UNIX what symbol you want to use to mark the referenced message. In the .mailrc file type this command:
set indentprefix=``>''
This will make the symbol > appear before each line of the message you are referencing. You can use any symbol or group of characters you wish. Now, access mail or mail -f and look at the number of the message you want to reference (enter h to see the message listings if you are already in mail). Begin your message. Let's say you are at the point in your message where you want to reference a previous message, say, message 7. On a new line in your message, type
~m 7
You will see the message
\begin{alltt}
{\tt interpolating: 7
(continue)}
\end{alltt}

You can now use vi to edit your message, inserting your own comments between the comments you are referencing. Simply enter the command ~v to access vi. When you exit vi you'll see (continue) which signifies that you are still in Mail, and you can continue adding to your message if you wish.

If you wish to use emacs instead of vi as your editor, enter the command ~e to access emacs.

When you're finished, send the message by moving the cursor to the next blank line and entering a period (.).

   
Removing Headers


NOTE: The commands in this section do not work on IBM workstations. They do work on Sun workstations.


Headers are the items at the top of every mail message that tell you who sent the message, what the message id is, return path, and so on. You might not want to look at any of the headers other than the sender and the date. To have Mail automatically remove excessive headers, use a command called discard in your .mailrc file. For example, entering the following lines

discard Received
discard Sender
discard Status
discard Message
discard Return-path
will eliminate those headers.

     
Saving Messages You Send

Have you wondered what happens to the messages you write and then send off? UNIX does not save those messages. Perhaps you would like to save them for later reference. To do so, enter this command in your .mailrc file:
set record=$HOME/.outgoing
You should then quit your editor and enter the following command at the UNIX prompt:
ln -s /home $HOME
Every time you send a message, a copy of it will be saved in a file called outgoing in your home directory. To see your old messages, enter this command at the shell prompt:
mail -f $HOME/.outgoing
You can then use any of the mail commands to read, send, delete, or reference your old messages.


EXPLANATION: The ln -s /home $HOME command (ln is the link comand) ensures that the mail will be recorded whether you are using a Sun or an IBM workstation. The UCB Mail program on IBM workstations processes the ``set record" command in a slightly different manner than the UCB Mail program does on Suns. While the Sun version of UCB Mail takes the filename from ``set record" and treats it as a relative path to the directory in which you are currently working, the IBM version of UCB Mail treats the filename as a relative path to your home directory.



next up previous contents
Next: How to Know When Up: Using Electronic Mail in Previous: Forwarding Mail to Another
Send comments to consult@rpi.edu.