Professional Documents
Culture Documents
Remote Logging,
Electronic Mail,
and File Transfer
26.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
26-1 REMOTE LOGGING
26.2
Note
TELNET is a general-purpose
client/server application program.
26.3
Example of Telnet (Character mode)
26.5
Telnet Commands
26.6
SSH – Secure Shell
26.8
SSH Programs and Usages
26.9
26-2 ELECTRONIC MAIL
26.11
Note
26.12
Note
26.13
Typical Email Operation (from Wikipidia)
Could also be
IMAP4
26.16
Note
26.17
Note
26.18
Figure 26.12 Format of an e-mail
26.19
Figure 26.13 E-mail address
26.20
Figure 26.14 MIME (Multipurpose Internet Mail Extensions)
26.21
MIME
26.22
Figure 26.15 MIME header
26.23
Table 26.5 Data types and subtypes in MIME
26.24
Table 26.6 Content-transfer-encoding
26.25
Figure 26.16 SMTP (Simple Mail Transfer Protocol) range
POP3 or IMAP4
26.26
Figure 26.17 Commands and responses
26.27
Figure 26.18 Command format
26.28
Table 26.7 Commands
26.29
Table 26.8 Responses
26.30
Table 26.8 Responses (continued)
26.31
Example 26.3
Through this process, you can see why you cannot trust
the “sender” or any part of a received email, why email
spam is so easy to be generated.
26.32
Sample email sending using telnet
“telnet longwood.cs.ucf.edu 25”
C: HELO fake.domain
S: 250 Hello crepes.fr, pleased to meet you
C: MAIL FROM: <alice@crepes.fr>
S: 250 alice@crepes.fr... Sender ok
C: RCPT TO: <bob@gmail.com>
S: 250 bob@gmail.com ... Recipient ok
C: DATA
S: 354 Enter mail, end with "." on a line by itself
C: from: “fake man” <fake@fake.fake.fake>
C: to: “dr. who” <who@who>
C: subject: who am I?
C: Do you like ketchup?
C: How about pickles?
C: .
S: 250 Message accepted for delivery
C: QUIT
S: 221 longwood.cs.ucf.edu closing connection
Try SMTP interaction for yourself:
telnet servername 25
see 220 reply from server
enter HELO, MAIL FROM, RCPT TO, DATA, QUIT
commands
“mail from” the domain may need to be
existed
“rcpt to” the user needs to be existed
A mail server may or may not support “relay”
Enable you send email without using email user agent
What is “email open relay”?
An open mail relay is an SMTP server configured in
such a way that it allows anyone on the Internet to send
e-mail through it, not just mail destined to or originating
from known users.
This used to be the default configuration in many mail
servers and it was the way the Internet was initially set
up
But open mail relays have become unpopular due to
their exploitation by spammers. Many relays were
closed, or were placed on blacklists by other servers.
26.35
Email Server in Our Department
EECS email server: longwood.eecs.ucf.edu
Before this year, CS email server supports
relay from inside campus
You can use telnet to send manual email from
any computer inside campus network
Now it is more restrict, only support relay from
some fixed computers (such as eustis Unix
machine)
Eustis machine: eustis.eecs.ucf.edu
26.36
NOTES: Ethnical Issue on Manual Sending Email
26.37
Figure 26.19 POP3 (Post Office Protocol) and IMAP4 (Internet Mail Access
Protocol)
26.38
Figure 26.20 The exchange of commands and responses in POP3
26.39
POP3 protocol (tcp: 110)
S: +OK POP3 server ready
C: user bob
authorization phase S: +OK
C: pass hungry
client commands: S: +OK user successfully logged on
user: declare username
C: list
pass: password
S: 1 498 Length(bytes)
server responses S: 2 912
+OK S: .
-ERR C: retr 1
S: <message 1 contents>
transaction phase, client: S: .
list: list message numbers C: dele 1
C: retr 2
retr: retrieve message by
S: <message 1 contents>
number
S: .
dele: delete C: dele 2
quit C: quit
S: +OK POP3 server signing off
Telnet example
40
POP3 and IMAP4
26.41
Web-based Email
26.43
Note
26.44
Figure 26.21 FTP
26.45
Figure 26.22 Using the control connection
26.46
Figure 26.23 Using the data connection
26.47
Example 26.4 (continued)
26.48
Example 26.5
26.49
Example 26.5 (continued)
26.50
Dying of FTP
26.51