Install mail server ( Postfix , Dovecot , squirrelMail) in centos 5.5

Requirment :

-OS : centos 5.5
-apache
-sql server
-php

-bikin repo baru

/etc/yum.repos.d/webtatic-el5.repo

isi :

[webtatic-el5]
name=Webtatic Repository EL5 – $basearch
#baseurl=http://repo.webtatic.com/yum/el5/$basearch/
mirrorlist=http://mirror.webtatic.com/yum/el5/$basearch/mirrorlist
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy

[webtatic-el5-debuginfo]
name=Webtatic Repository EL5 – $basearch – Debug
#baseurl=http://repo.webtatic.com/yum/el5/$basearch/debug/
mirrorlist=http://mirror.webtatic.com/yum/el5/$basearch/debug/mirrorlist
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy

[webtatic-el5-source]
name=Webtatic Repository EL5 – Source
#baseurl=http://repo.webtatic.com/yum/el5/SRPMS/
mirrorlist=http://mirror.webtatic.com/yum/el5/SRPMS/mirrorlist
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy

# pastikan server anda sudah terhost

misal :

cat /etc/hosts

111.68.116.188 asteroid.iixmedia.com

Mulai instalasi :

1. Postfix

a. matikan iptables

service iptables stop
chkconfig iptables off

b. matikan selinux >> /etc/selinux/config

selinux = disable

c. yum install postfix

d. config postfix

vi /etc/postfix/main.cf

yang harus ada :

myhostname = asteroid.iixmedia.com
mydomain =$myhostname / bisa dengan nama domain yg anda punya
myorigin =$myhostname
inet_interfaces =all >> kasih tanda #inet_interfaces = localhost
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 111.68.116.0/28, 127.0.0.0/8 >> sesuaikan dengan network anda
home_mailbox = Maildir/

e. running service nya
service postfix start
chkconfig postfix on

f. untuk testing :

install telnet :

yum install telnet

test kirim mail :

[root@jojo ~]# telnet localhost smtp
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
220 asteroid.iixmedia.com ESMTP Postfix
ehlo localhost
250-asteroid.iixmedia.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from:yuby@yahoo.com
250 2.1.0 Ok
rcpt to:genesis@yahoo.com
250 2.1.5 Ok
data
354 End data with .
Subject:Test mail
Test mail
. >> (nb > jngan lupa di ahiri tanda titik baru enter)
250 2.0.0 Ok: queued as B972B102A166

2. Install Dovecot

a. install

yum install dovecot

b. config dovecot

nano /etc/dovecot.conf

yang harus di edit :
protocols = imap imaps pop3 pop3s

kemudian lakukan command

/usr/sbin/postconf -e ‘home_mailbox = Maildir/’
/usr/sbin/postconf -e ‘mailbox_command =’

edit :
login_process_size = 64

socket listen {
#master {
# Master socket provides access to userdb information. It’s typically
# used to give Dovecot’s local delivery agent access to userdb so it
# can find mailbox locations.
#path = /var/run/dovecot/auth-master
#mode = 0600
# Default user/group is the one who started dovecot-auth (root)
#user =
#group =
#}
client {
# The client socket is generally safe to export to everyone. Typical use
# is to export it to your SMTP server so it can do SMTP AUTH lookups
# using it.
path = /var/spool/postfix/private/auth-client
mode = 0660
user = postfix
group = postfix
}
}
}

c. restart service

/etc/init.d/postfix restart
/etc/init.d/dovecot start
chkconfig –level 235 dovecot on

d. test dovecot

telnet localhost 110
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
+OK Dovecot ready.

e. bikin user baru misal 2 user :

useradd -m bobby -s /sbin/nologin
passwd bobby

useradd -m leela -s /sbin/nologin
passwd leela

f. tes kirim mail

misal dari yuby@yahoo.com ke bobby@asteroid.iixmedia.com

ntar hasilnya bisa di cek di

cd /home/bobby/Maildir/new

3. Install squirrelMail

a. install

yum install squirrelmail

b. config

perl /usr/share/squirrelmail/config/conf.pl

plih no 1 >> ganti organisasi nya
pilih no 2 server setting >> pilih no 3 >> ganti sendamail dengan SMTP

kemudian kembali ke main menu R
ketik : D lalu enter

save settingan lalu quit.

c.edit /etc/httpd/conf.d/squirrelmail.conf

tambahkan line berikut :

RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

d. restart service apache

service httpd start
chkconfig –level 235 httpd on

e. test squrle

http://serverip/webmail

kemudian ntar masukan username + password yg sudah di buat di atas
misal user : bobby pass:12345