VIETNAM NATIONAL UNIVERSITY OF HCMC
INTERNATIONAL UNIVERSITY
INTERNSHIP REPORT
BY
NGUYEN LE CHANH DUY
BUILDING MAIL SERVER ON LINUX
FOR ENTERPRISE
Submitted to: School of Computer Science and Engineering
International University, VNU-HCM
August 2014
INTERNSHIP REPORT
by
Nguyen Le Chanh Duy
Submitted to: School of Computer Science and Engineering
International University, VNU-HCM
August 2014
Organization/Company: ATHENA
Address: 92 Nguyen Dinh Chieu street, Da Kao ward, district 1, Ho Chi Minh city,
Vietnam.
Phone number: 090 78 79 477-094 323 00 99-(08)38244041
Duration of the Internship: 8 weeks (16-06-2014 – 16-08-2014)
Supervisors during the Internship:
o Name: Mr. Vo Do Thang.
o Title: Director of ATHENA.
o Address: 92 Nguyen Dinh Chieu, Da Kao ward, district 1, HoChiMinh city,
Vietnam
o Email: Thangvo@athena.edu.vn
ii
ACKNOWLEDGMENTS
After 8 weeks of internship at ATHENA, i have completed my project ā€œBuilding mail
server on Linux for enterpriseā€ with the support from friends and instructor.
I want to thank ATHENA for providing me good conditions to complete my internship
project, especially, I want to thank Mr. Vo Do Thang who has instructed and supported
me during all the time of internship at ATHENA.
Moreover, I have learned new knowledge at ATHENA such as Linux server, Centos,
network, VPS…they will be helpful for my job in the future.
iii
TABLE OF CONTENTS
I. DESCRIPTION OF COMPANY/ORGANIZATION......................................................5
II. SUMMARY OF THE INTERNSHIP.............................................................................7
III. PLANNING ..................................................................................................................9
IV. INTERNSHIP ACTIVITIES & ACHIEVEMENTS...................................................11
A. Email Protocols..........................................................................................11
B. Email Structure..........................................................................................14
C. Mail Server on Linux for enterprise...........................................................16
D. System Requirement..................................................................................17
E. Start building the mail server.....................................................................17
V. INTERNSHIP ASSESSMENT.....................................................................................34
REFERENCES..................................................................................................................35
iv
DESCRIPTION OF COMPANY/ORGANIZATION
ATHENA is a center of education and training of IT fields. It was established in 2004.
This is the center in which many experienced IT engineers work and study in order to
contribute to the development of IT fields in Vietnam.
The major fields of ATHENA:
o ATHENA center focus deeply on education and training of system and network
security, network management and maintenance following the standard quality
of Microsoft, Cisco, Oracle, Linux LPI, CEH…Moreover, ATHENA center also
has the private program of education and training for some government
organizations.
o After 10 years, many trainees of ATHENA center do the job in IT fields for some
government organizations and also for the big companies.
o Besides education and training programs, ATHENA center also cooperate and
exchange technology with some universities such as university of technology,
university of information technology, natural and university of science…
The instructors of ATHENA:
v
o ATHENA instructors graduate from many big universities in Vietnam. They all
have to get international certificates such as MCSA, MCSE, CCNA, CCNP,
Security+, CEH, Microsoft Certified Trainer…in order to work at ATHENA.
o ATHENA instructors usually go abroad to be trained about the new technologies
and then they transmit those new technologies to the trainees.
vi
SUMMARY OF THE INTERNSHIP
After 3 years in HCMC International University, I have taken many courses of Network
Engineering so I decided to take internship at ATHENA. Because, ATHENA is a center
that specializes in network and system fields. At ATHENA, I take a project that requires
me to build a mail server on Linux for enterprise.
First, I have to get used to new Linux OS: Centos 6.5. Although, I approached another
Linux OS in coursers in university. I must learn how to control Centos with commands in
terminal.
Second, I must build on local host in order to get used to the configuration of mail
services. Two Linux virtual machines need to be installed (server and client) to test the
mail exchange.
Next, I must correct bugs by myself. I can look for documents, solutions…from internet
or from friends to solve the problems. If it still does not work, I must discuss with the
instructor to get the solutions or the instructions.
Finally, I must build a mail server on VPS. Here, I have to set up putty to access the VPS
in order to configure. My mission is to make the VPS become a Linux mail server that
can connect with yahoo mail and gmail. If it does not exchange mail with gmail or yahoo
vii
mail, I must fix bugs. My work is done if the VPS works correctly as the instructor
requires.
viii
PLANNING
Week 1:
o Seeing the instructor to get the project.
o Reading and understanding document.
o Asking question if necessary.
o Writing report.
Week 2:
o Reading and understanding Linux OS.
o Get used to Centos 6.5
o Writing report.
Week 3:
o Setting up VMware.
o Setting up Centos 6.5 on 2 virtual machines (server and client).
o Installing telnet, postfix and dovecot services on server.
o Writing report.
Week 4:
o Configuring network (Ethernet, hosts…).
o Configuring postfix and dovecot
o Testing telnet service.
o Writing report.
Week 5:
o Installing squirrelmail on server and thunderbird on client.
o Configuring squirrelmail and thunderbird.
o Sending mail between server and client via squirrelmail and thunderbird.
o Writing report.
Week 6:
o Having a VPS.
o Installing telnet, postfix and dovecot service on VPS.
o Installing squirrelmail on VPS and thunderbird on the laptop.
o Writing report.
Week 7:
ix
o Configuring postfix and dovecot.
o Configuring squirrelmail and thunderbird.
o Exchange mail with gmail and yahoo mail.
o Writing report.
Week 8:
o Fix errors.
o Exchange mail with gmail and yahoo mail again.
o Writing final report.
o Having a project presentation.
x
INTERNSHIP ACTIVITIES AND ACHIEVEMENTS
A/ Email Protocols:
Interactions between email servers and clients are governed by email protocols.
The three most common email protocols are POP, IMAP. Most email software
operates under one of these (and many products support more than one).
The Post Office Protocol (currently in version 3, hence POP3) allows email client
software to retrieve email from a remote server. The Internet Message Access
Protocol (now in version 4 or IMAP4) allows a local email client to access email
messages that reside on a remote server. The SMTP (Simple Mail Transfer
Protocol) protocol is used by the Mail Transfer Agent (MTA) to deliver your
email to the recipient's mail server
1. Post Office Protocol (POP):
POP is the older design, and hails from an era when intermittent connection via
modem (dial-up) was the norm. POP allows users to retrieve email when
connected, and then act on the retrieved messages without needing to stay "on-
line." This is an important benefit when connection charges are expensive.
The basic POP procedure is to retrieve all inbound messages for storage on the
client, delete them on server, and then disconnect. (The email server functions
like a mailbox at the Post Office -- a temporary holding area until mail gets to its
final destination, your computer.)
xi
Outbound mail is generated on the client, and held for transmission to the email
server until the next time the user's connection is active. After it's uploaded, the
server forwards the outgoing mail to other email servers, until it reaches its final
destination.
Most POP clients also provide an option to leave copies of email on the server. In
this case, messages are only removed from the server when greater than a certain
"age" or when they have been explicitly deleted on the client. It's the copies on
the client that are considered the "real" ones, however, with those left on the
server merely temporary backups.
2. Internet Access Message Protocol (IMAP):
IMAP is the newer protocol and oriented toward a "connected" mode of
operation. The standard IMAP procedure is to leave messages on the
server instead of retrieving copies, so email is only accessible when "on-
line."
IMAP is more suited to a world of always-on connections, particularly the
fast connections offered by broadband mechanisms. Having to be
connected to read your email is a trivial obstacle when the connection is
always available. (It's a little like leaving your messages at the Post
Office, and going there every time you want to read them. That might be
difficult in the physical world, but it's easy in the virtual one.)
xii
Because messages remain on the server, until explicitly deleted by the
user, they can be accessed by multiple client computers -- an important
advantage when you use more than one computer to check your email.
IMAP does not preclude keeping copies on the client, but, in an inversion
of the way POP works, it's the server's copies that are considered the "real"
ones. That offers an important security benefit -- you won't lose your
email if, for some reason, your client computer's storage media fails.
IMAP has other advantages over POP (detailed in the links provided
below). It is the standard we recommend if you can't use MAPI.
3. The Simple Mail Transfer Protocol (SMTP):
At the risk of overloading you with information, you should know that
strictly speaking it's only the incoming mail that is handled by a POP or
IMAP protocol. Outgoing mail for both POP and IMAP clients uses the
Simple Mail Transfer Protocol (SMTP).
When you set up a POP or IMAP email account on email client software,
you must specify the name of the (POP or IMAP) mail server computer for
incoming mail. You must also specify the name of the (SMTP) server
computer for outgoing mail. These names are typically in the same form
xiii
as Web addresses (e.g., "imap.med.miami.edu"). Depending on the client,
there may also be specifications for email directories and searching.
B/ Email Structure:
o Mail User Agent (MUA): is a program that allows you to receive and
send e-mail messages; it's usually just called an e-mail program. To use an
MUA such as Eudora or Microsoft Outlook, you install the MUA program
on your computer and then use it to download and store e-mail messages
to your computer; it will also allow you to read or write messages offline.
Web-based MUAs, such as Hotmail and Yahoo, store messages on their
own mail servers and allow access to them through a Web page. An MUA
is sometimes called an e-mail agent or an e-mail client.
xiv
o Mail Transport Agent (MTA): is an application that receives incoming
e-mail from local users (people within the same domain) and remote
senders and forwards outgoing e-mail for delivery. A computer dedicated
to running such applications is also called a mail server. Microsoft
Exchange, qmail, Exim and sendmail are among the more common mail
server programs.
o Mail Delivery Agent (MDA): is the software and other systems that are
responsible for sending and receiving mail between systems. That is the
ONLY things MTAs do: they send and receive messages between systems.
MTAs use the SMTP (Simple Mail Transfer Protocol) to send and receive
messages.
o Mail Submission Agent (MSA): is a computer program or software
agent that receives electronic mail messages from a mail user
agent (MUA) and cooperates with a mail transfer agent (MTA) for
delivery of the mail. It uses a variant of the Simple Mail Transfer
Protocol (SMTP), as specified in RFC 6409.
o Mail Access Agent/ Mail Retrieval Agent (MAA/MRA): is
a computer application that retrieves or fetches e-mail from a remote mail
server and works with a mail delivery agent to deliver mail to a local or
remote email mailbox. MRAs may be external applications by themselves
xv
or be built into a bigger application like an MUA. Significant examples of
standalone MRAs include fetchmail, getmail and retchmail.
C/ Mail Server (Postfix, Dovecot…) for Enterprise on Linux:
This is a Linux mail server for small and medium companies/enterprises with low
investment. However, it is stable and effective.
o Postfix is Wietse Venema's mail server that started life at IBM research as
an alternative to the widely-used Sendmail program. Postfix attempts to be
fast, easy to administer, and secure. The outside has a definite Sendmail-
ish flavor, but the inside is completely different.
o Dovecot is an open source IMAP and POP3 email server for Linux/UNIX-
like systems, written with security primarily in mind. Dovecot is an
excellent choice for both small and large installations. It's fast, simple to
set up, requires no special administration and it uses very little memory.
xvi
Thunderbird, Outlook,
Squirrelmail…
POSTFIX
Authenticate
DOVECOT
MailStore
MailBox
(File
Linux)
PROCMAIL
SpamAssanssin
o SquirrelMail is a standards-based webmail package written in PHP. It
includes built-in pure PHP support for the IMAP and SMTP protocols, and
all pages render in pure HTML 4.0 (with no JavaScript required) for
maximum compatibility across browsers. It has very few requirements and
is very easy to configure and install. SquirrelMail has all the functionality
you would want from an email client, including strong MIME support,
address books, and folder manipulation.
D/ System Requirement:
o The linux system requires normal hardware support, a linux server with medium
configuration can work stably and effectively. For example, a mail server with
configuration: CPU Pentium III 600MHZ, RAM 256MB, HDD 40GB can serve
from 300 to 400 users.
o Soft wares are required to install on a Linux mail server:
• Operating System: Centos 6.5 running with command line.
• SMTP Server: Postfix 2.3.3
• POP3/IMAP Server: 1.0.7
• Web Mail: SquirrelMail 1.4.8
• Web Server: Apache 2.2.3
Depending on the requirements, all the soft wares can be updated to the
newer version.
E/ Start building the mail server:
I/ Starting with local host:
1. Configure static IP address:
Server:
xvii
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=static
IPADDR=192.168.1.245
NETMASK=255.255.255.0
GATEWAY=192.168.1.254
Client:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=static
IPADDR=192.168.1.240
NETMASK=255.255.255.0
GATEWAY=192.168.1.250
2. Configure hostname:
# vi /etc/hosts
127.0.0.1 mail.athena.lab
129.168.1.245 mail.athena.lab
# vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=mail.athena.lab
3. Configure DNS:
The DNS is a hierarchical distributed naming system for computers,
services, or any resource connected to the Internet or a private network. It
associates various information with domain names assigned to each of the
participating entities. Most prominently, it translates easily
memorized domain names to the numerical IP addresses needed for the
purpose of locating computer services and devices worldwide. The
Domain Name System is an essential component of the functionality of
the Internet.
Install packages with command:
xviii
# rpm –ivh <packages>:
bind-9.8.2-0.17.rc1.el6_4.6.i686.rpm
bind-libs-9.8.2-0.17.rc1.el6_4.6.i686.rpm
bind-utils-9.8.2-0.17.rc1.el6_4.6.i686.rpm
Create file: /etc/named.conf
acl mynet {
192.168.1.0/24
};
options {
allow-transfer {none;};
directoryā€ /var/namedā€;
query-source port 53;
query-source-v6 port 53;
dump-file ā€œvar/named/data/cache_dump.dbā€;
statistics-file ā€œvar/named/data/named_stats.txtā€;
mamstatistics-file
ā€œvar/named/data/named_mem_stats.txtā€;
notify yes;
};
zone ā€œ.ā€ IN {
type hint;
file ā€œnamed.rootā€;
};
zone ā€œathena.labā€ IN {
type master;
file ā€œathena.lab.dbā€;
allow-query {mynet;};
};
zone ā€œ1.168.192.in-addr.arpaā€ {
type master;
file ā€œ1.168.192.in-addr.arpa.dbā€;
allow-query {mynet;};
};
Create file: /var/named/named.root by downloading via internet with the
command: # wget http://www.internic.net/zones/named.root
Create file: /var/named/athena.lab
$TTL 86400
@ IN S0A dns.athena.lab. root. {
46 ; serial
3H ; refresh
xix
15M ; retry
1W ; expire
1D ; ttl
}
IN NS dns.athena.lab.
dns IN A 192.168.1.245
mail IN A 192.168.1.245
Create file: /var/named/1.168.192.in-addr.arpa.db:
$TTL 86400
@ IN S0A dns.athena.lab. root. {
46 ; serial
10800 ; refresh
900 ; retry
604800 ; expire
86400 ; ttl
}
@ IN NS dns.athena.lab.
1 IN PTR mail.athena.lab.
Restart named daemon:
# service named restart
Shut down firewall:
# service iptables stop
4. Install and configure Postfix service:
Install Postfix service with command:
# yum install postfix
Configure Postfix:
# vi /etc/postfix/main.cf
## Line 75 – Uncomment
myhostname = mail.athena.lab
## Line 83 – Uncomment
mydomain = athena.lab
## Line 99 - Uncomment
xx
myorigin = $mydomain
## Line 116
inet_interfaces = all
## Line 164 –Add $mycomain
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
## Line 250 - Uncomment
mynetworks_style = subnet
## Line 264 – Uncomment, Add networks
mynetworks = 192.168.1.0/24, 127.0.0.0/8
## Line 419 – Uncomment
home_mailbox = Maildir/
Restart postfix:
# service postfix restart
# chkconfig postfix on
# netstat –nat | grep 25
Install Telnet service:
# yum install telnet telnet-server –y
Create users:
# useradd user1
# passwd user1
# useradd user2
# passwd user2
Telnet to server:
# telnet mail.athena.lab 25
Trying ::1…
Connected to mail.athena.lab.
Escape character is ā€˜^]’.
220 mail.athena.lab ESMTP Postfix
Send mail from user1 to user2:
mail from: user1@athena.lab
250 2.1.0 OK
rcpt to: user2@athena.lab
250 2.1.5 OK
xxi
data
354 End data with <CR><LF>.<CR><LF>
Testing
.
250 2.0.0 OK: queued as 1247AF434A
quit
221 2.0.0 Bye
Connection closed by foreign host.
5. Install and configure Dovecot service:
Install Dovecot service with command:
# yum install dovecot
Configure dovecot:
# vi /etc/dovecot/dovecot.conf
## Line 20 – Uncomment
protocols = imap pop3 lmtp
## Line 26 – Uncomment, remove ā€œ,::ā€
listen = *
# vi /etc/dovecot/conf.d/10-auth.conf
## Line 9 – Uncomment
disable_plaintext_auth = no
## Dòng 97 – Uncomment
auth_mechanisms = plain login
# vi /etc/dovecot/conf.d/10-mail.conf
## Line 24 – Uncomment
mail_location = maildir:~/Maildir
# vi /etc/dovecot/conf.d/10-master.conf
## Line 19 – Uncomment
port = 143
## Line 22 – Uncomment
port = 993
## Line 40 – Uncomment
port = 110
## Line 43 – Uncomment
xxii
port = 995
## Line 82 – Uncomment
mode = 0600
## Line 83 – Uncomment, sį»­a lįŗ”i thĆ nh:
user = postfix
## Line 84 – Uncomment, sį»­a lįŗ”i thĆ nh:
group = postfix
Restart dovecot and postfix service:
# service dovecot restart
# service postfix restart
6. Install and configure Mozilla Thunderbird:
Install thunderbird with command:
# yum install thunderbird
Create email account with thunderbird:
o Step 1: Access Mozilla Thunderbird
xxiii
o Step 2: Create a new account > Email
o Step 3: Yourname: user1 > Email address: user1@athena.lab > Password:
1234 > Remember password
o Step 4: Continue > Manual config
o Step 5: Incoming: 192.168.1.245 (IP server) > Outgoing: 192.168.1.245
o Step 6: Re-test > confirm security > done
Create email account for user2 as we do for user1
Restart postfix, dovecot service, then exchange mail between user1 and
user2 by using Mozilla Thunderbird.
7. Install and configure Squirrelmail:
Install squirrelmail with commands:
# rpm –Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-
8.noarch.rpm
# yum install squirrelmail
Configure squirrelmail:
# vi /etc/share/sbin/squirrelmail/config/conf.pl
o Step 1: Server Settings > Domain: athena.lab
o Step 2: Sendmail or SMTP > SMTP
o Step 3: R > D > dovecot
o Step 4: S to save > Q to quit
Restart postfix, dovecot and httpd service.
Exchange mail between user1 and user2 by accessing
http://<ipaddress>/webmail or http://<domain-name>/webmail
II/ Building mail server on VPS:
1. Install Putty to access the VPS
2. Register domain name:
xxiv
xxv
o Step 1: Access www.dot.tk to get a free domain name: athenacd.tk
o Step 2: Use DNS > Dot TK DNS Service
o Step 3: Host name: www.athenacd.tk > IP address: 14.0.31.168
Host name: athenacd.tk > IP address: 14.0.31.168
o Step 4: maintain this domain name in 3 months
o Step 5: Choose google account to manage this domain name
o Step 5: Sign in my.dot.tk > Go to domain > Modify
o Step 6: Add 2 records > Save changes
A Record > mail.athenacd.tk > 14.0.31.168
MX Record > athenacd.tk > mail.athenacd.tk
3. Configure DNS:
Install packages with command: rpm –ivh <packages>:
bind-9.8.2-0.17.rc1.el6_4.6.i686.rpm
bind-libs-9.8.2-0.17.rc1.el6_4.6.i686.rpm
bind-utils-9.8.2-0.17.rc1.el6_4.6.i686.rpm
Create file: /etc/named.conf
acl mynet {
14.0.31.160/27
};
options {
allow-transfer {none;};
directoryā€ /var/namedā€;
query-source port 53;
xxvi
query-source-v6 port 53;
dump-file ā€œvar/named/data/cache_dump.dbā€;
statistics-file ā€œvar/named/data/named_stats.txtā€;
mamstatistics-file
ā€œvar/named/data/named_mem_stats.txtā€;
notify yes;
};
zone ā€œ.ā€ IN {
type hint;
file ā€œnamed.rootā€;
};
zone ā€œathenacd.tkā€ IN{
type master;
file ā€œathenacd.tk.dbā€;
allow-query {mynet;};
};
zone ā€œ31.0.14.in-addr.arpaā€ {
type master;
file ā€œ31.0.14.in-addr.arpa.dbā€;
allow-query {mynet;};
};
Create file: /var/named/named.root by downloading via internet with the
command: # wget http://www.internic.net/zones/named.root
Create file: /var/named/athena.tk
$TTL 86400
@ IN S0A dns.athenacd.tk. root. {
46 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ; ttl
}
IN NS dns.athenacd.tk.
IN MX 10 mail.athenacd.tk.
dns IN A 192.168.1.245
mail IN A 192.168.1.245
www IN CNAME athenacd.tk.
ftp IN CNAME athenacd.tk.
Create file: /var/named/31.0.14.in-addr.arpa.db:
xxvii
$TTL 86400
@ IN S0A dns.athenacd.tk. root. {
46 ; serial
10800 ; refresh
900 ; retry
604800 ; expire
86400 ; ttl
}
IN NS dns.athenacd.tk.
1 IN PTR dns.athenacd.tk.
2 IN PTR mail.athenacd.tk.
2. Install and configure Postfix service:
Install Postfix service with command:
# yum install postfix
Configure Postfix:
# vi /etc/postfix/main.cf
## Line 70 – Uncomment
myhostname = mail.athenacd.tk
## Line 83 – Uncomment
mydomain = athenacd.tk
## Line 99 - Uncomment
myorigin = $mydomain
## Line 116
inet_interfaces = all
## Line 164 –Add $mycomain
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
## Line 250 - Uncomment
mynetworks_style = subnet
## Line 264 – Uncomment, Add networks
mynetworks = 14.0.31.160/27, 127.0.0.0/8
## Line 419 – Uncomment
home_mailbox = Maildir/
xxviii
Restart postfix:
# service postfix restart
# chkconfig postfix on
# netstat –nat | grep 25
Install Telnet service:
# yum install telnet telnet-server –y
Create users:
# useradd duy
# passwd duy
# useradd tien
# passwd tien
Telnet to server:
# telnet mail.athena.lab 25
Trying ::1…
Connected to mail.athena.lab.
Escape character is ā€˜^]’.
220 mail.athena.lab ESMTP Postfix
Send mail from duy to tien:
mail from: duy@athenacd.tk
250 2.1.0 OK
rcpt to: tien@athenacd.tk
250 2.1.5 OK
data
354 End data with <CR><LF>.<CR><LF>
Testing
.
250 2.0.0 OK: queued as 1247AF434A
quit
221 2.0.0 Bye
Connection closed by foreign host.
Shut down sendmail service and change from MTA to Postfix:
xxix
# /etc/rc.d/init.d/sendmail stop
# chkconfig sendmail off
# alternatives –config mta
# service postfix restart
3. Install and configure Dovecot service:
Install Dovecot service with command:
# yum install dovecot
Configure dovecot:
# vi /etc/dovecot.conf
## Line 20 – Uncomment
protocols = imap pop3 lmtp
## Line 26 – Uncomment, remove ā€œ,::ā€
listen = *
## Line 211 – Uncomment and add:
mail_location = maildir:~/Maildir
Restart dovecot and postfix service:
# service dovecot restart
# service postfix restart
4. Install and configure Squirrelmail:
Install squirrelmail with commands:
xxx
# rpm –Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-
8.noarch.rpm
# yum install squirrelmail
Configure squirrelmail:
# vi /etc/share/sbin/squirrelmail/config/conf.pl
o Step 1: Server Settings > Domain: athena.lab
o Step 2: Sendmail or SMTP > SMTP
o Step 3: R > D > dovecot
o Step 4: S to save > Q to quit
# vi /etc/httpd/conf/httpd.conf
<VirtualHost*:80>
ServerName mail.athenacd.tk
DocumentRoot /usr/share/squirrelmail
</VirtualHost>
xxxi
Restart postfix, dovecot and httpd service:
# service named restart
# service postfix restart
# service httpd restart
# service dovecot restart
Exchange mail between user1 and user2 by accessing
http://<ipaddress>/webmail or http://<domain-name>/webmail
Exchange mail between users and yahoo mail, google mail by accessing
http://<ipaddress>/webmail or http://<domain-name>/webmail
xxxii
xxxiii
INTERNSHIP ASSESSMENT
During the internship period, I have gained new knowledge and many experiences from
my project. Firstly, I must take time to research about the Centos in order to understand
how it works. After researching, I recognized the differences between Centos and the
other OS, moreover, I have learned the way to control the Centos by using commands in
terminal. Secondly, I had chance to work with a real server, thanks to that, I knew how to
make it run correctly and fix bugs when problems happen. Next, by learning, I have
understood deeply about the mail protocols, dns, network configuration, network
problems… All of the experiences and knowledge that I have gained from the internship
will be helpful for my future career, because now I am taking the courses of Network
Engineering in university and in the future, as an network engineer, I will face with many
problems of systems, network, servers… However, during the internship period, I found
myself lack of basic knowledge, so beside researching via internet, I also re-learned
myself some courses that I have taken before.
xxxiv
REFERENCES
athena.edu.vn/
it.med.miami.edu/x1111.xml
searchnetworking.techtarget.com/definition/mail-user-agent
searchsoa.techtarget.com/definition/mail-server
en.wikipedia.org/wiki/Mail_delivery_agent
en.wikipedia.org/wiki/Mail_submission_agent
en.wikipedia.org/wiki/Mail_retrieval_agent
en.wikipedia.org/wiki/Domain_Name_System
www.postfix.org/
www.dovecot.org/
squirrelmail.org/about/
xxxv
36

