Changes

Jump to: navigation, search

OPS535-online-L5

2,210 bytes added, 15:51, 21 July 2023
m
Protected "OPS535-online-L5": OER transfer ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
[[Category:OPS535]][[Category:rchan]]
'''Draft - This lab is still under construction.'''
=Overview=
Postfix is a complete MTA (Mail Transport Agent) package which replaced Sendmail. Postfix uses several different programs to implement the MTA functionality. Postfix is considered to be more secure than Sendmail as it requires a separate user ID for running each module. Postfix uses plain text parameters and value names in its configuration files. The Postfix program plays a variety of roles:
* Understand and configure mail aliases and mailing list
* Configure and manage Postfix's outgoing mail queue
* Setup appends mail to files option in Postfix
= Pre-requisites =
** all your four VMs have network connectivity to each other via the ens224 network interfaces.
** your VMs have the proper FQDN which can be resolved by your authoritative DNS server(s).
* Install the nmap-ncat, tree, and mailx packages on your host (optinally, install it on your other VMs as well).
* Install postfix if it is not installed.
* Issue the command /usr/sbin/sendmail -bp and compare the output to the command mailq.
* Remove both "./defer/B/B75BF20A6D85" "./deferred/B/B75BF20A6D85" and run the mailq command again.
 
= Investigation 5: Appends mail to files =
The Postfix aliases file supports an option to append mail message addressed to a real user or virtual user to an external file. In this investigation, we are going to use a real email user named "rchan", and a virtual email user named "ops535" as the email recipients. The following are the steps to configure Postfix to append email addressed to these two email users to the file 'tmp/ops535.mail' and 'tmp/rchan.mail'.
* First, confirm that your system has the real user 'rchan' (replace with the real user name on your system) only:
<pre>
[instructor@pri-dns lab5]$ id rchan
uid=1002(rchan) gid=1002(rchan) groups=1002(rchan)
[instructor@pri-dns lab5]$ id ops535
id: ‘ops535’: no such user
</pre>
* Add the following two lines to the /etc/aliases files:
<pre>
rchan: "/tmp/ops535.mail"
ops535: "/tmp/rchan.mail"
</pre>
* Run the newaliases command to update the aliases database file.
* The above steps create a virtual email user (or mail alias) "ops535", and all the email messages addressed to "ops535" will be appended to the file "/tmp/ops535.mail".
* As a regular user on your VM2, create a file named "test.mesg" with the following contents:
<pre>
Postfix is a Mail Transport Agent (MTA),
supporting LDAP, SMTP AUTH (SASL), TLS
</pre>
* Run the following two commands to send the same message to both the real email user "rchan" and virtual email user "ops535":
<pre>
/usr/sbin/sendmail -v ops535 < test.mesg
/usr/sbin/sendmail -v rchan < test.mesg
</pre>
* Go to the /tmp directory, and search for the files named "ops535.mail", and "rchan.mail". [Hint: you have to look deeper into the /tmp directory]
* Get the locations (i.e. path names), owners, permission settings, and contents of the above two files for lab submission.
= Completing the Lab =
Please download the [https://raw.githubusercontent.com/rayfreeping/ops535/master/labs/labcheck5.bash check lab script named labcheck5.bash] to your VM2, run the script under the 'student' user with sudo privilege and capture the output to a file and named it as lab5_vm3.txt:
<pre>
[student@pri-dns labs]$ sudo bash labcheck5.bash > lab5_vm2.txt
</pre>
 
Upload the file "lab5_vm2.txt" to Blackboard by the posted lab5 due date.
= Review Questions =

Navigation menu