CHAPTER 6: ELECTRONIC MAIL
back to the Computing Guide Contents


This chapter covers the basic information on using electronic mail (e-mail) in the MMM computing environment.


6.1 E-mail Addresses


E-mail is a facility for sending and receiving messages on computer networks. The Internet network allows you to communicate with people both locally and around the world who have computers connected to the Internet. Messages are often delivered within minutes, depending on the destination, and delivery is generally reliable, but not guaranteed.

Each user in MMM has both a UCAR e-mail address and a local MMM e-mail address.

Your UCAR e-mail address has the form

where user is your login name. Your UCAR e-mail address should be given to all correspondents outside of MMM; it is the most efficient and reliable address for general usage.

Your local MMM address has the form

Your MMM e-mail address is set up in the SCD gateway database when your account is created. Should you need to change it in the future, you will need to update this information in the SCD database. (See below for entering this information.)

Your e-mail messages will come in through the central email server and are then forwarded to the divisional mmm server. You must log on to a workstation to read this mail.

To change your e-mail address in the SCD database, enter

A menu with options will appear. Select You will be prompted to enter your Scientist Number, SCD Login Name, and Project Number or gate keeper password.

Set "E-mail address" to

where user is your login name, host is the machine you want your mail to go to, and domain is the internet domain name. An example of a local MMM address is jones@mmm.mmm.ucar.edu.


Return to top of page

6.2 E-Mail Programs


On Unix systems, there is more than one program to read and send e-mail. The differences between these programs are mostly in the user interface. The standard Unix Mail utility for reading and sending messages has the advantage of being available on all Unix systems; its disadvantage is that it does not have a user interface that is very easy to learn or use.

elm is another mail utility that is distinguished by a user interface that is very easy to learn and use.

Netscape has a mail utility program which has a nice GUI interface. There is also a GUI Mail program available for the PCs and Macs called Eudora Pro. This document will discuss all five of these mail programs.

6.2.1 The Unix Mail Program

To use this program, make sure that the directory, /usr/ucb appears before the directory, /bin, in the definition of your PATH variable in your .cshrc file.

Reading Messages

To read mail messages, enter If you have messages, you will see a one-line summary of each message for the first 20 messages. Any message can be read by typing the number of the message at the prompt. To see a complete list of available commands, enter a ? at the prompt. Below is a summary of common options for reading and replying to messages. In the above options, a message list is one or more mail message numbers. A user list contains individual e-mail addresses. Note the difference between the x and q commands. x means that your mail file will be left unchanged so that messages marked for deletion will not actually be deleted. Use this command if you decide that you do not want to delete messages after all. The q command will delete the messages flagged for deletion. On the Sun systems, this command also takes any mail messages that you read but did not delete and moves them to a file in your home directory called mbox. The messages saved in this file may be read by typing mail -f.

Sending Messages

To send a message, enter where user@host.domain is the e-mail address of the recipient. Mail will prompt you for a subject. After you enter the subject, you are placed in the message buffer. Enter the text, ending each line with a carriage return. Note that this is not an editor. Once you have completed a line, you cannot go back and make corrections. Some options available while in the message buffer are
CTRL-c CTRL-c (Enter CTRL-c twice.) 
        Cancels a message at any time.

.       Enter a .(dot) as the first character on a 
        line and press RETURN to send a message.

CTRL-d  Alternate command to send a message.
Alternatively, you can use a text editor to compose your message in a file, then read this message into the Mail utility. where filename is the file to send. If you want a subject attached, enter

6.2.2 The elm Mail Program

The elm program provides an easy-to-use interface for processing mail messages. To send or read mail, type elm.

When you use elm for the first time, it will ask you a set of questions, to which you should respond "yes". Once in elm, type o for a list of options to set up your configuration file, such as changing the default editor. We recommend that you change the User Level by selecting U. Change it to Intermediate User by pressing the space bar. This causes elm to give you an extended list of options in other menus. Once the Intermediate User option appears in the space, press RETURN. Press the > symbol to save these changes, then press i to return to the main menu.

