By Natajaya contribute Zaidi
Paket yang dibutuhkan :
qmail-1.03-tar.gz
daemontools-0.76.tar.gz
ucspi-tcp-0.88.tar.gz
vpopmail-5.4.13.tar.gz
courier-authlib-0.55.tar.bz2
courier-imap-4.0.2.tar.bz2
courierpassd-1.1.0-RC1.tar.gz
squirrelmail-1.4.10a.tar.bz2
qmail-1.03.errno.patch
daemontools-0.76.errno.patch
Persiapan !!!
create user-user untuk qmail
groupadd nofiles
groupadd vchkpw
mkdir /var/qmail
useradd -g nofiles -d /var/qmail/alias alias
useradd -g nofiles -d /var/qmail qmaild
useradd -g nofiles -d /var/qmail qmaill
useradd -g nofiles -d /var/qmail qmailp
groupadd qmail
useradd -g qmail -d /var/qmail qmailq
useradd -g qmail -d /var/qmail qmailr
useradd -g qmail -d /var/qmail qmails
useradd -g vchkpw -u 89 vpopmail
1.Buat direktori src
# mkdir -p /usr/local/src
download semua file tersebut di atas lalu copy kan ke direktori /usr/local/src
# cd /usr/local/src
tar -zxvf qmail-1.03.tar.gz
tar -zxvf ucspi-tcp-0.88.tar.gz
tar -zxvf vpopmail-5.4.13.tar.gz
2.Buat symlink direktori /usr/share/man ke /var/qmail
# ln -s /usr/share/man /var/qmail/man
3.Compile Qmail dan membuat qmail basic configuration
# cd /usr/local/src/qmail-1.03
patch < ../qmail-1.03.errno.patch
make setup check
# ./config-fast mail.zaidi.com
PERHATIKAN............!!!!!!!!!!!! // dalam pelajaran tadi linuxindo.tux
" Catatan = mail.zaidi.com sesuaikan dengan FQDN "
4.Compile ucspi-tcp
# cd ../ucspi-tcp-0.88
edit file conf-cc, dant ambahkan di baris gcc -02, menjad seperti di bawah ini
# vi conf-cc
gcc -O2 -include /usr/include/errno.h
# make
# make setup check
5.Compile daemontools
mkdir /package
cp /usr/local/src/daemontools-0.76.tar.gz /package
cd /package
tar -zxvf daemontools-0.76.tar.gz
cd admin/daemontools-0.76/src
patch < /usr/local/src/daemontools-0.76.errno.patch
cd ..
package/install
check apakah svscan sudah jalan apa belum
# ps aux | grep svscan // tanpa aux ?
root 1647 0.0 0.1 1416 324 ? S 00:34 0:00 svscan /service
root 23147 0.0 0.2 1800 616 pts/0 S 06:24 0:00 grep svscan
6.copy file /var/qmail/boot/home ke /var/qmail/rc
# cp /var/qmail/boot/home /var/qmail/rc
lalu edit file /var/qmail/rc sehingga menjadi :
# vi /var/qmail/rc
#!/bin/sh
####################### begin script ################################
# Using splogger to send the log through syslog.
# Using qmail-local to deliver messages to ~/Mailbox by default.
exec env - PATH="/var/qmail/bin:$PATH" \
qmail-start ./Maildir/
####################### end script #################################
# chmod 755 /var/qmail/rc
8.Create qmailctl
# vi /var/qmail/bin/qmailctl
###################### begin script ###############################
# For Red Hat chkconfig
# chkconfig: - 30 80
# description: the qmail MTA
PATH=/var/qmail/bin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin
export PATH
QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
case "$1" in
start)
echo "Starting qmail"
if svok /service/qmail-send ; then
svc -u /service/qmail-send
else
echo qmail-send service not running
fi
if svok /service/qmail-smtpd ; then
svc -u /service/qmail-smtpd
else
echo qmail-smtpd service not running
fi
if [ -d /var/lock/subsys ]; then
touch /var/lock/subsys/qmail
fi
if svok /service/qmail-pop3d ; then
svc -u /service/qmail-pop3d
else
echo qmail-pop3d service not running
fi
;;
stop)
echo "Stopping qmail..."
echo " qmail-smtpd"
svc -d /service/qmail-smtpd
echo " qmail-send"
svc -d /service/qmail-send
if [ -f /var/lock/subsys/qmail ]; then
rm /var/lock/subsys/qmail
fi
echo " qmail-pop3d"
svc -d /service/qmail-pop3d
;;
stat)
svstat /service/qmail-send
svstat /service/qmail-send/log
svstat /service/qmail-smtpd
svstat /service/qmail-smtpd/log
svstat /service/qmail-pop3d
svstat /service/qmail-pop3d/log
qmail-qstat
;;
doqueue|alrm|flush)
echo "Sending ALRM signal to qmail-send."
svc -a /service/qmail-send
;;
queue)
qmail-qstat
qmail-qread
;;
reload|hup)
echo "Sending HUP signal to qmail-send."
svc -h /service/qmail-send
;;
pause)
echo "Pausing qmail-send"
svc -p /service/qmail-send
echo "Pausing qmail-smtpd"
svc -p /service/qmail-smtpd
echo "Pausing qmail-pop3d"
svc -p /service/qmail-pop3d
;;
cont)
echo "Continuing qmail-send"
svc -c /service/qmail-send
echo "Continuing qmail-smtpd"
svc -c /service/qmail-smtpd
echo "Continuing qmail-pop3d"
svc -c /service/qmail-pop3d
;;
restart)
echo "Restarting qmail:"
echo "* Stopping qmail-smtpd."
svc -d /service/qmail-smtpd
echo "* Sending qmail-send SIGTERM and restarting."
svc -t /service/qmail-send
echo "* Restarting qmail-smtpd."
svc -u /service/qmail-smtpd
echo "* Restarting qmail-pop3d."
svc -t /service/qmail-pop3d
;;
cdb)
tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
chmod 644 /etc/tcp.smtp.cdb
echo "Reloaded /etc/tcp.smtp."
tcprules /etc/tcp.pop3.cdb /etc/tcp.pop3.tmp < /etc/tcp.smtp
chmod 644 /etc/tcp.pop3.cdb
echo "Reloaded /etc/tcp.pop3."
;;
help)
cat <
start -- starts mail service (smtp connection accepted, mail can go out)
pause -- temporarily stops mail service (connections accepted, nothing leaves)
cont -- continues paused mail service
stat -- displays status of mail service
cdb -- rebuild the tcpserver cdb file for smtp
restart -- stops and restarts smtp, sends qmail-send a TERM & restarts it
doqueue -- sends qmail-send ALRM, scheduling queued messages for delivery
reload -- sends qmail-send HUP, rereading locals and virtualdomains
queue -- shows status of queue
alrm -- same as doqueue
flush -- same as doqueue
hup -- same as reload
HELP
;;
*)
echo "Usage: $0 {start|stop|restart|doqueue|flush|reload|stat|pause|cont|cdb|queue|help}"
exit 1
;;
esac
exit 0
####################################### end script ##########################################
# chmod 755 /var/qmail/bin/qmailctl
ln -s /var/qmail/bin/qmailctl /usr/local/sbin
ln -s /var/qmail/bin/qmailctl /etc/rc.d/init.d/qmail
# ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc0.d/K30qmail //dapat dng chkconfig -level 2345 qmail on
# ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc1.d/K30qmail
# ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc2.d/S80qmail
# ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc3.d/S80qmail
# ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc4.d/S80qmail
# ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc5.d/S80qmail
# ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc6.d/K30qmail
9.Create direktori /var/qmail/supervise
mkdir -p /var/qmail/supervise/qmail-send/log
mkdir -p /var/qmail/supervise/qmail-smtpd/log
chmod +t /var/qmail/supervise/qmail-send
chmod +t /var/qmail/supervise/qmail-smtpd
10.Create file /var/qmail/supervise/qmail-send/log/run
# vi /var/qmail/supervise/qmail-send/log/run
#!/bin/sh
############################### begin #############################################
# script /var/qmail/supervise/qmail-send/log/run
exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t /var/log/qmail
############################## end script ##########################################
# chmod 755 /var/qmail/supervise/qmail-send/log/run
11.Create file /var/qmail/supervise/qmail-send/run
# vi /var/qmail/supervise/qmail-send/run
#!/bin/sh
#######################################
# /var/qmail/supervise/qmail-send/run #
#######################################
exec /var/qmail/rc
# chmod 755 /var/qmail/supervise/qmail-send/run
12.Create ConcurencyIncoming
echo 20 > /var/qmail/control/concurrencyincoming
chmod 644 /var/qmail/control/concurrencyincoming
13.Create script /var/qmail/supervise/qmail-smptd/run
# vi /var/qmail/supervise/qmail-smtpd/run
#!/bin/sh
#################################################
# script /var/qmail/supervise/qmail-smtpd/run #
#################################################
QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
exec /usr/local/bin/softlimit -m 2000000 \
/usr/local/bin/tcpserver -v -R -l 0 -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \
-u "$QMAILDUID" -g "$NOFILESGID" 0 smtp /var/qmail/bin/qmail-smtpd 2>&1
# chmod 755 /var/qmail/supervise/qmail-smtpd/run
Create script /var/qmail/supervise/qmail-smtpd/log/run
# vi /var/qmail/supervise/qmail-smtpd/log/run
#!/bin/sh
# script /var/qmail/supervise/qmail-smtpd/log/run
exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t /var/log/qmail/smtpd
# chmod 755 /var/qmail/supervise/qmail-smtpd/log/run
14.Create direktori log untuk qmail
mkdir -p /var/log/qmail/smtpd
chown -R qmaill /var/log/qmail
15.link service ke /service
# ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service
lalu buat aturan relay
echo '127.:allow,RELAYCLIENT=""' > /etc/tcp.smtp
qmailctl cdb
install telnet dulu
# urpmi telnet
LALU CEK APAKAH SMTP sudah jalan apa belum dengan cara
# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mail.zaidi.com ESMTP
16.install vpopmail
# mkdir -p /home/vpopmail
chown -R vpopmail.vchkpw /home/vpopmail
cd /usr/local/src/vpopmail-5.4.13
./configure --enable-tcprules-prog=/usr/local/bin/tcprules --enable-tcpserver-file=/etc/tcp.smtp --enable-roaming-users=y --enable-relay-clear-minutes=60
make
make install-strip
17.Create direktori /var/qmail/supervise/qmail-pop3d/log
# mkdir -p /var/qmail/supervise/qmail-pop3d/log
18.create script /var/qmail/supervise/qmail-pop3d/run
# vi /var/qmail/supervise/qmail-pop3d/run
#!/bin/sh
#script /var/qmail/supervise/qmail-pop3d/run
# PERHATIKAN !!!!!!!!!!!!!
# FQDN sesuaikan dengan keadaan anda misal mail.zaidi.linux // linuxindo.tux
MAXPOP3D=`head -1 /var/qmail/control/concurrencypop3`
exec /usr/local/bin/softlimit -m 2000000 \
/usr/local/bin/tcpserver -v -R -H -l 0 -x /etc/tcp.pop3.cdb -c "$MAXPOP3D" \
0 110 /var/qmail/bin/qmail-popup \
FQDN /home/vpopmail/bin/vchkpw /var/qmail/bin/qmail-pop3d Maildir 2>&1
# chmod 755 /var/qmail/supervise/qmail-pop3d/run
19.create script /var/qmail/supervise/qmail-pop3d/log/run
# vi /var/qmail/supervise/qmail-pop3d/log/run
#!/bin/sh
#/script var/qmail/supervise/qmail-pop3d/log/run
exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t \
/var/log/qmail/pop3d
# chmod 755 /var/qmail/supervise/qmail-pop3d/log/run
20.create /var/qmail/control/concurrencypop3
# echo 20 > /var/qmail/control/concurrencypop3
21.create script /etc/tcp.pop3
# vi /etc/tcp.pop3
192.168.:allow
127.:allow
:deny
22.
chmod +t /var/qmail/supervise/qmail-pop3d
mkdir -p /var/log/qmail/pop3d
chown qmaill /var/log/qmail/pop3d
ln -s /var/qmail/supervise/qmail-pop3d /service
# crontab -e
40 * * * * /home/vpopmail/bin/clearopensmtp 2>&1 > /dev/null
CEK APAKAH POP3 SERVERNYA SUDAH JALAN APA BELUM...
# telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
+OK <3983.1042052657@mail.nata.com>
23. Langkah selanjutnya adalah membuat domain beserta user-usernya, contohnya kita akan membuat domain zaidi.com dengan user-usernya yaitu rafid (rafid@zaidi.com) dan joe (joe@zaidi.com)..
CATATAN = "DOMAIN TERSEBUT SUDAH HARUS TERDAFTAR DI DNS SERVER"
# /home/vpopmail/bin/vadddomain zaidi.com
Please enter password for postmaster:
enter password again:
#/home/vpopmail/bin/vadduser rafid@zaidi.com
Please enter password for rafid@zaidi.com:
enter password again:
#/home/vpopmail/bin/vadduser joea@zaidi.com
Please enter password for joe@zaidi.com:
enter password again:
24. Lalu coba kirim email ke salah satu user yang telah kita buat tetapi sebelumnya
# ln -s /var/qmail/bin/sendmail /usr/sbin
# mail rafid@zaidi.com
Subject: test
ya..test aja deh..
.
Cc:
Setelah itu coba cek email yang masuk untuk user rafid@zaidi.com
# telnet mail.zaidi.com 110
Trying 192.168.1.1...
Connected to mail.zaidi.com (192.168.1.1).
Escape character is '^]'.
+OK <4948.1042053625@mail.zaidi.com>
user rafid@zaidi.com
+OK
pass rafid
+OK
list
+OK
1 292
.
retr 1
+OK
Return-Path:
Delivered-To: rafid@zaidi.com
Received: (qmail 4930 invoked by uid 0); 8 Jan 2002 19:20:12 -0000
Date: 8 Jan 2002 19:20:12 -0000
Message-ID: <20030108192012.4929.qmail@mail.zaidi.com>
From: nata@mail.zaidi.com
To: rafid@zaidi.com
Subject: test
ya..test aja deh..
.
25.Install courier-authlib // untuk imapnya
# cd /usr/local/src
Install dulu libgdbm nya
# urpmi libgdbm-devel
# tar -jxvf courier-authlib-0.55.tar.bz2
# cd courier-authlib-0.55
# ./configure --prefix=/usr/local --exec-prefix=/usr/local --with-authvchkp --without-authldap --without-authmysql --disable-root-check --with-ssl --with-authchangepwdir=/usr/local/libexec/authlib --with-redhat
# make && make check
# make install-strip && make install-configure
Selanjutnya kita masukan startup script authdaemond di /etc/rc.local
# vi /etc/rc.local
tambahkan baris dibawah ini dalam rc.local
/usr/local/sbin/authdaemond start
26. Install courier-imap
# cd ..
# tar -jxvf courier-imap-4.0.2.tar.bz2
untuk mengcompile courier imap, imap membutuhkan user biasa bukan root, disini kita
menggunkan user student
# chown -R student:wheel courier-imap-4.0.2
# cd courier-imap-4.0.2
# su student
$./configure --prefix=/usr/local --exec-prefix=/usr/local --with-authvchkpw --without-authldap --without-authmysql --disable-root-check --with-ssl --with-authchangepwdir=/usr/local/libexec/authlib --with-redhat
$ make && make check
sekarang kita kembali lagi sebagi user root
$ exit
# make install-strip && make install-configure
# vi /usr/local/etc/imapd.cnf
ubah postmaser@example.com sesusai dengan email anda, misalkan postmaster@zaidi.com
# vi /usr/local/etc/imapd
pastikan configurasi ini harus ada : IMAPDSTART=YES // cari file ini
# vi /usr/local/etc/authlib/authdaemonrc
pastikan setting authmodulelist hanya authvchkpw, seperti ini :
authmodulelist="authvchkpw"
cp /usr/local/libexec/imapd.rc /etc/rc.d/init.d/imap
cp /usr/local/libexec/imapd-ssl.rc /etc/rc.d/init.d/imaps
/usr/local/sbin/authdaemond stop
/usr/local/sbin/authdaemond start
/etc/rc.d/init.d/imap stop
/etc/rc.d/init.d/imaps stop
/etc/rc.d/init.d/imap start
/etc/rc.d/init.d/imaps start
test dengan perintah nmap localhost, apabila telihat port 143 dan 993 berarti udah jalan imap servernya
# nmap localhost
// jika belum ada install dulu urpmi nmap
27. Install Courierpass, supaya user dapat merubah passwordnya sendiri
# cd ..
# tar -zxvf courierpassd-1.1.0-RC1.tar.gz
# cd courierpassd-1.1.0-RC1
# ./configure
# make && make install
# urpmi xinetd
# cd /etc/xinetd.d
# vi courierpassd
masukkan script di bawah ini :
service courierpassd
{
port = 106
socket_type = stream
protocol = tcp
user = root
server = /usr/local/sbin/courierpassd
server_args = -s imap
wait = no
only_from = 127.0.0.1
instances = 4
disable = no
}
# vi /etc/services
tambah kan option ini dibawah ini dalam service, dan supaya seragam portnya di bawah 105
courierpassd 106/tcp #for /etc/xinetd.d/courierpassd
# /etc/rc.d/init.d/xinetd restart
// tadi yang ini dilewat
install apache dulu
# urpmi apache apache-mod_php
lalu start apachenya
service http restart
28. Install Squirrelmail
cd /usr/local/src
cp squirrelmail-1.4.10a.tar.bz2 /var/www/html
cd /var/www/html/
tar -jxvf squirrelmail-1.4.10a.tar.bz2
mv squirrelmail-1.4.10a webmail
cd webmail
mkdir /var/sqattachements
chown -R apache:apache /var/sqattachements
chown -R apache:apache data
cd config
./conf.pl
tampilan serverti dibawa ini
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages
D. Set pre-defined settings for specific IMAP servers
C Turn color on
S Save data
Q Quit
Command >>
pilih 2
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings
General
-------
1. Domain : 192.168.5.158 ( diganti dengan IP anda )
2. Invert Time : false
3. Sendmail or SMTP : SMTP
A. Update IMAP Settings : localhost:143 (other)
B. Update SMTP Settings : localhost:25
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >>
pilih A
IMAP Settings
--------------
4. IMAP Server : localhost
5. IMAP Port : 143
6. Authentication type : login
7. Secure IMAP (TLS) : false
8. Server software : other
9. Delimiter : detect
pilih B
SMTP Settings
-------------
4. SMTP Server : localhost
5. SMTP Port : 25
6. POP before SMTP : false
7. SMTP Authentication : none
8. Secure SMTP (TLS) : false
9. Header encryption key :
pilih R
selanjutnya pilih 4
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
General Options
1. Data Directory : /var/www/html/webmail/data/ // ubah ini
2. Attachment Directory : /var/sqattachements/ //ubah ini
3. Directory Hash Level : 0
4. Default Left Size : 150
5. Usernames in Lowercase : false
6. Allow use of priority : true
7. Hide SM attributions : false
8. Allow use of receipts : true
9. Allow editing of identity : true
Allow editing of name : true
Remove username from header : false
10. Allow server thread sort : false
11. Allow server-side sorting : false
12. Allow server charset search : true
13. Enable UID support : true
14. PHP session name : SQMSESSID
15. Location base :
pilih s
pilih q
# selanjutnya tinggal buka bowser anda, dan loginlah dengan user yang telah dibuat tadi, misalkan rafid@zaidi.com
http://localhost/webmail
untuk ganti jadi nama
ubah di client
di vi /etc/resolv.conf
tembak ke ip server 192.168.15.165
mail.linuxindo.tux
sama seperti waktu pertama kali bikin
Lain-lain
beberapa konfigurasi di vi
settingan di client
vi /etc/resolv.conf
nameserver 192.168.5.165
search linuxindo.tux
akses dengan
http://linuxindo.tux/webmail
atau
http://mail.linuxindo.tux/webmail
urpmi apache apache-mod_php
[root@localhost student]# telnet localhost 110
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
+OK <2178.1218657894@mail.linuxindo.tux>
untuk keluar control kurung siku lalu quit
untuk copy file
wget -r -nd -np http://192.168.5.2/apps/qmail-squirrelmail/
lalu hapus
rm * -fr
rm index* -f
finish
No comments:
Post a Comment