CS1102 Lab 9

This week's work

Below, there are 2 activities. Complete each activity. There is nothing to submit. After you have completed the activities, resume work on your personal home page (lab 6).

Re-read the worksheet for lab 7, if you need to remind yourself of how to use ssh to access cosmos.

Let me remind you one more time of UCC's Acceptable Usage Policy.

Activity 1

WARNING! Do not abuse what you learn in this activity. Do not send spam.

(cosmos) In this activity, you're going to send yourself an email. But not in the usual way! You're going to connect to the Computer Science mail server and you're going to type commands to pretend to be a mail agent.

From cosmos, let's first make the connection. We have to use telnet (not ssh) for this. On cosmos, type the following:

telnet csmail.ucc.ie 25

csmail.ucc.ie is the mail server and you're connecting to port 25.

You can now type commands. The following are the most common ones. (Don't worry, there's an example in a minute.)

Here's an example in which student dtab1 sends an email from cosmos.ucc.ie to me:

HELO cosmos.ucc.ie
MAIL FROM: dtab1@student.cs.ucc.ie
RCPT TO: d.bridge@cs.ucc.ie
DATA
Subject: An email sent using telnet
To: d.bridge@cs.ucc.ie
From: dtab1@student.cs.ucc.ie
This is the body of the email and is terminated by a blank line and then
a full stop on a separate line.
[blank line]
.
QUIT

Now it's your turn. Send yourself an email. Check that it arrives.

Activity 2

(cosmos) In this activity, you're going to pretend to be a web browser.

From cosmos, let's first make the connection. Type the following:

telnet www.cs.ucc.ie 80

www.cs.ucc.ie is the web server and you're connecting to port 80.

You can now type commands. You type "GET" or "HEAD", then a URL, then "HTTP/1.0". Then leave a blank line, and the server will respond. For example:

GET / HTTP/1.0
[blank line]

Experiment a bit: get a web page; get just its headers; get an image; get just its headers; try a URL that doesn't exist;...

To help you, here are some that do exist:

/
/dbridge.html
/legend.gif
/legend.jpg
/cs1/index.html

(There's something special about the last one: look at the output closely.)