Reading Mail

When elm starts up, you will see a list of your ten most recently received messages. The current message is highlighted with a reverse video bar. Use the arrow keys to move down and up. To read the message currently highlighted, press the RETURN key. Press the space bar to page through the message if it is more than one page. To delete a highlighted message, type d. Additional commands are displayed at the bottom of your screen. To execute a command, enter the first letter of the command.

Sending a Message

To send a new message from within elm, type m for mail. You will be prompted for information and placed in an editor (vi or emacs) to create the message.  A full invocation of the editor is running, and every command that you normally use in the editor can be used here. You should not rename this buffer (file), since elm requires that the message to be sent have a special name in the /tmp directory. After writing the message, save the file and exit the editor as you normally would (ZZ in vi, C-x C-c in Emacs). elm will display a prompt asking what to do with the message. Type s to send it or f to forget it.

Sending an Attachment

To send an attachment to a message with elm, compose the body of the message as described above. While still in the insert mode, at the bottom of the editor, include the following

[include /users/castille/file.ps application/postscript]

or another example would be:

[include /users/tanner/file.pdf application/pdf]

Replying to a Message

To reply to a message, type r when the reverse video bar is on the message you want to answer. elm will then prompt you for information and place you in an editor to construct the reply. Create the reply, save the file and exit the editor. Type s to send it or f to forget it.

Exiting from elm

To exit from elm, type q. Before exiting, elm will ask if you want to move the messages you have read to another folder. If you answer y, elm will automatically perform the move. To access these moved messages, type c to change folders and then > when prompted for the folder name. By default, messages are appended to the folder, which could become quite large. To delete unwanted messages that were previously saved, use vi or Emacs.

6.2.3 Netscape Mail

Setting up Netscape Mail

Before using the Netscape Mail program, Netscape preferences must be set up for e-mail. Under the "Edit" menu, choose "Preferences." This will open the "Preferences" Window. Click on the Triangle next to "Mail & Newsgroups" to expand the menu. Edit the "Identity" and "Mail Servers" using the following information.

Highlight "Identity" and enter your information using the example below:

Note: A signature is a few lines of text that are automatically added to the end of an outgoing message when it is sent. It can be whatever you want, but it is usually used to give contact information (telephone, address, etc).

Now, highlight "Mail Servers" and enter your information using the example below:

Highlight the incoming mail server mmm.mmm.ucar.edu, then click on the Edit button. On the General tab, Server name should be mmm.mmm.ucar.edu, and you should enter your username. Next Click on the POP tab and check "Leave messages on server." If you do not select this, all e-mail is copied to /users/username/nsmail.

To use the Netscape Mail program, start up Netscape then under the "Communicator" menu, choose "Messenger Mailbox"

Reading Messages

Click on the "Get Msg" icon to retrieve e-mail. The Netscape Mail window will appear with the message list on the top and the highlighted message displayed on the bottom part of the screen. To read messages, simply highlight the message that you wish to read. To delete a message, highlight it and click on the "Delete" icon at the top. To read the next message, click on the "Next" icon.

Sending Messages

To send a message, click on "New Msg" icon. Enter the e-mail address of your recipient in the To: field, enter a subject in the Subject field and enter your message in the message box. To send an attachment, click on the "Attach" icon and select the file to attach. To send the message, click on "Send Now" icon.

Exiting from Netscape Mail

To exit the Netscape Mail utility, under the File menu, choose Close. If you choose exit, it will exit you from the Netscape program also.

Features of Netscape Mail

Netscape Mail offers an Address Book and Filtering.

The Address Book is used to set up aliases for individuals and groups. To access the Netscape Address Book, under the "Communicator" Menu, select "Address Book".

Filters will automatically take action on certain e-mail messages. To access Netscape filter options, within the Netscape mail window choose "Mail Filters" under the "Edit" menu.

If you need additional help with these and other Netscape features, there is an online help, under the "Help" menu, choose "Help Contents".

6.2.4 Eudora Mail