More Related Content

DOCX
Iu report
DOCX
Iu report
PDF
BÔo cÔo thực tập windows server 2008 gia dinh ly huutai
Ā 
DOC
BĆ”o cĆ”o tốt nghiệp Thį»±c trįŗ”ng kinh doanh bįŗ£o hiểm xe cĘ” giį»›i tįŗ”i CĆ“ng ty bįŗ£o ...
PDF
BĆ”o cĆ”o tiįŗæn độ thį»±c tįŗ­p hĆ ng tuįŗ§n tįŗ”i trung tĆ¢m athena tuan 4
PDF
Internship Report - Information Technology : Information Technology Departmen...
DOCX
ChuyĆŖn đề HoĆ n Thiện Hoįŗ”t Động Facebook Marketing Tįŗ”i CĆ“ng Ty Cổ Phįŗ§n Quįŗ£ng C...
PDF
Outline for internship report - BÔo cÔo thực tập Tiếng Anh
Iu report
Iu report
BÔo cÔo thực tập windows server 2008 gia dinh ly huutai
Ā 
BĆ”o cĆ”o tốt nghiệp Thį»±c trįŗ”ng kinh doanh bįŗ£o hiểm xe cĘ” giį»›i tįŗ”i CĆ“ng ty bįŗ£o ...
BĆ”o cĆ”o tiįŗæn độ thį»±c tįŗ­p hĆ ng tuįŗ§n tįŗ”i trung tĆ¢m athena tuan 4
Internship Report - Information Technology : Information Technology Departmen...
ChuyĆŖn đề HoĆ n Thiện Hoįŗ”t Động Facebook Marketing Tįŗ”i CĆ“ng Ty Cổ Phįŗ§n Quįŗ£ng C...
Outline for internship report - BÔo cÔo thực tập Tiếng Anh

