For example, if you use kmail to read your Math/CS e-mail, your incoming messages get moved to a file called ~/Mail/inbox.
If you want to look at your e-mail in its raw form, including all the technical details associated with each message, you first need to make a copy of your inbox. You will do this by executing a "cp" (copy) command in a terminal window. Here's how:
cp ~/Mail/inbox tempMailbox
in a terminal window.
cp /var/spool/mail/youraccountname tempMailbox
where "youraccountname" is your account name.
Once you have made a copy of your inbox in the file tempMailbox, you can take a look at how your e-mail appears in its raw form. Open tempMailbox using NEdit. Alternatively, you can type the command "more tempMailbox" in a terminal window. (The UNIX command "more" prints the contents of a file, one screen at a time. Hit the space bar to move forward a page, and hit b to move backward a page.)
If you use more or NEdit to look at tempMailbox, you will see that every message is preceded by a big mess of information about who sent the e-mail, when it arrived, which computers handled it along the way, etc. All this information is called the e-mail's "header." The header for a message always begins with a line that starts with the word "From" followed by a space character. Your e-mail program (kMail, mail, Mulberry, Outlook Express, etc.) recognizes when one message ends and the next message begins by looking for lines that begin with "From ".
To get started, use the program countlines.cpp. To run this program, compile it ("g++ -Wall -o countlines countlines.cpp") and then type "countlines < tempMailbox" at the UNIX prompt.
We will discuss this assignment in class on 1/10/01.
Have fun, start early, and keep in touch.