Electronic mail, or e-mail is the term given to messages sent to and from users on the same machine or on other machines. The mail system consists of a mail daemon (pronounced like the word "demon") and a mailer program. On Wiliki, there are four mailer programs available for the users: elm, mail, mailx, and pine. Of these four, elm is the most popularly used mailer program on Wiliki, and is the topic of this tutorial. (Sorry, no statistics here, just my judgment and observation.)
The mail daemon is a program that runs in the background and services requests to send and accept e-mail. Every machine on a network has its mail daemon running to accept any e-mail incoming from another machine, as well as to service any e-mail sent locally within the same machine.
When a mail message for you is received by the mail daemon, regardless of whether it is a locally sent message or a message received from another machine, the incoming mail is saved to your mail in-box file. On Wiliki, this file is /usr/mail/username, where username is your own login ID. On other machines, such as Uhunix, the file name may be different, for example /usr/spool/mail/username. Your mail remains in this file until elm or some other mailer program deletes the mail from your mail in-box file.
Users sending mail to one another will not have to worry about what kind of mailer the recipient uses. In other words, mail sent using elm can be read by users using pine, and so forth. There are some features in elm discussed later that require the recipient to be using elm.
Elm is a screen-oriented and easy-to-use program for sending and receiving e-mail. In addition to sending and receiving mail, elm also has additional features, such as mail forwarding, bouncing, saving, replying to received messages, and the creation of mailing lists, called aliases. Saved mail messages can be placed into mail folders for later retrieval.
You normally start elm up by typing elm at the prompt. When you start elm for the first time, it will ask you if you want to create two directories in your home directory. These directories, called .elm and Mail are used for the following purposes: The .elm directory is used to hold any customization and other setup files, and the Mail directory is used to store mail messages.
Once elm starts up, it divides the screen into three parts. At the
very top of the screen there is one line showing you the current folder, (when
you start up normally it is usually your e-mail in-box) the number of messages
in this folder, and the elm version number. The middle of the screen contains
a list of all mail messages in this particular folder, numbered starting from
1. There are six columns in this section of the files.
The first column has the status of the mail message. The status is shown by one or more letters in it. 'N' signifies an new, unread message, 'O' signifies an old, unread message, and 'U' signifies an urgent message. If the first column is blank that message has already been read. An 'M' in this column signifies that the mail message is a "metamail" message, which means that it includes multimedia (i.e., graphics or sounds or other binary files), or has information in several sections. (See the section on including files.)
The second column contains the message number in the current folder. Messages can be selected by typing the message number and hitting return. If the screen is not big enough to display all messages, moving the arrow or typing the number will move the list of mail messages to the appropriate place.
The third column and fourth contains the date the mail was sent and the author of the mail message. The fifth column displays the number of lines the message has. Finally, the sixth column shows the subject of the mail message.
At the bottom of the screen, there is a menu with the commands available.
The list of commands shown depends on the skill of the user. When you first
use elm, you are at the "Beginner" level. The menu for "Beginner" looks
like the following:
The menu does not show all the commands, but all the commands are still
available. For a list of all commands, look at the end of this tutorial.
Some of the more commonly used commands are described
As mentioned in the above section, you can start composing a new mail message by using the 'm' command. Replying to a received mail message can be done with the 'r' command. For the 'm' command, you specify a recipient to your mail message. For the 'r' command, the recipient is automatically specified from the mail message being replied to. If the recipient has an alias or is a local user elm will show the recipient's "real name" in the To: field.
Next, elm asks for a subject. For the 'r' command, the subject field is automatically filled in, but you have to type return to enter it. Normally, for example, if a mail message was received with the subject "Invoice payment due", the subject for the reply would automatically be set to "Re: Invoice payment due". You can change the subject before hitting return in this reply mode.
The next step asks for a Cc: field. This is useful when you would like to send copies of this mail messages to other people. If not, just hit enter, and leave it blank. Finally, after these three fields are properly input, elm goes into the text editor. If you have not set any editor settings, elm will start the VI editor. (See section on changing default editor below for more information on this topic.)
After editing your mail message, elm gives you a set of options. You can choose to do one of the following: 'e' for edit, 'h' to edit the headers, 'c' to copy the message to a file, 's' to send it and 'f' to forget it. If you just press return, it will send the message to the recipient.
One feature which is not used often in elm is the include file
feature. To use this feature, you have to put the following text within the
body of your message:
[include file contenttype/subtype encoding]
The [include] has 3 arguments used to process your included files, as follows:
When you place this text into your message, elm will automatically look for the file and include it in your mail message. The recipient of this mail must have the capability to read MIME (Multipurpose Internet Mail Extension) mail messages. Here are some commonly used MIME types:
If you have received MIME mail, you may experience difficulty viewing included files, such as images on your terminal. In order to save your mail message instead of having the metamail program attempt to display each section of the e-mail, pipe your mail message (using the | command) to the command, metamail -w. This will allow you to create temporary files which you can download to your computer for local browsing. Note that the files created may or may not be binary files so be careful when downloading these files to your computer.
The version of elm which is compiled for use on Wiliki has the feature to allow you to encrypt portions of the outgoing message. In order to do this, include the following text before the text you wish to have encrypted:
When you are done with encryption, follow the text with the following text:
When you are finished composing your mail message, you would send your mail in the same way as a normal mail message. However, after specifying to send your mail, elm will ask for an encryption key. Similar to the passwd command, you will be prompted for this password twice.
Note that when you send encrypted mail, your recipient must also be using a version of elm with the encryption configured. Other mailers will not be able to read encrypted mail created by elm. Be sure your recipient(s) do know the encryption key.
Elm has the capability to allow you to include some customized headers. The custom header capability allows you to include new headers or replace already-existing headers. In order to use this capability, use any text editor to create a file called elmheaders in your .elm directory. Follow this format when creating a header entry:
The kind of header you would like included is to the left the colon, while its value is included to the right of the colon. If you use the "backquote-notation", you can also include the output of various commands. For example, the following header line includes the users currently logged on to Wiliki:
Elm runs the program users and puts its output in the header.
In addition to starting up elm by simply typing elm, there are other ways to start up elm, by specifying optional arguments. Here is the form of the elm command with optional arguments.
The first form is used for reading. Any of those options shown can be given individually or all together. The flags have these meanings for the first form:
The second form is used for sending only. A subject can be specified with the -s option, and the subject is followed by a list of addresses to send the mail message to. For example, the following lines shows how to use elm in the send-only mode.
Elm has a capability to save old mail into files called folders. These folders reside in your Mail directory, and are copies of the mail messages previously read (or sent). In order to create a folder, you merely have to save a message into it. If the folder doesn't exist, elm creates one for you. The command to save the currently highlighted mail message is 's', which will prompt you for a folder to save the email in. By default, Elm will put an equal sign followed by the sender's login id.
The equal sign has a special meaning to elm. It is replaced by your Mail directory in your home directory. For example, =ben becomes ~/Mail/ben, where ~ stands for your home directory. This convention also works when starting elm with the -f option. Typing elm -f +junk will start elm by reading a folder in your Mail directory called junk.
The same manipulations can be done to other folders as you can to your in box. Mail saved into folders can be deleted, saved to a different folder, replied to, bounced or forwarded. Within elm, you can use the 'c' command to change the current folder to be a different folder. When you type the 'c' command, elm will ask for the folder name. In order to get a list of all folders in the Mail directory, you can type in the folder named =*.
Elm has a facility to create abbreviations or short names of some of the addresses or groups of addresses you send mail to frequently. These short names are called aliases. Elm maintains a list of these aliases, and the alias menu can be accessed by the 'a' command. The alias menu looks similar to the mail index, but instead of mail messages, defined aliases are listed in this screen. The alias menu has its own set of commands, some of which are listed here.
In order to create a new alias, you use the 'n' the command. After entering the command, elm will ask for the alias name. This is the name used in the To: field when sending mail. After entering the alias' name, you will be asked to enter the last and first names of the alias, as well as an optional comment. If you do not want to type the names in, just hit return. Next, you will be asked to supply the address(es) of the person/people in the alias. If you want to specify many names, separate the names with a comma, making sure there are no spaces within the list of addresses. Finally, elm will ask you for confirmation in accepting this alias.
After creating the alias, use the 'r' command to return to the mail index.
Elm will re-create your alias file, and once in the mail index, the
aliases will be ready to use. Below is an example alias being created:
The next time you want to send email to your friendly lab monitors, you can send email to "monitors", and elm will expand the addresses and send mail to the four users specified in the example.
The aliases.text file is the text version of the alias file. Before
elm can use this file, it must be formatted. If you want to change the
aliases.text file to make a few short changes, it is easier to change
the file directly, rather than use the 'c' command in the alias menu. This is
because the 'c' command requires you to type in all addresses of an alias, if
you want to add or subtract names from an alias definition. The
aliases.text file contains lines with this format:
You can enter the editor to manually change this file using the 'e' command from the alias menu. For example, for the alias above, the corresponding line in the aliases.text file looks as follows:
You can make changes to the contents of this file using the editor and after saving the file, elm will automatically reformat the file so that it can use the aliases afterwards. If there are any errors in the formatting of the file, elm will complain about it, and will not accept the alias. Remember that there are no spaces allowed in the last part of the alias.
Elm has a simple customization screen, but it doesn't have all the options for customizing. Certain options need to be customized manually, and are described later in this section. The command to get into the options menu is 'o', from the mail index. The Options Editor screen has 13 options, and some of the options are on or off, while others are text input. For certain fields, you can switch between settings using the space bar.
For example, to change the user level, first type the 'u' command to start changing the user level. Then you can hit the space bar to switch between Beginner, Intermediate, and Expert. The basic difference is the menu changes for the different user levels.
Another useful option to set is the editor option. Start changing the editor for elm by getting into the options menu with 'o' and then typing 'e' to change the editor. After you type the 'e' to change the editor, you type over the text existing in the field. For example, if you want to use the pico editor (which is a very simple editor, written with the beginning user in mind) instead of the vi editor, you would type /usr/local/bin/pico -t into the editor field. If you want to change the editor back to the vi editor, type /usr/bin/vi in the editor field.
After modifying any options, type the '>' to save the settings. These settings are saved in the file, ~/.elm/elmrc and this file can be manually modified to customizing settings. The settings file is not created until you save the file using the '>' command in the options menu.
As mentioned above, there are many options available in the elmrc
file. Using any text editor, edit this file to change any desired settings. The
lines in this file have the following format:
Where option is a customization option, and VALUE is the value of that option. Many options can only be either "ON" or "OFF". Some options can contain words. If any line begins with a pound sign (#), the line is considered a comment, and is ignored. The default elmrc file that is created using the '>' command in the options menu creates an elmrc file that contains comments to explain these options.
For example, the "copy" option can be either ON or OFF. If it is ON, elm saves a copy of all outbound mail into either the =sent folder or the folder of the addressee. A list of the options are given in the last section of this tutorial.
Note: Those options in boldface can be either ON or OFF.