Tutorial Email Service
Tutorial Email Service
ADMINISTRATION
Activity Outcomes:
By the end of this hands-on session, you should be able to:
a) Setting up a Mail Server on Ubuntu Server 20.04
b) Understand how Email services works
Duration: 3 hours
3. Before we install postfix, we need to be sure that firewall is NOT distracting our jobs. For
learning purpose only, we will stop firewall for temporary use.
4. Check the network status for the server. At the command prompt, type service systemd-
networkd status and press Enter.
Is there any Standard Output and/or Standard Error displayed on the terminal screen? Why?
5. Update server. At the command prompt, type sudo apt-get update and press Enter.
Is there any Standard Output and/or Standard Error displayed on the terminal screen? Why?
6. Login as root. At the command prompt, type sudo -i and press Enter.
Is there any Standard Output and/or Standard Error displayed on the terminal screen? Why?
DFN 50303 OPEN SOURCE SERVER GUIDE 4: EMAIL SERVER
ADMINISTRATION
7. Allow in firewall, type sudo ufw allow postfix and press Enter.
8. Edit hostname file. At the command prompt, type nano /etc/hostname and press Enter. Type
the new mail domain as shown by the example below.
Input Replace: mailpkt.com
9. Next, add new host entry in hosts file. At the command prompt, type nano /etc/hosts and
press Enter.
Input Replace: 127.0.0.1 localhost
127.0.1.1 mailpkt.com
10.20.30.128 mailpkt.com
10. Install the postfix service. At the command prompt, type apt-get install postfix and press Enter.
11. A configuration dialogue will be prompted out and need to be configured to continue the
installation. Follow the steps below to continue the installation process of Postfix.
Configuration file can be edit thru /etc/postfix/main.cf or can be implement thru CLI using
command: dpkg-reconfigure postfix
DFN 50303 OPEN SOURCE SERVER GUIDE 4: EMAIL SERVER
ADMINISTRATION
System mail configuration type:
Input Replace: Internet Site
12. Reload postfix configuration in server. At the command prompt, type service postfix reload and
press Enter.
13. At the command prompt, type apt-get install dovecot-common in order to install dovecot SASL.
14. Continue to install package imap and pop3 in dovecot. At the command prompt, type apt-get
install dovecot-imapd dovecot-pop3d and press Enter.
15. Change directory location to /etc/dovecot/conf.d/. Create a backup file for 10-master.conf and
10-auth.conf before editing the main file.
16. Follow this step to configure dovecot. Open file 10-master.conf using editor and modify
the following parameters.
17. Follow this step to configure dovecot. Open file 10-auth.conf using editor and modify
the following parameters.
18. To reload the new file configuration in server, at the command prompt, type service dovecot
restart and press Enter.
19. Adding TWO (2) new user to the system. (hint: adduser)
DFN 50303 OPEN SOURCE SERVER GUIDE 4: EMAIL SERVER
ADMINISTRATION
20. Verify the email agent Mail Transfer Agent (MTA) are running successfully using command line.
Test SMTP-AUTH protocols by telnet the mail address domain.
21. This lab continues from LAMP server configuration. If you did not install LAMP package, please
install package apache, mysql and php before proceed this configuration.
22. Change directory to /var/www/html. Verify the location using command pwd at the terminal
prompt.
23. Install Squirrelmail service as our webmail. Download package Squirrelmail at the command
prompt.
Type: wget http://downloads.sourceforge.net/project/squirrelmail/stable/1.4.22/squirrelmail-
webmail-1.4.22.zip
24. Install unzip package to open the compress file. At the command prompt, type apt-get install
unzip.
DFN 50303 OPEN SOURCE SERVER GUIDE 4: EMAIL SERVER
ADMINISTRATION
25. Unzip the package using command unzip squirrelmail-webmail-1.4.22.zip.
27. Modify the permission and ownership folder mail to give access control for server to manage the
service. At the command prompt type:
chown –R www-data:www-data mail
chmod –R 755 mail
29. Edit the file using suitable editor. Change the parameters according to variable below:
30. To reload the new file configuration in server, at the command prompt, type service apache2
restart and press Enter.
31. Identify your location in terminal prompt. Current location should be /var/www/html/mail.
Configure the Squirrelmail by using the steps below. At the command prompt, type: ./configure
DFN 50303 OPEN SOURCE SERVER GUIDE 4: EMAIL SERVER
ADMINISTRATION
DFN 50303 OPEN SOURCE SERVER GUIDE 4: EMAIL SERVER
ADMINISTRATION
32. Next, restart the Apache services. At the command prompt, type service apache2 restart