The Eudora Pro Mail program is a licensed commercial product for the PCs and Macintoshes. A license must be purchased for each system Eudora is installed on. This allows a PC or Mac to communicate with the MMM POP Mail server, so that users can manage their e-mail from their desktop system with a Graphical User Interface (GUI).

Setting up Eudora

To have Eudora Pro installed on your system, enter an assist request. After it is installed, double-click on its icon to open it.

You have to provide basic information about your account, servers and network connection before you can send and receive messages. To do this, use the Getting Started Options which can be found under the "Tools" menu, "Options". Then enter your information using the example below:

The other setup options include the following, but you do not need to edit these in order to set up Eudora. You may want to edit them to personalize your e-mail.

Reading Messages

To download messages, click the "Check Mail" icon. This will download new email messages to your system. It may prompt you for your pasword, depending on whether you have Eudora set up to Save your password (see Tools, Options, Checking Mail). Then make sure you have your In Mailbox open and highlight messages to read them. To delete a message, highlight it and click on the "Trash" icon.

Sending a Message

To send an email message click on the "new message" icon, then enter the address or addresses of the person or people you want to send email to. Enter a subject and text in the body of the message. If you wish to send an attachment, click on the attachment icon and include the file. When finished click on the button labeled "send".

Replying to a Message

To reply to a message, highlight the message you wish to reply to and click on the "reply" icon. Type in your message and click on send.

Exiting from Eudora Pro

To exit from Eudora Pro, simply close the application as you would any PC or Mac application. Under the file menu, select Exit.

Features of Eudora

Some of the features in Eudora include signatures, address book, filters, and timed messges.

A signature is a few lines of text that are automatically added to the end of an outgoing message when it is sent. It can be whatever you want, but it is usually used to give contact information (telephone, address, etc). The signature feature can be found under the "Tools" menu.

The Address Book is where you keep information about individuals or groups that you correspond with. Each entry in the Address Book includes a nickname for a person or group, and their full e-mail address. You can also include their real name, contact information and notes. The Address Book can be accessed under the "Tools" menu.

Filters can be set up to take certain actions automatically on certain e-mail. For example, you can set up a filter to delete messages from specific senders or reply to messages or save them in mailboxes. Filters can be accessed under the "Tools" menu.

You can specify that a message be sent at a certain time in the future. Be careful using this option, because it is not always reliable.

If you need help setting up any of these features, please see the Eudora on-line help. Also, there is a Eudora Pro manual available in the MMM Computing Library.


On-line Information

Hardcopy References



Return to top of page

6.3 Other E-Mail Topics


6.3.1 E-Mail Notification Programs

There are several programs that will notify you when mail has arrived. If you are running under the X Window System, you can use xbiff. To start the program, enter A small mailbox icon will appear on the screen. When new mail arrives, the program will beep and the icon's appearance will change in an obvious way. After you read the mail, the icon will return to its original state. You can put the above command line into a customization file such as .xsession.

If you are not running under X windows, or you do not want to hear beeps when mail arrives, you can run the program called newmail. When new mail arrives, a one-line message indicating the sender and subject will be displayed in the window where the program was started. You can start this program from within your .login file.

One program that you should not use is biff. This program will not work on our systems due to specifics of our cluster configuration.

6.3.2 Aliases

A mail alias is a short, one-word name assigned as a substitute for an individual e-mail address or a list of e-mail addresses. The systems staff maintain several aliases, listed later in this section, for various groups in the division, as well for the entire division at large. You can create your own personal aliases as well. Once you have created an alias, simply type the alias in place of the addresses when sending mail. For example, you can alias the name, joe to the e-mail address, joe@ucar.edu. Then, instead of typing this long address to send mail, you can simply type joe. The method of creating aliases varies with the mail program you use, as detailed below.

Using Aliases in Unix mail

If you use Unix mail and not elm, you enter alias information into a file called .mailrc, which you can create if you do not have one (or edit, if it already exists). This file can contain many commands for initializing mail and setting the values of variables used by mail. One of this file's most common uses is to define aliases. To create an alias, follow the syntax given in the following example.
alias programmers boydw@ucar.edu gill@ucar.edu waukau@ucar.edu
It is important to note that when entering aliases that contain more than one address, you must not enter a carriage return at the end of the lines of the alias definition. The definition should be one long "line" with a carriage return at the end.

