First you should have a well configured dns in the system in which u are going to configure you mail server.
your forward zone should look like this
your reverse zone should look like this
Then install postfix service
[root@station1 ~]# yum install -y postfix
75 myhostname = station1.example.com
83 mydomain = example.com
99 myorigin = $mydomain
113 inet_interfaces = all
116 #inet_interfaces = localhost
164 #mydestination = $myhostname, localhost.$mydomain, localhost
165 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
419 home_mailbox = Maildir/
:wq save and quit
[root@station1 ~]# chkconfig postfix on
[root@station1 ~]# service postfix start
Starting postfix: [ OK ]
[root@station1 ~]# yum install dovecot
[root@station1 ~]# yum install fetchmail
[root@station1 ~]# yum install mutt
[root@station1 ~]# vim /etc/dovecot/dovecot.conf
20 protocols = imap pop3 lmtp
32 login_greeting = Dovecot ready.
[root@station1 ~]# vim /etc/dovecot/conf.d/10-mail.conf
24 mail_location = maildir:~/Maildir
[root@station1 ~]# vim /etc/dovecot/conf.d/20-pop3.conf
51 pop3_uidl_format = %08Xu%08Xv
85 pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
[root@station1 ~]# cd /etc/pki/tls/certs/
[root@station1 certs]# make dovecot.pem
Country Name (2 letter code) [XX]:IN
State or Province Name (full name) []:Kerala
Locality Name (eg, city) [Default City]:Calicut
Organization Name (eg, company) [Default Company Ltd]:Hp
Organizational Unit Name (eg, section) []:Edms
Common Name (eg, your name or your server's hostname) []:station1.example.com
Email Address []:root@station1.example.com
[root@station1 certs]# cp dovecot.pem /etc/pki/tls/private/
[root@station1 certs]# cp dovecot.pem /etc/pki/dovecot/certs/
[root@station1 certs]# cp dovecot.pem /etc/pki/dovecot/private/
[root@station1 certs]# vim /etc/pki/dovecot/dovecot-openssl.cnf
[ req_dn ]
# country (2 letter code)
C=IN
# State or Province Name (full name)
ST=Kerala
# Locality Name (eg. city)
L=Calicut
# Organization (eg. company)
O=Hp
# Organizational Unit Name (eg. section)
OU=Edms
# Common Name (*.example.com is also possible)
CN=station1.example.com
# E-mail contact
emailAddress=root@station1.example.com
[ cert_type ]
nsCertType = server
[root@station1 certs]# chkconfig dovecot on
[root@station1 certs]# service dovecot restart
Stopping Dovecot Imap: [ OK ]
Starting Dovecot Imap: [ OK ]
[root@station1 certs]# yum install httpd
[root@station1 certs]# vim /etc/httpd/conf/httpd.conf
262 ServerAdmin root@station1.example.com
276 ServerName station1.example.com:80
[root@station1 certs]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
To install squirrelmail download the packages form the link given below
for x86_64 epel package click here and install the rpm package
epel
[root@station1 ~]# yum repolist
[root@station1 ~]# yum install squirrelmail
suppose if dependency issue occurs for php-mbstring download from here
php-mbstring