What's hot (20)

DOCX
BĆ”o CĆ”o Đồ Ɓn Phįŗ§n Mềm Quįŗ£n lý chuį»—i bįŗ„t động sįŗ£n FULL
DOCX
BĆ”o cĆ”o thį»±c tįŗ­p_ NghiĆŖn cứu vĆ  triển khai hệ thống isa server 2006
DOCX
Khóa luįŗ­n: PhĆ¢n tĆ­ch rį»§i ro trong thį»§ tỄc xuįŗ„t khįŗ©u, HAY, 9 ĐIỂM
DOCX
HoĆ n Thiện Hoįŗ”t Động Content Marketing ThĆ“ng Qua KĆŖnh Trį»±c Tuyįŗæn Cį»§a CĆ“ng Ty ...
PPTX
rapport de stage
DOCX
BÔo cÔo thực tập Marketing Xúc Tiến TẔi Nhà Hàng Buffet.docx
DOC
BĆ”o cĆ”o tốt nghiệp ĐƔnh giĆ” sį»± hĆ i lòng cį»§a khĆ”ch hĆ ng về dịch vỄ ngĆ¢n hĆ ng đ...
DOCX
Giįŗ£i phĆ”p nĆ¢ng cao hiệu quįŗ£ Content Marketing trĆŖn Website cį»§a dį»± Ć”n Rightnow...
PPTX
BĆ”o cĆ”o bĆ i tįŗ­p lį»›n Website tin tức bįŗ±ng PHP
DOCX
Đề TĆ i Khóa luįŗ­n 2024 Mį»™t số giįŗ£i phĆ”p nhįŗ±m hoĆ n thiện cĆ”c cĆ“ng cỄ marketing ...
PDF
RAPPORT DE STAGE SSI - Copie.pdf
PDF
Report_on_Industrial Placement
DOCX
[Athena]Nghiên Cứu Và Xây Dựng Website Bằng Wordpress
DOCX
Giįŗ£i phĆ”p nĆ¢ng cao hoįŗ”t động Content Marketing trĆŖn Fanpage cį»§a cĆ“ng ty cổ ph...
PDF
INTERNSHIP REPORT
DOCX
Đề Tài Khóa luận 2024 Thực trẔng cÓng tÔc Marketing tẔi CÓng ty TNHH ThưƔng m...
DOC
Computer science and information technology
DOCX
Khóa luįŗ­n Sį»± hĆ i lòng cį»§a hį»c viĆŖn về chįŗ„t lượng dịch vỄ đƠo tįŗ”o khóa hį»c
PPTX
Hệ thống quįŗ£n lý đặt tour du lịch
PDF
Guide d'installation d'un cyber cafe
BĆ”o CĆ”o Đồ Ɓn Phįŗ§n Mềm Quįŗ£n lý chuį»—i bįŗ„t động sįŗ£n FULL
BĆ”o cĆ”o thį»±c tįŗ­p_ NghiĆŖn cứu vĆ  triển khai hệ thống isa server 2006
Khóa luįŗ­n: PhĆ¢n tĆ­ch rį»§i ro trong thį»§ tỄc xuįŗ„t khįŗ©u, HAY, 9 ĐIỂM
HoĆ n Thiện Hoįŗ”t Động Content Marketing ThĆ“ng Qua KĆŖnh Trį»±c Tuyįŗæn Cį»§a CĆ“ng Ty ...
rapport de stage
BÔo cÔo thực tập Marketing Xúc Tiến TẔi Nhà Hàng Buffet.docx
BĆ”o cĆ”o tốt nghiệp ĐƔnh giĆ” sį»± hĆ i lòng cį»§a khĆ”ch hĆ ng về dịch vỄ ngĆ¢n hĆ ng đ...
Giįŗ£i phĆ”p nĆ¢ng cao hiệu quįŗ£ Content Marketing trĆŖn Website cį»§a dį»± Ć”n Rightnow...
BĆ”o cĆ”o bĆ i tįŗ­p lį»›n Website tin tức bįŗ±ng PHP
Đề TĆ i Khóa luįŗ­n 2024 Mį»™t số giįŗ£i phĆ”p nhįŗ±m hoĆ n thiện cĆ”c cĆ“ng cỄ marketing ...
RAPPORT DE STAGE SSI - Copie.pdf
Report_on_Industrial Placement
[Athena]Nghiên Cứu Và Xây Dựng Website Bằng Wordpress
Giįŗ£i phĆ”p nĆ¢ng cao hoįŗ”t động Content Marketing trĆŖn Fanpage cį»§a cĆ“ng ty cổ ph...
INTERNSHIP REPORT
Đề Tài Khóa luận 2024 Thực trẔng cÓng tÔc Marketing tẔi CÓng ty TNHH ThưƔng m...
Computer science and information technology
Khóa luįŗ­n Sį»± hĆ i lòng cį»§a hį»c viĆŖn về chįŗ„t lượng dịch vỄ đƠo tįŗ”o khóa hį»c
Hệ thống quįŗ£n lý đặt tour du lịch
Guide d'installation d'un cyber cafe
Ad

