Placeholder

WEB375 Lab 3 Configure a Sendmail Server in Linux

$15.00

Description

The purpose of this lab is to configure a sendmail server in Linux. Use the IP addresses that exist when you start Linux.
Virtual Machine Login Information for PLABFED01 and PLABFED02
Username: Student
Password: Password
Username: root
Password: Password
Lab Diagram
During your session, you will have access to the following lab configuration.
WINCONSOLE PLABFED01 PLABFED02
The Linux servers also connect to a private network. The IP address of PLABFED01 is 192.168.240.11 and the IP address of PLABFED01 is 192.168.240.12.
Connecting to Your Lab
In this module, you will be working on the following equipment to carry out the steps defined in each exercise.
WINCONSOLE (Management Server)
PLABFED01 (Linux Server)
PLABFED02 (Linux Server)
Each exercise will detail which console you are required to work on to carry out the steps.
To start, simply click on the named server from the device list (located on the left-hand side of the screen) and click the “Power on” button from the Tools bar. In some cases, the devices may power on automatically.
During the boot-up process, an activity indicator will be displayed in the Name tab.
Black—Powered off
Orange—Working on your request
Green—Ready to access
If the remote console is not displayed automatically in the main window (or pop-up), click the Connect icon located in the Tools bar to start your session.
If the remote console does not appear, please try the following option.
Switch between the HTML 5 and Java client versions in the Tools bar.
In the event this does not resolve your connectivity problems, please visit our Help and Support pages for additional resolution options.
sendmail Configuration Step by Step
General Information
We configure the sendmail server for our local LAN in this lab.
The sendmail daemon is configured from a directory of files in /etc/mail and a directory of configuration files in /usr/share/sendmail-cf. There are two basic configuration files.
/etc/mail/sendmail.cf The main sendmail configuration file
/etc/mail/sendmail.mc A macro that’s easier to edit, which can be used to generate a new sendmail.cf file
The configuration file that the sendmail server program reads is /etc/mail/sendmail.cf. But to change the configuration on the mail server, we modify the /etc/mail/sendmail.mc file using a text editor such as nano or vi. There are two ways to generate the sendmail.cf file: Start or restart the sendmail program or use the m4 command.
For this lab, we are using one Linux server, plabfed01, with IP address 192.168.240.11.
TASK A—Configure sendmail Server
Step 1: Use TigerVNC to log in to the plabfed01 system, open a terminal window, and switch to root (or you can use Putty to log in plabfed01 as root). Make sure the sendmail, mailx, and m4 packages are installed. Type the following commands.
#rpm –qa sendmail *
#rpm –qa mailx
#rpm –qa m4*
If they are installed, the commands’ outputs look like this.
Step 2: If it tells you that the packages are not installed, then you need to install them; otherwise, skip Step 2.
To install sendmail on the Fedora Linux system, type the following.
#yum –y install sendmail
In order to configure sendmail, make sure to install the sendmail -cf package. To install sendmail.cf, type the following.
#yum –y install sendmail -cf
Sometime you may use the m4 macro processor to create a new /etc/mail/sendmail.cf. To install m4, type the following.
#yum –y install m4
To install a text-based utility program for sending and receiving mail, type the following.
#yum –y install mailx
To install all of the above packages, type the following.
#yum –y install sendmail sendmail -cf mailx m4
Step 3: You need to add your domain in /etc/hosts file to have sendmail configured correctly. Use nano or vi to edit the /etc/hosts file; its content should look like this.
Step 4: To make the hostname permanent, modify /etc/sysconfig/network file using nano or vi as editor. The file’s content should look like this.
Step 5: To modify the hostname for the current session using the command hostname, type the following.
#hostname plabfed01.linuxlab.org
Step 6: Use nano or vi to add your domain entry in /etc/mail/local-host-names file, which is a list of hostnames sendmail is to accept as the local host name. Your file should look like this.
Step 7: To allow sendmail to accept network connections from any host, use nano or vi to modify the /etc/mail/sendmail.mc file and add the “dnl #” in front of line number 118. The string “dnl” is used for commenting.
Before:
After:
Note: DNL stands for “delete to new line.”
Step 8: To generate a new sendmail.cf file by using m4, type the following.
#m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
Step 9: Now that we are ready to start sendmail, type the following.
#systemctl start sendmail.service
Step 10: To check sendmail status, type the following.
#systemctl status sendmail.service
An active sendmail status looks like this.
Note: If sendmail fails starting, check for errors using the command journalctl –xn, fix any typos, and restart the service with command #systemctl restart Sendmail.service until sendmail starts successfully. Below is a sample of journalctl –xn command output without any error.
Step 11: To enable the sendmail server at boot time, type the following.
#systemctl enable sendmail.service
TASK B—Validation and Testing
Step 1: Check the sendmail to listen to all interfaces at the host using this command.
#netstat –an | grep :25 | grep tcp
Below is a sample output of the netstat command.
Step 2: Create two test users for testing purposes (that will send and receive mail), use the following commands to add user accounts and to change user’s password. Use the password Password for the testuser accounts. For the next several steps, my examples use user1 and user2 accounts. In the lab, you use testuser1 and testuser2 accounts.
#useradd testuser1
#useradd testuser2
#passwd testuser1
#passwd testuser2
Below are examples; I used user1 and user2 accounts (yours are a little bit different).
Step 3: Log in as the testuser1 and try to send mail using the mail command (tou can switch from root to testuser1).
Here are some examples.
Note:
You can switch from root to testuser1 using su—testuser1. To exit from testuser1, type exit to get back to root.
When using mailx, to terminate the text message, type . (dot), then hit the Enter key.
Step 4: To see whether the mail was sent correctly, use journalctl –xn to display messages.
Step 5: To check whether mail is delivered to testuser2, log in as the testuser2 and try to read mail using the mail command (again, you can switch from root to testuser2).
For example, see below.
Note:
If there is more than one message, type the message number and hit the Enter key to read.
To exit mailx, type q, then hit Enter.
TASK C—Lab Report Preparation
Step 1: Be sure you’re in the root account. Clear the screen, type the command #cat /etc/hosts to display its contents, and capture the Linux desktop, then save this image to your Lab Report document in the space allocated for the /etc/hosts file.
Step 2: Be sure you’re in the root account. Clear the screen and type the command #systemctl status sendmail.service to display the sendmail daemon status and capture the Linux desktop, then save this image to your Lab Report document in the space allocated for the #systemctl status sendmail.service command.
Step 3: Be sure you’re in the root account. Clear the screen and use the command #tail -4 /etc/passwd file to display its last four lines and capture the Linux desktop, then save this image to your Lab Report document in the space allocated for the #tail -4 /etc/passwd command.
Step 4: Switch to testuser1. Use the mail command to send the message “Hello!!! My name is ‘your first name’” (include your real first name) to testuser2. Capture the Linux desktop and save this image to your Lab Report document in the space allocated for sending mail to testuser2.
Step 5: Switch to testuser2. Use the mail command to read the message from testuser1. Capture the Linux desktop and save this image to your Lab Report document in the space allocated for read mail from testuser1.
This concludes Lab 3.
SCREENSHOTS
SOLUTION
PAYMENT
The solution includes a zip document.
Attachments [Move over files to preview content of those files]
WEB375_Lab_3.zip (2.02 MB)
Screenshots
Web375_Lab3_SendMail_Message.png
Web375_Lab3_SendServiceStatus.png
WEB375_Wk3_Report.docx
Price: $15
Buy Now
Checkout
Added to cart
Buy More Save More
Buy at least TWO items & save up to 30% OFF your ENTIRE order!
Rack up instant rebates in your shopping cart. Simply add items to your cart, and see the savings add up.
Discounts will automatically be applied on eligible orders.
WEB375 Lab 3 Configure a Sendmail Server in Linux – $15.00
WEB375 Lab 4 Configure a vsftp Server in Linux – $15.00
WEB375 Lab 5 Configure HTTP Server in Linux – $15.00
WEB375 Lab 6 Configure a MySQL Server in Linux – $15.00
WEB375 Lab 7 Configure iptables in Linux – $15.00
Add to Cart
Checkout
Added to cart
You May Also Like:
WEB375 Lab 1 Basic Linux and System Admin Commands
WEB375 Lab 2 Configure a DNS Server in Linux
WEB375 Lab 4 Configure a vsftp Server in Linux
WEB375 Lab 5 Configure HTTP Server in Linux
WEB375 Lab 6 Configure a MySQL Server in Linux
WEB375 Lab 7 Configure iptables in Linux

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.