SlideShare a Scribd company logo
1 of 36
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

What's hot

05 01 open-vpn
05 01 open-vpn05 01 open-vpn
05 01 open-vpn
Noël
 
Báo cáo cuối kỳ
Báo cáo cuối kỳBáo cáo cuối kỳ
Báo cáo cuối kỳ
Khỉ Lùn
 
IRCAD, Internship Report
IRCAD, Internship ReportIRCAD, Internship Report
IRCAD, Internship Report
Raphaël Bils
 
Etude et mise en place d’une solution open source de gestion de la sécurité d...
Etude et mise en place d’une solution open source de gestion de la sécurité d...Etude et mise en place d’une solution open source de gestion de la sécurité d...
Etude et mise en place d’une solution open source de gestion de la sécurité d...
Mohammed LAAZIZLI
 
[123doc.vn] xay dung he thong mang cho doanh nhiep nho
[123doc.vn]   xay dung he thong mang cho doanh nhiep nho[123doc.vn]   xay dung he thong mang cho doanh nhiep nho
[123doc.vn] xay dung he thong mang cho doanh nhiep nho
Nguyễn Quân
 
Bao cao thuc tap vdc tranning da nang la xuan tam,tran canh ngo
Bao cao thuc tap vdc tranning da nang la xuan tam,tran canh ngoBao cao thuc tap vdc tranning da nang la xuan tam,tran canh ngo
Bao cao thuc tap vdc tranning da nang la xuan tam,tran canh ngo
Hate To Love
 

What's hot (20)

Sécurité asterisk web
Sécurité asterisk webSécurité asterisk web
Sécurité asterisk web
 
05 01 open-vpn
05 01 open-vpn05 01 open-vpn
05 01 open-vpn
 
Báo cáo cuối kỳ
Báo cáo cuối kỳBáo cáo cuối kỳ
Báo cáo cuối kỳ
 
présentation sur le vpn
présentation sur le vpn présentation sur le vpn
présentation sur le vpn
 
Premiers pas avec snort
Premiers pas avec snortPremiers pas avec snort
Premiers pas avec snort
 
Cours HTTPS pour UnPointZero
Cours HTTPS pour UnPointZeroCours HTTPS pour UnPointZero
Cours HTTPS pour UnPointZero
 
NGHIEN CUU VA TRIEN KHAI VPN
NGHIEN CUU VA TRIEN KHAI VPN NGHIEN CUU VA TRIEN KHAI VPN
NGHIEN CUU VA TRIEN KHAI VPN
 
IRCAD, Internship Report
IRCAD, Internship ReportIRCAD, Internship Report
IRCAD, Internship Report
 
Etude et mise en place d’une solution open source de gestion de la sécurité d...
Etude et mise en place d’une solution open source de gestion de la sécurité d...Etude et mise en place d’une solution open source de gestion de la sécurité d...
Etude et mise en place d’une solution open source de gestion de la sécurité d...
 
Mise en place d'un système de messagerie sécurisée pour une PME/PMI
Mise en place d'un système de messagerie sécurisée pour une PME/PMIMise en place d'un système de messagerie sécurisée pour une PME/PMI
Mise en place d'un système de messagerie sécurisée pour une PME/PMI
 
Installation de snort avec pulled pork
Installation de snort avec pulled porkInstallation de snort avec pulled pork
Installation de snort avec pulled pork
 
Openvpn avec un client windows
Openvpn avec un client windows Openvpn avec un client windows
Openvpn avec un client windows
 
La VoIP,Elastix, CentOs, Codima, WireShark
La VoIP,Elastix, CentOs, Codima, WireSharkLa VoIP,Elastix, CentOs, Codima, WireShark
La VoIP,Elastix, CentOs, Codima, WireShark
 
Nagios 3
Nagios 3Nagios 3
Nagios 3
 
[123doc.vn] xay dung he thong mang cho doanh nhiep nho
[123doc.vn]   xay dung he thong mang cho doanh nhiep nho[123doc.vn]   xay dung he thong mang cho doanh nhiep nho
[123doc.vn] xay dung he thong mang cho doanh nhiep nho
 