Viewers also liked (20)

PPTX
Mail server on linux
PDF
FreeBSD ports
PDF
Introduction to FreeBSD 7.0
Ā 
PDF
Dovecot
Ā 
PPT
PPT
FreeBSD - LinuxExpo
PDF
FreeBSD Document Project
PDF
Dovecot & Postfix ćƒćƒ¼ć‚øćƒ§ćƒ³ć‚¢ćƒƒćƒ—å‹•å‘ 201506-201511
PDF
66_pfSenseTutorial
PPTX
Mail server using Linux(Ubuntu)
PDF
FreeBSD: Dev to Prod
PDF
Postfix
PDF
Livro pfsense 2.0 pt br
PDF
Squid proxy-configuration-guide
PPT
Introduction To SELinux
PDF
SELinux basics
DOCX
Mail server report
PPTX
Mail server configuration
PDF
Tola.leng mail server (sq_mail &amp; rcmail)_q5_
PPS
Squid
Mail server on linux
FreeBSD ports
Introduction to FreeBSD 7.0
Ā 
Dovecot
Ā 
FreeBSD - LinuxExpo
FreeBSD Document Project
Dovecot & Postfix ćƒćƒ¼ć‚øćƒ§ćƒ³ć‚¢ćƒƒćƒ—å‹•å‘ 201506-201511
66_pfSenseTutorial
Mail server using Linux(Ubuntu)
FreeBSD: Dev to Prod
Postfix
Livro pfsense 2.0 pt br
Squid proxy-configuration-guide
Introduction To SELinux
SELinux basics
Mail server report
Mail server configuration
Tola.leng mail server (sq_mail &amp; rcmail)_q5_
Squid
Ad