The aliases that you insert in this file will be used whenever you send mail with the standard Unix mail command, or from within emacs. These aliases will not be seen by the elm program. If you send mail from elm, use the instructions below.

Using Aliases in elm

To create aliases in elm, use elm's own alias facility. When in elm, type a to enter the alias facility. Once there, you will see options that allow you to enter new aliases or modify existing ones. To enter a new alias, type n. Elm will prompt you for the alias name. This is the abbreviation that you want to have correspond to the actual e-mail addresses. Elm then prompts for last name and first name. You should fill these in if your alias is for a single person. If it is for a group, just enter RETURN at these prompts. Eventually, elm will prompt you for the address that corresponds to the name. This is where you type in the full e-mail address(es). If there are more than one, separate them with a comma and no spaces.

To send mail to an alias, simply use the alias name when elm prompts for the To: address. Remember that the elm aliases can only be used within elm; the Unix mail program will not see them.

MMM Mail Aliases

Mail aliases that are currently available system-wide are

6.3.3 The E-mail Vacation Notifier Procedure - Using procmail

When you are away from e-mail and are unable to respond to it, it can be useful to setup procmail filters that will automatically reply to messages you receive, notifying the sender that you are away from your mail and will read their message when you return. This can be setup from any Unix system.

The process detailed below will only respond to messages sent directly to you and will not respond to mailing list messages so you do not have to worry about the program sending messages when you receive mail addressed to mmmall or other such aliases. Also, the program keeps track of whom it has notified that you are away and will only send one such notification per 7 days. That is, if a user sends you mail on Monday and the vacation program replies and notifies that user that you are away and the same user sends you a message the next day, another notification will not be sent out. Only after 7 days have elapsed between the first and second messages (from the same sender) will another notification be sent out.

All your mail will be in its normal place and you can read it just like you usually do. The only difference is that people who send you mail are being notified that you're away.

The first time you use procmail for auto-replying to your email during your absence, their are several setup steps that need to be performed. This process will not be necessary on subsequent uses.

Setup of procmail for auto-reply

Set your default directory to your home directory


cd /users/login
cp /usr/common/skel/.procmailrc .
cp /usr/common/skel/.forward.vacation .

mkdir .procmail  
[Note: If you are already using procmail for filtering, this directory already exists.]
cp /usr/common/skel/rc.rules.vacation .procmail/.
mkdir /users/login/Mail  [Note: This directory may already exist.]
Next make the following modifications to the above files.

/users/login/.forward.vacation

Change login to your login name

/users/login/.procmail/rc.rules.vacation

Change all instances of login to your login name

Next create the following file in /users/login/.procmail

cd /users/login/.procmail
cat /dev/null > log
Use of procmail auto-reply

Now that the necessary structure has been setup for procmail to auto-reply to incoming mail messages, take the following steps each time you will be away from your email.

cd /users/login/.procmail
cp rc.rules.vacation rc.rules

[Compose message to be sent to sender]

  vi /users/login/.procmail/vacation.msg

or

  emacs /users/login/.procmail/vacation.msg

cd /users/login
cp /users/login/.forward.vacation .forward

ALWAYS verify the setup is working by sending yourself on email before you leave.

Note: On your return do the following:

mv /users/login/.forward .forward.vacation
rm /users/login/Mail/vacation.cache 
6.3.4 Sending Binary Files through E-Mail - uuencode

Sometimes it is necessary to send a binary (non-text) file through e-mail when ftp or another transfer program is not an option. E-mailing binary files should only be used as a last resort because (1) it is a non-trivial multi-step process, (2) mail was not designed as a file transfer mechanism, and (3) there is a limit on the size of e-mail that can be sent and received. The limit at NCAR is 200,000 bytes. If you are sending to an address outside of NCAR, they will have their own limit. Since binary files tend to be big, it can be impossible or cumbersome (see directions below) to send them via e-mail. Furthermore, the person you are sending the message to must be on a Unix system (or have access to one).