Installation et Configuration de Pfsense
Installation et Configuration de PfsenseInstallation et Configuration de Pfsense
Installation et Configuration de Pfsense
 
Bao cao thuc tap vdc tranning da nang la xuan tam,tran canh ngo
Bao cao thuc tap vdc tranning da nang la xuan tam,tran canh ngoBao cao thuc tap vdc tranning da nang la xuan tam,tran canh ngo
Bao cao thuc tap vdc tranning da nang la xuan tam,tran canh ngo
 
Wi-Fi Security Presentation.pptx
Wi-Fi Security Presentation.pptxWi-Fi Security Presentation.pptx
Wi-Fi Security Presentation.pptx
 
Đồ án xây dựng hệ thống mạng LAN cho doanh nghiệp.doc
Đồ án xây dựng hệ thống mạng LAN cho doanh nghiệp.docĐồ án xây dựng hệ thống mạng LAN cho doanh nghiệp.doc
Đồ án xây dựng hệ thống mạng LAN cho doanh nghiệp.doc
 
Mise en place de la telephonie ip avec Asterisk
Mise en place de la telephonie ip avec AsteriskMise en place de la telephonie ip avec Asterisk
Mise en place de la telephonie ip avec Asterisk
 

Viewers also liked

FreeBSD - LinuxExpo
FreeBSD - LinuxExpoFreeBSD - LinuxExpo
FreeBSD - LinuxExpo
webuploader
 
Squid proxy-configuration-guide
Squid proxy-configuration-guideSquid proxy-configuration-guide
Squid proxy-configuration-guide
jasembo
 
Tola.leng mail server (sq_mail &amp; rcmail)_q5_
Tola.leng mail server (sq_mail &amp; rcmail)_q5_Tola.leng mail server (sq_mail &amp; rcmail)_q5_
Tola.leng mail server (sq_mail &amp; rcmail)_q5_
Tola LENG
 

Viewers also liked (20)

Mail server on linux
Mail server on linux Mail server on linux
Mail server on linux
 
FreeBSD ports
FreeBSD portsFreeBSD ports
FreeBSD ports
 
Introduction to FreeBSD 7.0
Introduction to FreeBSD 7.0Introduction to FreeBSD 7.0
Introduction to FreeBSD 7.0
 
Dovecot
DovecotDovecot
Dovecot
 
Webmail
WebmailWebmail
Webmail
 
FreeBSD - LinuxExpo
FreeBSD - LinuxExpoFreeBSD - LinuxExpo
FreeBSD - LinuxExpo
 
FreeBSD Document Project
FreeBSD Document ProjectFreeBSD Document Project
FreeBSD Document Project
 
Dovecot & Postfix バージョンアップ動向 201506-201511
Dovecot & Postfix バージョンアップ動向 201506-201511Dovecot & Postfix バージョンアップ動向 201506-201511
Dovecot & Postfix バージョンアップ動向 201506-201511
 
66_pfSenseTutorial
66_pfSenseTutorial66_pfSenseTutorial
66_pfSenseTutorial
 
Mail server using Linux(Ubuntu)
Mail server using Linux(Ubuntu)Mail server using Linux(Ubuntu)
Mail server using Linux(Ubuntu)
 
FreeBSD: Dev to Prod
FreeBSD: Dev to ProdFreeBSD: Dev to Prod
FreeBSD: Dev to Prod
 
Postfix
PostfixPostfix
Postfix
 
Livro pfsense 2.0 pt br
Livro pfsense 2.0 pt brLivro pfsense 2.0 pt br
Livro pfsense 2.0 pt br
 
Squid proxy-configuration-guide
Squid proxy-configuration-guideSquid proxy-configuration-guide
Squid proxy-configuration-guide
 
Introduction To SELinux
Introduction To SELinuxIntroduction To SELinux
Introduction To SELinux
 
SELinux basics
SELinux basicsSELinux basics
SELinux basics
 
Mail server report
Mail server reportMail server report
Mail server report
 
Mail server configuration
Mail server configurationMail server configuration
Mail server configuration
 