Similar to finalreport1182014 (20)

DOCX
Case study on Pamplona National High School Local Area Network
PDF
Lesson 6 fundamentals of internet and java programming (140 kb)
DOCX
Protocols and its standards
PDF
Web Services
PDF
Lesson 17 fundamental of internet (88 kb)
PPTX
Point of preference (POP)
DOCX
Bc0055, tcp ip protocol suite
PPTX
Assignment - 01
PPTX
presentation on email.pptx
PPTX
Private messenger
DOCX
Internet
PPTX
Unit 1 web technology uptu slide
PPTX
Private messenger
PDF
Nt1330 Unit 7
DOCX
Sandeep_Exchange_Administrator
PDF
CS6551 COMPUTER NETWORKS
PPT
unit 3 new syllabus very imp DCN PPT.ppt
PPT
Advanced Java Topics
DOCX
amaha internet course
PDF
Hhs en09 email_security
Case study on Pamplona National High School Local Area Network
Lesson 6 fundamentals of internet and java programming (140 kb)
Protocols and its standards
Web Services
Lesson 17 fundamental of internet (88 kb)
Point of preference (POP)
Bc0055, tcp ip protocol suite
Assignment - 01
presentation on email.pptx
Private messenger
Internet
Unit 1 web technology uptu slide
Private messenger
Nt1330 Unit 7
Sandeep_Exchange_Administrator
CS6551 COMPUTER NETWORKS
unit 3 new syllabus very imp DCN PPT.ppt
Advanced Java Topics
amaha internet course
Hhs en09 email_security

Recently uploaded (20)

PDF
Environmental Education MCQ BD2EE - Share Source.pdf
PDF
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PDF
HVAC Specification 2024 according to central public works department
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PDF
Τίμαιος είναι Ļ†Ī¹Ī»ĪæĻƒĪæĻ†Ī¹ĪŗĻŒĻ‚ Γιάλογος του Πλάτωνα
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PDF
Empowerment Technology for Senior High School Guide
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PDF
Trump Administration's workforce development strategy
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PPTX
Computer Architecture Input Output Memory.pptx
Environmental Education MCQ BD2EE - Share Source.pdf
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
FORM 1 BIOLOGY MIND MAPS and their schemes
Share_Module_2_Power_conflict_and_negotiation.pptx
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
B.Sc. DS Unit 2 Software Engineering.pptx
HVAC Specification 2024 according to central public works department
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
Τίμαιος είναι Ļ†Ī¹Ī»ĪæĻƒĪæĻ†Ī¹ĪŗĻŒĻ‚ Γιάλογος του Πλάτωνα
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
LDMMIA Reiki Yoga Finals Review Spring Summer
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
Empowerment Technology for Senior High School Guide
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
Trump Administration's workforce development strategy
Unit 4 Computer Architecture Multicore Processor.pptx
Computer Architecture Input Output Memory.pptx