Assuming you have decided you must do this, here are the steps for sending the file. The binary file to be sent is called filename in the example below.

  1. Type the command
      uuencode filename > filename.uu
  2. Type the command
      mail user@host.domain < filename.uu
If the file you are sending is bigger than 200,000 bytes, you will have to split the file using the split command into smaller pieces and follow the above sending instructions for each piece.
 

6.3.5 Receiving Binary Files and Attachments through E-mail

There are a variety of formats for receiving binary files over e-mail.  Below are instructions for recognizing and converting three common types of encoded files:
  1. uuencoded
  2. MIME
  3. BinHex
  4. MSWordView

Uuencoded messages

You can recognize a uuencoded file because the encoded text starts with the following line: Where filename will become the name of the decoded file and ### will be the file permissions.  Also, in the mail header there will be a line similar to the following: To convert a uuencoded binary file received in an e-mail message:

1. Save message to a file. In this example, it will be saved to
   a file named mailfile.binary.

2. Type the command

3. The uudecode command will create a file with the name specified in
   the 'begin' line of the uuencoded file.

4. You can now open filename within the appropriate application.

If you receive several messages that are parts of a single binary file, follow the receiving instructions for each message and then cat all the parts into a single file.

MIME messages

You can recognize a MIME-formatted file, by a line in the mail header similar to the following: In the elm mail utility, an m will appear at the beginning of the message field. When you select the message to read you will see the options: Choose to write the output to a file.  The default filename is specified in the encoded file, i.e., filename. You can now open filename within the appropriate application. You can import numerous filetypes into FrameMaker (available on Sun and SGI platforms), such as Microsoft Word and Excel. Also, Acroread is available on all platforms for viewing and printing .PDF files.

BinHex messages

You can recognize a BinHex-formatted file by a line that precedes the encoded text similar to the following: Also, the e-mail header may contain a line similar to the following: To convert a BinHex-formatted file received in an e-mail message:

1. Using either elm or Berkeley mail, save the BinHex mail message
   to a file (mailfile in this example).

2. Log on to a Sun system and execute the following command:

3. The mcvert command will create a file with the name specified in
   the encoded file, i.e., filename.bin.

4. From a Macintosh, ftp the filename.bin from the Sun system using the
   Fetch program.

5. Fetch will convert filename.bin to filename. You can now open
   filename within the appropriate application.

Using MSWordView

