• No results found

OPS535 Advanced Network Administration. SMTP Lab SIMPLE MAIL TRANSFER PROTOCOL

N/A
N/A
Protected

Academic year: 2021

Share "OPS535 Advanced Network Administration. SMTP Lab SIMPLE MAIL TRANSFER PROTOCOL"

Copied!
7
0
0

Loading.... (view fulltext now)

Full text

(1)

SMTP Lab

Reference: RFC821 – Simple Mail Transfer Protocol 

SIMPLE MAIL TRANSFER PROTOCOL

1. INTRODUCTION

The objective of Simple Mail Transfer Protocol (SMTP) is to transfer

mail reliably and efficiently.

SMTP is independent of the particular transmission subsystem and requires only a reliable ordered data stream channel. Appendices A, B, C, and D describe the use of SMTP with various transport services. A Glossary provides the definitions of terms as used in this

document.

An important feature of SMTP is its capability to relay mail across transport service environments. A transport service provides an interprocess communication environment (IPCE). An IPCE may cover one network, several networks, or a subset of a network. It is important to realize that transport systems (or IPCEs) are not one-to-one with networks. A process can communicate directly with another process through any mutually known IPCE. Mail is an application or use of interprocess communication. Mail can be communicated between

processes in different IPCEs by relaying through a process connected to two (or more) IPCEs. More specifically, mail can be relayed between hosts on different transport systems by a host on both transport systems. - RFC821 Objective: Explore the command/response transaction of the Simple Mail Transfer Protocol This lab consists of three parts. We will first check the version of the SMTP server and make sure that  the SMTP port is on. Secondly, we will establish an interactive SMTP session with the local SMTP  server and study some of the major SMTP commands. Lastly, we will use the interactive SMTP session  to send email to users and mailing list on the local machine.

(2)

Part I: SMTP Server

(1) Login to you NIS server (one of your virtual machine) as a regular user. The default SMTP server  installed by RHEL/CentOS is sendmail. Find out which version of the sendmail rpm is installed in your  system. Command: rpm ­q sendmail  Sendmail Version: _______________________________________________________ (2) SMTP server use one of the well­known ports. The port number used by SMTP is ________ (3) There are two places (or commands) you can check to see whether a SMTP server is running on  your system. The 1st one is the output of the “netstat ­a” command. Look for the SMTP port number  under the “Local Address” column and record the line(s) that contain the SMTP port : (a) Command: netstat ­a | grep smtp Output: ________________________________________________________________________ (b) Command: netstat ­an | grep 25 Output: ________________________________________________________________________ (4) The other place is the output of the “ps ­ef | grep sendmail” command.  Command: ps ­ef | grep sendmail  Output: ________________________________________________________________________ _________________________________________________________________________ (Note: You need a different command if the system is running other SMTP server.)

(3)

Part II: SMTP commands

(5) Login as a  regular user and execute the commands under the “Command” column and record the  output under the “Response” column. Do not proceed if the first command does not establish a  connection to port 25 on the local host. Command Response  telnet localhost 25 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. 220 localhost.localdomain ESMTP ... HELO domain.com EHLO domain.com NOOP RSET VERB EXPN ops535m VRFY toronto VRFY nobody HELP QUIT (6) “su” to “root” and backup the file “/etc/mail/sendmail.cf” to “/etc/mail/sendmail.cf.org”. (7) While you are still “su” to “root”, edit the file “/etc/mail/sendmail.cf”, change the line: O PrivacyOptions=authwarnings,novrfy,noexpn,restrictqrun

(4)

(8) Save the changes and restart “sendmail” server. Command: service sendmail restart (9) Login as a regular user and execute the commands under the “Command” column and record the  output under the “Response” column. Command Response telnet localhost 25 HELO domain.com EXPN ops535m VRFY toronto VRFY postmaster EXPN postmaster VRFY mailer­daemon EXPN mailer­daemon VRFY manager VRFY somebody QUIT (10) “su” to “root”, backup the file “/etc/aliases” to “/etc/aliases.org” and execute the following  commands:

#  echo “ops535m: adm,uucp,ftp” >> /etc/aliases

# newaliases

(11) Record the output of the above commands:

___________________________________________________________________________ (12) Login as a regular user and execute the command under the “Command” column and record the  output under the “Response” column.

(5)

Command Response telnet localhost 25 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. 220 localhost.localdomain ESMTP Sendmail ... HELO domain.com EXPN ops535m

(may take a while to produce the output) VRFY ops535m

(may take a while to product the output) QUIT

(13) In the NIS Lab, you were ask to create user nis101and nis102. Look up the login name from your  /etc/passwd file and record them in the following table:

Login Name UID User Name

(The 5th field of a /etc/passwd record)

User 1 nis101 User 2 nis102 If the 5th field for nis101 is empty, use the command “chfn nis101” to set the Name[] field to “Alice”. Do the same for nis102 and set it to “Bob”   (14) “su” to “root” and execute the following commands:

# echo “smtp-lab: nis101,nis102” >> /etc/aliases # newaliases (15) Login as a regular user and execute the commands under the “Command” column and record the  output under the “Response” column. Command Response telnet localhost 25 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1).

(6)

Command Response HELO domain.com

EXPN smtp­lab

(may take a while to produce the output) VRFY smtp­lab

(may take a while to produce the output) QUIT (16) Compare the results from step 5, 9, 12 and 15 and comment on the results. ___________________________________________________________________________ ___________________________________________________________________________ ___________________________________________________________________________ ___________________________________________________________________________ ___________________________________________________________________________ ___________________________________________________________________________ ___________________________________________________________________________ ___________________________________________________________________________ ___________________________________________________________________________ Question: Would you be able to telnet from your other virtual machines to port 25 on your NIS server  and repeat the task in step (9)? If not, what need to be changed on your NIS server to allow other  machines to connect to the SMTP server on your NIS server? 

(7)

Part III – Sending emails using the SMTP commands

(17) Login as a a regular user and connect to the local SMTP server. Use the information in the  following table to send email to nis101, nis102, postmaster, ftp, ops535m and smtp­lab.

From To Message Final Destination of the Message

ws.podx.ca nis101 Message for nis101  Test message 1.

ws.podx.ca nis102 Message for nis102  Test message 2.

ws.podx.ca smtp­lab Message for smtp­lab Test message 4

ws.podx.net postmaster Message for postmaster Test message 5

ws.podx.net ftp Message for ftp Test message 6

ws.podx.net ops535m Message for ops535m Test message 7

(18) Login as user1, and user2 and check out what messages they received:

User Login_name Message received

User 1 User 2 (19) Find out who received the messages addressed to postmaster (Test message 5), ftp (Test message  6) and ops535m (Test message 7) (20) Write up a  step­by­step procedure for following tasks: (a) add a new mail alias called “sysadmin” that includes user1, user2 and your login account  name.    (b) All email send to “postmaster” should also be send the new mailing list “sysadmin”.

References

Related documents