One mail program that can be run in a plain text terminal is called Pine.
e" to end the greeting once
you are done reading it. You won't see the greeting the next time you
start up Pine.
Pine always lists the keys that correspond to different commands on the bottom of its screen. Pine commands are each activated by pressing a single key (don't follow the key with <Return>).
To start Pine, we can type:
% pine
at the UNIX prompt.
Pine starts up showing you its Main Menu:
From this menu, you'll be able read and send messages. Also, the upper right corner tells us if there are any messages in our INBOX, which is the folder in which our new messages are stored.
If we wanted to view the messages in our INBOX (which is the current
folder), we can type "i" to "view the messages in
our current folder":
For each message, Pine lists its date, who its from (or who you sent it to), the size of the message, and the subject. It also marks those message you haven't read with "N" (new).
Like the Main Menu, the bottom of the screen lists commands, such as for
moving around from message to message with "p" and
"n":
We can also move around by using the arrow keys. For example, we can highlight the 2nd message by going to it with the down arrow:
Then, we can go back up to the 1st message using the up arrow:
To view a message that is highlighted, we can just hit <Return>:
When we are done reading it, we can go back to the list of message,
by using "<".
<" command generally goes back to the previous
screen. Likewise, ">" will go to the next screen.
Note that after we read the 1st message, it is no longer marked as "N" (new).
Using commands we've just learned, we can go down to the 2nd message (using the down arrow) and then view it (by hitting <Return>):
Unlike the 1st message that was just text, the 2nd message also has an attachment.
As Pine suggests, if we want to view the attachment(s), we can type
"v":
Doing so, it lists the different parts of the message. Here, it lists the regular text part and the attachment.
With the attachment highlighted, all we have to do to view it is press <Return>:
Since the attachment contains a recipe that we may want to use, let's
save it to a file. You can do so by pressing "s":
It will ask you to type in a name for the file, i.e., where (in your
home directory) to save it. We can just press <Return> to use
its default filename, recipe.txt.
which would call the file~/recipes/cheesecake.txt
cheesecake.txt and try to put it
in the recipes directory under your home directory
(specified by ~). You can also use Ctrl-T to get a list
of files for where to save it.
Now that we are done viewing our messages, let's go back to Pine's Main Menu. Although there doesn't seem to be a command listed to do so at the bottom of the screen:
there is an option to list OTHER Cmds. Choosing that, we see an option for the Main Menu:
Let's go back there by pressing "m".
Instead of keeping all the messages we ever get in our INBOX, we'd like
to organize some of our messages into different folders. We can
access (and create) different mail folders by going to the folders menu.
We can press "l" to list folders:
Right now we only have the INBOX folder. We can create another one to
hold that silly test message we got. We press "a" to add
a new folder:
And when it prompts us, we type the name of a new folder. We'll type
"tutorial" as its name and press <Return>. Once
we've done so, we have a new folder:
Now that we have another folder, let's put the test message in it.
The test message is in our INBOX, so use "p" to go to
the previous folder. Then, press <Return> to view its messages:
Then to save the test message, make sure it is the one highlighted and
then press "s". It will ask what folder to save it to and
we can type "tutorial".
tutorial
folder, and see that the message is there.
Since the message was saved to another folder, note that Pine has marked it with "D":
indicating that the message is to be deleted (when Pine is exited).
Finally, let's talk about how to send a message. First, we get that
option from the Main Menu, so go back there by pressing
"m". Then, press "c" to compose a
new message. When you do so, you get a blank message:
Suppose we want to send our recipe file to someone. We can start out by filling in the appropriate headers fields (like To: and Subject:) and fill in the body of the message:
Then to attach the recipe, we go to the Attchmnt: field and press
Ctrl-J. First, it will ask us for the name of the file to
attach:
Recall that our recipe is in the file recipe.txt (in
our home directory).
Then, it will allow us to type a comment that goes along with the attachment:
and the file will be attached:
We could press Ctrl-J again if we wanted to attach more files.
Ctrl-J does something different when in the body of the
message (versus the Attchmnt: field).
We just need to press Ctrl-X to send the message!
Finally, since we are done with Pine, let's quit it. Type "q".
It will ask you if you really want to quit:
We can type "y" to say Yes. Next, it asks if we want to
move messages we read to a folder called "received":
It may be preferable to just keep them in our INBOX, so we can type
"n" to say No. Finally, it will ask whether we want
to expunge (delete) messages that were marked for deletion:
Since we do, again we can say "y" for Yes and we'll be back
at the UNIX prompt.