finalreport1182014

  • 1. VIETNAM NATIONAL UNIVERSITY OF HCMC INTERNATIONAL UNIVERSITY INTERNSHIP REPORT BY NGUYEN LE CHANH DUY BUILDING MAIL SERVER ON LINUX FOR ENTERPRISE Submitted to: School of Computer Science and Engineering International University, VNU-HCM
  • 2. August 2014 INTERNSHIP REPORT by Nguyen Le Chanh Duy Submitted to: School of Computer Science and Engineering International University, VNU-HCM August 2014 Organization/Company: ATHENA Address: 92 Nguyen Dinh Chieu street, Da Kao ward, district 1, Ho Chi Minh city, Vietnam. Phone number: 090 78 79 477-094 323 00 99-(08)38244041 Duration of the Internship: 8 weeks (16-06-2014 – 16-08-2014) Supervisors during the Internship: o Name: Mr. Vo Do Thang. o Title: Director of ATHENA. o Address: 92 Nguyen Dinh Chieu, Da Kao ward, district 1, HoChiMinh city, Vietnam o Email: Thangvo@athena.edu.vn ii
  • 3. ACKNOWLEDGMENTS After 8 weeks of internship at ATHENA, i have completed my project ā€œBuilding mail server on Linux for enterpriseā€ with the support from friends and instructor. I want to thank ATHENA for providing me good conditions to complete my internship project, especially, I want to thank Mr. Vo Do Thang who has instructed and supported me during all the time of internship at ATHENA. Moreover, I have learned new knowledge at ATHENA such as Linux server, Centos, network, VPS…they will be helpful for my job in the future. iii
  • 4. TABLE OF CONTENTS I. DESCRIPTION OF COMPANY/ORGANIZATION......................................................5 II. SUMMARY OF THE INTERNSHIP.............................................................................7 III. PLANNING ..................................................................................................................9 IV. INTERNSHIP ACTIVITIES & ACHIEVEMENTS...................................................11 A. Email Protocols..........................................................................................11 B. Email Structure..........................................................................................14 C. Mail Server on Linux for enterprise...........................................................16 D. System Requirement..................................................................................17 E. Start building the mail server.....................................................................17 V. INTERNSHIP ASSESSMENT.....................................................................................34 REFERENCES..................................................................................................................35 iv
  • 5. DESCRIPTION OF COMPANY/ORGANIZATION ATHENA is a center of education and training of IT fields. It was established in 2004. This is the center in which many experienced IT engineers work and study in order to contribute to the development of IT fields in Vietnam. The major fields of ATHENA: o ATHENA center focus deeply on education and training of system and network security, network management and maintenance following the standard quality of Microsoft, Cisco, Oracle, Linux LPI, CEH…Moreover, ATHENA center also has the private program of education and training for some government organizations. o After 10 years, many trainees of ATHENA center do the job in IT fields for some government organizations and also for the big companies. o Besides education and training programs, ATHENA center also cooperate and exchange technology with some universities such as university of technology, university of information technology, natural and university of science… The instructors of ATHENA: v
  • 6. o ATHENA instructors graduate from many big universities in Vietnam. They all have to get international certificates such as MCSA, MCSE, CCNA, CCNP, Security+, CEH, Microsoft Certified Trainer…in order to work at ATHENA. o ATHENA instructors usually go abroad to be trained about the new technologies and then they transmit those new technologies to the trainees. vi
  • 7. SUMMARY OF THE INTERNSHIP After 3 years in HCMC International University, I have taken many courses of Network Engineering so I decided to take internship at ATHENA. Because, ATHENA is a center that specializes in network and system fields. At ATHENA, I take a project that requires me to build a mail server on Linux for enterprise. First, I have to get used to new Linux OS: Centos 6.5. Although, I approached another Linux OS in coursers in university. I must learn how to control Centos with commands in terminal. Second, I must build on local host in order to get used to the configuration of mail services. Two Linux virtual machines need to be installed (server and client) to test the mail exchange. Next, I must correct bugs by myself. I can look for documents, solutions…from internet or from friends to solve the problems. If it still does not work, I must discuss with the instructor to get the solutions or the instructions. Finally, I must build a mail server on VPS. Here, I have to set up putty to access the VPS in order to configure. My mission is to make the VPS become a Linux mail server that can connect with yahoo mail and gmail. If it does not exchange mail with gmail or yahoo vii
  • 8. mail, I must fix bugs. My work is done if the VPS works correctly as the instructor requires. viii
  • 9. PLANNING Week 1: o Seeing the instructor to get the project. o Reading and understanding document. o Asking question if necessary. o Writing report. Week 2: o Reading and understanding Linux OS. o Get used to Centos 6.5 o Writing report. Week 3: o Setting up VMware. o Setting up Centos 6.5 on 2 virtual machines (server and client). o Installing telnet, postfix and dovecot services on server. o Writing report. Week 4: o Configuring network (Ethernet, hosts…). o Configuring postfix and dovecot o Testing telnet service. o Writing report. Week 5: o Installing squirrelmail on server and thunderbird on client. o Configuring squirrelmail and thunderbird. o Sending mail between server and client via squirrelmail and thunderbird. o Writing report. Week 6: o Having a VPS. o Installing telnet, postfix and dovecot service on VPS. o Installing squirrelmail on VPS and thunderbird on the laptop. o Writing report. Week 7: ix
  • 10. o Configuring postfix and dovecot. o Configuring squirrelmail and thunderbird. o Exchange mail with gmail and yahoo mail. o Writing report. Week 8: o Fix errors. o Exchange mail with gmail and yahoo mail again. o Writing final report. o Having a project presentation. x
  • 11. INTERNSHIP ACTIVITIES AND ACHIEVEMENTS A/ Email Protocols: Interactions between email servers and clients are governed by email protocols. The three most common email protocols are POP, IMAP. Most email software operates under one of these (and many products support more than one). The Post Office Protocol (currently in version 3, hence POP3) allows email client software to retrieve email from a remote server. The Internet Message Access Protocol (now in version 4 or IMAP4) allows a local email client to access email messages that reside on a remote server. The SMTP (Simple Mail Transfer Protocol) protocol is used by the Mail Transfer Agent (MTA) to deliver your email to the recipient's mail server 1. Post Office Protocol (POP): POP is the older design, and hails from an era when intermittent connection via modem (dial-up) was the norm. POP allows users to retrieve email when connected, and then act on the retrieved messages without needing to stay "on- line." This is an important benefit when connection charges are expensive. The basic POP procedure is to retrieve all inbound messages for storage on the client, delete them on server, and then disconnect. (The email server functions like a mailbox at the Post Office -- a temporary holding area until mail gets to its final destination, your computer.) xi
  • 12. Outbound mail is generated on the client, and held for transmission to the email server until the next time the user's connection is active. After it's uploaded, the server forwards the outgoing mail to other email servers, until it reaches its final destination. Most POP clients also provide an option to leave copies of email on the server. In this case, messages are only removed from the server when greater than a certain "age" or when they have been explicitly deleted on the client. It's the copies on the client that are considered the "real" ones, however, with those left on the server merely temporary backups. 2. Internet Access Message Protocol (IMAP): IMAP is the newer protocol and oriented toward a "connected" mode of operation. The standard IMAP procedure is to leave messages on the server instead of retrieving copies, so email is only accessible when "on- line." IMAP is more suited to a world of always-on connections, particularly the fast connections offered by broadband mechanisms. Having to be connected to read your email is a trivial obstacle when the connection is always available. (It's a little like leaving your messages at the Post Office, and going there every time you want to read them. That might be difficult in the physical world, but it's easy in the virtual one.) xii
  • 13. Because messages remain on the server, until explicitly deleted by the user, they can be accessed by multiple client computers -- an important advantage when you use more than one computer to check your email. IMAP does not preclude keeping copies on the client, but, in an inversion of the way POP works, it's the server's copies that are considered the "real" ones. That offers an important security benefit -- you won't lose your email if, for some reason, your client computer's storage media fails. IMAP has other advantages over POP (detailed in the links provided below). It is the standard we recommend if you can't use MAPI. 3. The Simple Mail Transfer Protocol (SMTP): At the risk of overloading you with information, you should know that strictly speaking it's only the incoming mail that is handled by a POP or IMAP protocol. Outgoing mail for both POP and IMAP clients uses the Simple Mail Transfer Protocol (SMTP). When you set up a POP or IMAP email account on email client software, you must specify the name of the (POP or IMAP) mail server computer for incoming mail. You must also specify the name of the (SMTP) server computer for outgoing mail. These names are typically in the same form xiii
  • 14. as Web addresses (e.g., "imap.med.miami.edu"). Depending on the client, there may also be specifications for email directories and searching. B/ Email Structure: o Mail User Agent (MUA): is a program that allows you to receive and send e-mail messages; it's usually just called an e-mail program. To use an MUA such as Eudora or Microsoft Outlook, you install the MUA program on your computer and then use it to download and store e-mail messages to your computer; it will also allow you to read or write messages offline. Web-based MUAs, such as Hotmail and Yahoo, store messages on their own mail servers and allow access to them through a Web page. An MUA is sometimes called an e-mail agent or an e-mail client. xiv
  • 15. o Mail Transport Agent (MTA): is an application that receives incoming e-mail from local users (people within the same domain) and remote senders and forwards outgoing e-mail for delivery. A computer dedicated to running such applications is also called a mail server. Microsoft Exchange, qmail, Exim and sendmail are among the more common mail server programs. o Mail Delivery Agent (MDA): is the software and other systems that are responsible for sending and receiving mail between systems. That is the ONLY things MTAs do: they send and receive messages between systems. MTAs use the SMTP (Simple Mail Transfer Protocol) to send and receive messages. o Mail Submission Agent (MSA): is a computer program or software agent that receives electronic mail messages from a mail user agent (MUA) and cooperates with a mail transfer agent (MTA) for delivery of the mail. It uses a variant of the Simple Mail Transfer Protocol (SMTP), as specified in RFC 6409. o Mail Access Agent/ Mail Retrieval Agent (MAA/MRA): is a computer application that retrieves or fetches e-mail from a remote mail server and works with a mail delivery agent to deliver mail to a local or remote email mailbox. MRAs may be external applications by themselves xv
  • 16. or be built into a bigger application like an MUA. Significant examples of standalone MRAs include fetchmail, getmail and retchmail. C/ Mail Server (Postfix, Dovecot…) for Enterprise on Linux: This is a Linux mail server for small and medium companies/enterprises with low investment. However, it is stable and effective. o Postfix is Wietse Venema's mail server that started life at IBM research as an alternative to the widely-used Sendmail program. Postfix attempts to be fast, easy to administer, and secure. The outside has a definite Sendmail- ish flavor, but the inside is completely different. o Dovecot is an open source IMAP and POP3 email server for Linux/UNIX- like systems, written with security primarily in mind. Dovecot is an excellent choice for both small and large installations. It's fast, simple to set up, requires no special administration and it uses very little memory. xvi Thunderbird, Outlook, Squirrelmail… POSTFIX Authenticate DOVECOT MailStore MailBox (File Linux) PROCMAIL SpamAssanssin
  • 17. o SquirrelMail is a standards-based webmail package written in PHP. It includes built-in pure PHP support for the IMAP and SMTP protocols, and all pages render in pure HTML 4.0 (with no JavaScript required) for maximum compatibility across browsers. It has very few requirements and is very easy to configure and install. SquirrelMail has all the functionality you would want from an email client, including strong MIME support, address books, and folder manipulation. D/ System Requirement: o The linux system requires normal hardware support, a linux server with medium configuration can work stably and effectively. For example, a mail server with configuration: CPU Pentium III 600MHZ, RAM 256MB, HDD 40GB can serve from 300 to 400 users. o Soft wares are required to install on a Linux mail server: • Operating System: Centos 6.5 running with command line. • SMTP Server: Postfix 2.3.3 • POP3/IMAP Server: 1.0.7 • Web Mail: SquirrelMail 1.4.8 • Web Server: Apache 2.2.3 Depending on the requirements, all the soft wares can be updated to the newer version. E/ Start building the mail server: I/ Starting with local host: 1. Configure static IP address: Server: xvii
  • 18. # vi /etc/sysconfig/network-scripts/ifcfg-eth0 BOOTPROTO=static IPADDR=192.168.1.245 NETMASK=255.255.255.0 GATEWAY=192.168.1.254 Client: # vi /etc/sysconfig/network-scripts/ifcfg-eth0 BOOTPROTO=static IPADDR=192.168.1.240 NETMASK=255.255.255.0 GATEWAY=192.168.1.250 2. Configure hostname: # vi /etc/hosts 127.0.0.1 mail.athena.lab 129.168.1.245 mail.athena.lab # vi /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=yes HOSTNAME=mail.athena.lab 3. Configure DNS: The DNS is a hierarchical distributed naming system for computers, services, or any resource connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities. Most prominently, it translates easily memorized domain names to the numerical IP addresses needed for the purpose of locating computer services and devices worldwide. The Domain Name System is an essential component of the functionality of the Internet. Install packages with command: xviii
  • 19. # rpm –ivh <packages>: bind-9.8.2-0.17.rc1.el6_4.6.i686.rpm bind-libs-9.8.2-0.17.rc1.el6_4.6.i686.rpm bind-utils-9.8.2-0.17.rc1.el6_4.6.i686.rpm Create file: /etc/named.conf acl mynet { 192.168.1.0/24 }; options { allow-transfer {none;}; directoryā€ /var/namedā€; query-source port 53; query-source-v6 port 53; dump-file ā€œvar/named/data/cache_dump.dbā€; statistics-file ā€œvar/named/data/named_stats.txtā€; mamstatistics-file ā€œvar/named/data/named_mem_stats.txtā€; notify yes; }; zone ā€œ.ā€ IN { type hint; file ā€œnamed.rootā€; }; zone ā€œathena.labā€ IN { type master; file ā€œathena.lab.dbā€; allow-query {mynet;}; }; zone ā€œ1.168.192.in-addr.arpaā€ { type master; file ā€œ1.168.192.in-addr.arpa.dbā€; allow-query {mynet;}; }; Create file: /var/named/named.root by downloading via internet with the command: # wget http://www.internic.net/zones/named.root Create file: /var/named/athena.lab $TTL 86400 @ IN S0A dns.athena.lab. root. { 46 ; serial 3H ; refresh xix
  • 20. 15M ; retry 1W ; expire 1D ; ttl } IN NS dns.athena.lab. dns IN A 192.168.1.245 mail IN A 192.168.1.245 Create file: /var/named/1.168.192.in-addr.arpa.db: $TTL 86400 @ IN S0A dns.athena.lab. root. { 46 ; serial 10800 ; refresh 900 ; retry 604800 ; expire 86400 ; ttl } @ IN NS dns.athena.lab. 1 IN PTR mail.athena.lab. Restart named daemon: # service named restart Shut down firewall: # service iptables stop 4. Install and configure Postfix service: Install Postfix service with command: # yum install postfix Configure Postfix: # vi /etc/postfix/main.cf ## Line 75 – Uncomment myhostname = mail.athena.lab ## Line 83 – Uncomment mydomain = athena.lab ## Line 99 - Uncomment xx
  • 21. myorigin = $mydomain ## Line 116 inet_interfaces = all ## Line 164 –Add $mycomain mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain ## Line 250 - Uncomment mynetworks_style = subnet ## Line 264 – Uncomment, Add networks mynetworks = 192.168.1.0/24, 127.0.0.0/8 ## Line 419 – Uncomment home_mailbox = Maildir/ Restart postfix: # service postfix restart # chkconfig postfix on # netstat –nat | grep 25 Install Telnet service: # yum install telnet telnet-server –y Create users: # useradd user1 # passwd user1 # useradd user2 # passwd user2 Telnet to server: # telnet mail.athena.lab 25 Trying ::1… Connected to mail.athena.lab. Escape character is ā€˜^]’. 220 mail.athena.lab ESMTP Postfix Send mail from user1 to user2: mail from: user1@athena.lab 250 2.1.0 OK rcpt to: user2@athena.lab 250 2.1.5 OK xxi
  • 22. data 354 End data with <CR><LF>.<CR><LF> Testing . 250 2.0.0 OK: queued as 1247AF434A quit 221 2.0.0 Bye Connection closed by foreign host. 5. Install and configure Dovecot service: Install Dovecot service with command: # yum install dovecot Configure dovecot: # vi /etc/dovecot/dovecot.conf ## Line 20 – Uncomment protocols = imap pop3 lmtp ## Line 26 – Uncomment, remove ā€œ,::ā€ listen = * # vi /etc/dovecot/conf.d/10-auth.conf ## Line 9 – Uncomment disable_plaintext_auth = no ## Dòng 97 – Uncomment auth_mechanisms = plain login # vi /etc/dovecot/conf.d/10-mail.conf ## Line 24 – Uncomment mail_location = maildir:~/Maildir # vi /etc/dovecot/conf.d/10-master.conf ## Line 19 – Uncomment port = 143 ## Line 22 – Uncomment port = 993 ## Line 40 – Uncomment port = 110 ## Line 43 – Uncomment xxii
  • 23. port = 995 ## Line 82 – Uncomment mode = 0600 ## Line 83 – Uncomment, sį»­a lįŗ”i thĆ nh: user = postfix ## Line 84 – Uncomment, sį»­a lįŗ”i thĆ nh: group = postfix Restart dovecot and postfix service: # service dovecot restart # service postfix restart 6. Install and configure Mozilla Thunderbird: Install thunderbird with command: # yum install thunderbird Create email account with thunderbird: o Step 1: Access Mozilla Thunderbird xxiii
  • 24. o Step 2: Create a new account > Email o Step 3: Yourname: user1 > Email address: user1@athena.lab > Password: 1234 > Remember password o Step 4: Continue > Manual config o Step 5: Incoming: 192.168.1.245 (IP server) > Outgoing: 192.168.1.245 o Step 6: Re-test > confirm security > done Create email account for user2 as we do for user1 Restart postfix, dovecot service, then exchange mail between user1 and user2 by using Mozilla Thunderbird. 7. Install and configure Squirrelmail: Install squirrelmail with commands: # rpm –Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6- 8.noarch.rpm # yum install squirrelmail Configure squirrelmail: # vi /etc/share/sbin/squirrelmail/config/conf.pl o Step 1: Server Settings > Domain: athena.lab o Step 2: Sendmail or SMTP > SMTP o Step 3: R > D > dovecot o Step 4: S to save > Q to quit Restart postfix, dovecot and httpd service. Exchange mail between user1 and user2 by accessing http://<ipaddress>/webmail or http://<domain-name>/webmail II/ Building mail server on VPS: 1. Install Putty to access the VPS 2. Register domain name: xxiv
  • 25. xxv
  • 26. o Step 1: Access www.dot.tk to get a free domain name: athenacd.tk o Step 2: Use DNS > Dot TK DNS Service o Step 3: Host name: www.athenacd.tk > IP address: 14.0.31.168 Host name: athenacd.tk > IP address: 14.0.31.168 o Step 4: maintain this domain name in 3 months o Step 5: Choose google account to manage this domain name o Step 5: Sign in my.dot.tk > Go to domain > Modify o Step 6: Add 2 records > Save changes A Record > mail.athenacd.tk > 14.0.31.168 MX Record > athenacd.tk > mail.athenacd.tk 3. Configure DNS: Install packages with command: rpm –ivh <packages>: bind-9.8.2-0.17.rc1.el6_4.6.i686.rpm bind-libs-9.8.2-0.17.rc1.el6_4.6.i686.rpm bind-utils-9.8.2-0.17.rc1.el6_4.6.i686.rpm Create file: /etc/named.conf acl mynet { 14.0.31.160/27 }; options { allow-transfer {none;}; directoryā€ /var/namedā€; query-source port 53; xxvi
  • 27. query-source-v6 port 53; dump-file ā€œvar/named/data/cache_dump.dbā€; statistics-file ā€œvar/named/data/named_stats.txtā€; mamstatistics-file ā€œvar/named/data/named_mem_stats.txtā€; notify yes; }; zone ā€œ.ā€ IN { type hint; file ā€œnamed.rootā€; }; zone ā€œathenacd.tkā€ IN{ type master; file ā€œathenacd.tk.dbā€; allow-query {mynet;}; }; zone ā€œ31.0.14.in-addr.arpaā€ { type master; file ā€œ31.0.14.in-addr.arpa.dbā€; allow-query {mynet;}; }; Create file: /var/named/named.root by downloading via internet with the command: # wget http://www.internic.net/zones/named.root Create file: /var/named/athena.tk $TTL 86400 @ IN S0A dns.athenacd.tk. root. { 46 ; serial 3H ; refresh 15M ; retry 1W ; expire 1D ; ttl } IN NS dns.athenacd.tk. IN MX 10 mail.athenacd.tk. dns IN A 192.168.1.245 mail IN A 192.168.1.245 www IN CNAME athenacd.tk. ftp IN CNAME athenacd.tk. Create file: /var/named/31.0.14.in-addr.arpa.db: xxvii
  • 28. $TTL 86400 @ IN S0A dns.athenacd.tk. root. { 46 ; serial 10800 ; refresh 900 ; retry 604800 ; expire 86400 ; ttl } IN NS dns.athenacd.tk. 1 IN PTR dns.athenacd.tk. 2 IN PTR mail.athenacd.tk. 2. Install and configure Postfix service: Install Postfix service with command: # yum install postfix Configure Postfix: # vi /etc/postfix/main.cf ## Line 70 – Uncomment myhostname = mail.athenacd.tk ## Line 83 – Uncomment mydomain = athenacd.tk ## Line 99 - Uncomment myorigin = $mydomain ## Line 116 inet_interfaces = all ## Line 164 –Add $mycomain mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain ## Line 250 - Uncomment mynetworks_style = subnet ## Line 264 – Uncomment, Add networks mynetworks = 14.0.31.160/27, 127.0.0.0/8 ## Line 419 – Uncomment home_mailbox = Maildir/ xxviii
  • 29. Restart postfix: # service postfix restart # chkconfig postfix on # netstat –nat | grep 25 Install Telnet service: # yum install telnet telnet-server –y Create users: # useradd duy # passwd duy # useradd tien # passwd tien Telnet to server: # telnet mail.athena.lab 25 Trying ::1… Connected to mail.athena.lab. Escape character is ā€˜^]’. 220 mail.athena.lab ESMTP Postfix Send mail from duy to tien: mail from: duy@athenacd.tk 250 2.1.0 OK rcpt to: tien@athenacd.tk 250 2.1.5 OK data 354 End data with <CR><LF>.<CR><LF> Testing . 250 2.0.0 OK: queued as 1247AF434A quit 221 2.0.0 Bye Connection closed by foreign host. Shut down sendmail service and change from MTA to Postfix: xxix
  • 30. # /etc/rc.d/init.d/sendmail stop # chkconfig sendmail off # alternatives –config mta # service postfix restart 3. Install and configure Dovecot service: Install Dovecot service with command: # yum install dovecot Configure dovecot: # vi /etc/dovecot.conf ## Line 20 – Uncomment protocols = imap pop3 lmtp ## Line 26 – Uncomment, remove ā€œ,::ā€ listen = * ## Line 211 – Uncomment and add: mail_location = maildir:~/Maildir Restart dovecot and postfix service: # service dovecot restart # service postfix restart 4. Install and configure Squirrelmail: Install squirrelmail with commands: xxx
  • 31. # rpm –Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6- 8.noarch.rpm # yum install squirrelmail Configure squirrelmail: # vi /etc/share/sbin/squirrelmail/config/conf.pl o Step 1: Server Settings > Domain: athena.lab o Step 2: Sendmail or SMTP > SMTP o Step 3: R > D > dovecot o Step 4: S to save > Q to quit # vi /etc/httpd/conf/httpd.conf <VirtualHost*:80> ServerName mail.athenacd.tk DocumentRoot /usr/share/squirrelmail </VirtualHost> xxxi
  • 32. Restart postfix, dovecot and httpd service: # service named restart # service postfix restart # service httpd restart # service dovecot restart Exchange mail between user1 and user2 by accessing http://<ipaddress>/webmail or http://<domain-name>/webmail Exchange mail between users and yahoo mail, google mail by accessing http://<ipaddress>/webmail or http://<domain-name>/webmail xxxii
  • 34. INTERNSHIP ASSESSMENT During the internship period, I have gained new knowledge and many experiences from my project. Firstly, I must take time to research about the Centos in order to understand how it works. After researching, I recognized the differences between Centos and the other OS, moreover, I have learned the way to control the Centos by using commands in terminal. Secondly, I had chance to work with a real server, thanks to that, I knew how to make it run correctly and fix bugs when problems happen. Next, by learning, I have understood deeply about the mail protocols, dns, network configuration, network problems… All of the experiences and knowledge that I have gained from the internship will be helpful for my future career, because now I am taking the courses of Network Engineering in university and in the future, as an network engineer, I will face with many problems of systems, network, servers… However, during the internship period, I found myself lack of basic knowledge, so beside researching via internet, I also re-learned myself some courses that I have taken before. xxxiv
  • 36. 36