This application will only run on SGI and Sun systems. It converts a Word 8.0 (Word'97) document into an HTML format, which can then be opened through Netscape. Unfortunately, older (or newer) versions of Word documents cannot be read by this application. The author of this software is currently working on this problem, along with making converters for spreadsheets, PowerPoint presentations, Access database files, and Office draw files.

Here's how it works:

  1. If you receive the document through email, elm or Netscape mail can decode it into a Word format. Save the Word document to a file. The file should have a .doc extension. (i.e., jodyfile.doc.
  2. )

  3. Use MSWordView to convert the file to HTML. Remember, this application is available only on Sun's and SGI systems. Example: >mswordview jodyfile.doc. This step creates a file called jodyfile.doc.html.

  4. Now, open Netscape. In Netscape, under the "File" menu, select "Open Page". It will open a window where you can type the name of the file (i.e., /users/tanner/jodyfile.doc.html) or select the "Choose File" option to search for the file.
  5. When you have selected the appropriate file, click on "Open in Navigator", and there you have it! You should now be viewing the converted Microsoft Word document.

Once opened in Netscape Navigator, the HTML file can be edited by clicking on "File", and choosing the "Edit Page" option.

6.3.6 procmail - email filter program

Procmail is a program used to filter email on Unix systems.

NOTE:If you are going to use the procmail program, you are cautioned to be careful about the rules syntax. Incorrect syntax will prevent mail delivery to your account.

User Setup

Create a .forward file in your home directory with the following line.

"|IFS=' ' && exec /usr/local/procmail/bin/procmail -f- || exit 75 #username"
A configuration file, .procmailrc, needs to be created in the users home directory with the following entries.
#Set on when debugging
VERBOSE=off

#Replace `mail' with your mail directory (Pine uses mail, Elm uses Mail)
MAILDIR=$HOME/mail
    
#Directory for storing procmail log and rc files
PMDIR=$HOME/.procmail
     
LOGFILE=$PMDIR/log
INCLUDERC=$PMDIR/rc.rules
A directory for procmail needs to be created off the users home directory.
      mkdir ~/.procmail
This directory contains a log file and a filtering rules file.
ls ~/.procmail

-rw-------    1 boydw    users        8515 Nov 14 08:10 log
-rw-r--r--    1 boydw    users         501 Nov 14 06:59 rc.rules
Following are samples entries in the rc.rules file
:0
* ^From:.*email-address
/var/spool/mail/username

:0
* ^X-Spam-Level: \*\*\*\*\*\*\*\*
/dev/null

:0
* ^X-Spam-Level: \*\*\*\*\*
spam

:0
* ^Subject:.*test
folder

:0
* ^Subject:.*TestScript
| /users/username/script arg
The above rules illustrate filtering based on an email's "From:", "X-Spam-Level:", and "Subject:" lines. When email comes in, the .forward file executes procmail using the rules in ~/.procmail/rc.rules. Procmail processes the rules sequentially, if a rule is true, the action is take, the transaction is logged to the file ~/.procmail/log and procmail exits. The following is an example of filtering email based on the subject line.
:0
* ^Subject:.*test
folder
A rule begins with ":0", followed by a line with an expression to match for example
* ^Subject:.*test
means match a line that begins with "Subject:" followed by 0 to any number of characters, followed by the string "test", followed by any number of characters. The next line, "folder", is the action to be taken if there is a match, "folder" indicates that the email message will be copied to the file ~/mail/folder. The action may be piping the email message to a script. For example
:0
* ^Subject:.*TestScript
| /users/username/script arg
says if the subject line of an email messages contains the string "TestScript" pipe the message to the script "/users/username/script" with the argument "arg". The first three rules in the above rc.rules example filters spam.
:0
* ^From:.*email-address
/var/spool/mail/username 

:0
* ^X-Spam-Level: \*\*\*\*\*\*\*\*
/dev/null

:0
* ^X-Spam-Level: \*\*\*\*\*
spam
The first rule is used to copy any email coming from the address "email-address" to the users email file. It is placed before the two spam rules so it is processed first. Email coming from some addresses is falsely flagged as spam. This rule is used to make sure it goes to the users mail file. The next rule specifies that email with an "X-Spam-Level:" of more than 8 eight is thrown away. The next rule specifies that email with an "X-Spam-Level:" of 5 to 8 is copied to the file ~/mail/spam.

6.3.7 Answers to Frequently-Asked Questions

Q. What is the largest file I can send via e-mail?

A. When sending files between machines at NCAR/UCAR, the size limit is 200,000 bytes. When sending to machines outside NCAR/UCAR, the limit is 65535 bytes.

Q. Can I retrieve deleted mail messages?

A. If you delete a message and are still in a mail utility, enter u to undelete the message. Once you exit mail, there is no mechanism for retrieving deleted messages.

Q. How can I tell if I sent a message to someone (or if it arrived)?

A. We do not and cannot record the delivery of every mail message sent from the division. If you are uncertain whether you sent a mail message, resend it. There is no mechanism to determine whether or not an individual has received a mail message.

Q. What if someone gave me an e-mail address and it does not work? I might have written it down wrong.

A. Usually it is hard to determine what the correct e-mail address should be. If it is very important and you think only a few characters might be wrong, a systems person can help in some cases. Usually, you must contact the individual in some other way to verify the address.

Q. Can I send binary files through mail?

A. In certain cases, binary files can be sent through mail, but it requires a special procedure.



Return to top of page

Copyright © UCAR 1998 - Disclaimer - mmminfo@ncar.ucar.edu
Last Modified: 1 December 2002