Tola.leng mail server (sq_mail &amp; rcmail)_q5_
Tola.leng mail server (sq_mail &amp; rcmail)_q5_Tola.leng mail server (sq_mail &amp; rcmail)_q5_
Tola.leng mail server (sq_mail &amp; rcmail)_q5_
 
Squid
SquidSquid
Squid
 

Similar to finalreport1182014

Lesson 6 fundamentals of internet and java programming (140 kb)
Lesson 6  fundamentals of internet and java programming (140 kb)Lesson 6  fundamentals of internet and java programming (140 kb)
Lesson 6 fundamentals of internet and java programming (140 kb)
IMRAN KHAN
 
Lesson 17 fundamental of internet (88 kb)
Lesson 17 fundamental of internet (88 kb)Lesson 17 fundamental of internet (88 kb)
Lesson 17 fundamental of internet (88 kb)
IMRAN KHAN
 
presentation on email.pptx
presentation on email.pptxpresentation on email.pptx
presentation on email.pptx
YouTubeCONTRA
 
Private messenger
Private messengerPrivate messenger
Private messenger
Piyush Gaur
 
Sandeep_Exchange_Administrator
Sandeep_Exchange_AdministratorSandeep_Exchange_Administrator
Sandeep_Exchange_Administrator
Sandeep Patro
 
Hhs en09 email_security
Hhs en09 email_securityHhs en09 email_security
Hhs en09 email_security
Shoaib Sheikh
 

Similar to finalreport1182014 (20)

Case study on Pamplona National High School Local Area Network
Case study on Pamplona National High School Local Area NetworkCase study on Pamplona National High School Local Area Network
Case study on Pamplona National High School Local Area Network
 
Lesson 6 fundamentals of internet and java programming (140 kb)
Lesson 6  fundamentals of internet and java programming (140 kb)Lesson 6  fundamentals of internet and java programming (140 kb)
Lesson 6 fundamentals of internet and java programming (140 kb)
 
Protocols and its standards
Protocols and its standardsProtocols and its standards
Protocols and its standards
 
Web Services
Web ServicesWeb Services
Web Services
 
Lesson 17 fundamental of internet (88 kb)
Lesson 17 fundamental of internet (88 kb)Lesson 17 fundamental of internet (88 kb)
Lesson 17 fundamental of internet (88 kb)
 
Point of preference (POP)
Point of preference (POP)Point of preference (POP)
Point of preference (POP)
 
HHS_TOC_Glossary EMERSON EDUARDO RODRIGUES
HHS_TOC_Glossary EMERSON EDUARDO RODRIGUESHHS_TOC_Glossary EMERSON EDUARDO RODRIGUES
HHS_TOC_Glossary EMERSON EDUARDO RODRIGUES
 
Bc0055, tcp ip protocol suite
Bc0055, tcp ip protocol suiteBc0055, tcp ip protocol suite
Bc0055, tcp ip protocol suite
 
Assignment - 01
Assignment - 01Assignment - 01
Assignment - 01
 
presentation on email.pptx
presentation on email.pptxpresentation on email.pptx
presentation on email.pptx
 
Private messenger
Private messengerPrivate messenger
Private messenger
 
Internet
InternetInternet
Internet
 
Unit 1 web technology uptu slide
Unit 1 web technology uptu slideUnit 1 web technology uptu slide
Unit 1 web technology uptu slide
 
Private messenger
Private messengerPrivate messenger
Private messenger
 
Nt1330 Unit 7
Nt1330 Unit 7Nt1330 Unit 7
Nt1330 Unit 7
 
Sandeep_Exchange_Administrator
Sandeep_Exchange_AdministratorSandeep_Exchange_Administrator
Sandeep_Exchange_Administrator
 
CS6551 COMPUTER NETWORKS
CS6551 COMPUTER NETWORKSCS6551 COMPUTER NETWORKS
CS6551 COMPUTER NETWORKS
 
Advanced Java Topics
Advanced Java TopicsAdvanced Java Topics
Advanced Java Topics
 
amaha internet course
amaha internet courseamaha internet course
amaha internet course
 
Hhs en09 email_security
Hhs en09 email_securityHhs en09 email_security
Hhs en09 email_security
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Recently uploaded (20)

Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.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