2008年8月1日 星期五

郵件伺服器Part-5:OpenWebMail

前情提要:郵件伺服器 Part-4:MailWatch

系統使用CentOS 5.1
郵件伺服器全系列:Postfix+Dovecot+SASL+Procmail+Postgrey+Mailscanner+Spamassassin+ClamAV+Mailscanner-mrtg+MailWatch+Openwebmail+MySPAM

OpenWebMail為一功能強大的網頁郵件程式,可提供使用在無郵件軟體時,可以瀏覽器收發郵件。

1.安裝apache2
yum install httpd mod_ssl
chkconfig httpd on
service httpd start

2.安裝相關元件
yum install perl-suidperl gcc gcc-c++ elinks

3.下載openwebmail元件
cd /var/www
elinks turtle.ee.ncku.edu.tw/openwebmail/download/current
下載openwebmail-current.tar.gz

cd /usr/local/src
elinks turtle.ee.ncku.edu.tw/openwebmail/download/packages
下載CGI.pm-3.05.tar.gz
MIME-Base64-3.01.tar.gz
Text-Iconv-1.2.tar.gz
libiconv-1.9.1.tar.gz
libnet-1.19.tar.gz

4.安裝CGI.pm套件
cd /usr/local/src
tar -zxvf CGI.pm-3.05.tar.gz
cd CGI.pm-3.05
perl Makefile.PL
make
make install

5.安裝MIME-Base64套件
cd /usr/local/src
tar -zxvf MIME-Base64-3.01.tar.gz
cd MIME-Base64-3.01
perl Makefile.PL
make
make install

6.安裝libnet套件
cd /usr/local/src
tar -zxvf libnet-1.19.tar.gz
cd libnet-1.19
perl Makefile.PL (詢問時回答no)
make
make install

7.安裝Text-Iconv-1.2套件
cd /usr/local/src
tar -zxvf libiconv-1.9.1.tar.gz
cd libiconv-1.9.1
./configure
make
make install

cd /usr/local/src
tar -zxvf Text-Iconv-1.2.tar.gz
cd Text-Iconv-1.2
perl Makefile.PL
make
make test
make install

8.解壓縮openwebmail
cd /var/www
tar -zxvBpf openwebmail-current.tar.gz
mv data/openwebmail html/
rm -rf openwebmail-current.tar.gz data

9.修改openwebmail密碼檔
cd /var/www/cgi-bin/openwebmail
cp etc/defaults/auth_unix.conf etc/auth_unix.conf
vim etc/auth_unix.conf

passwdfile_encrypted /etc/shadow
passwdmkdb none

10.修改openwebmail安裝設定檔
vim etc/openwebmail.conf

mailspooldir /var/spool/mail
ow_cgidir /var/www/cgi-bin/openwebmail

ow_htmldir /var/www/html/openwebmail
ow_htmlurl /openwebmail

spellcheck /usr/bin/ispell

11.初始化openwebmail
cd /var/www/cgi-bin/openwebmail/
cp etc/defaults/dbm.conf etc/
vim etc/dbm.conf

dbm_ext .db
dbmopen_ext .db
dbmopen_haslock no

/var/www/cgi-bin/openwebmail/openwebmail-tool.pl --init
cp /var/www/cgi-bin/openwebmail/misc/patches/iconv.pl.fake /var/www/cgi-bin/openwebmail/shares/iconv.pl

chown -R root:root /var/www/html/
chown -R root:root /var/www/cgi-bin/
chmod -R 777 /var/www/cgi-bin/openwebmail/etc/sessions

12.修改suidperl
cd /var/www/cgi-bin/openwebmail
perl misc/tools/wrapsuid/wrapsuid.pl /var/www/cgi-bin/openwebmail/
chmod 4555 /usr/bin/suidperl

13.新增openwebmail log
touch /var/log/openwebmail.log
chown root:apache /var/log/openwebmail.log

14.重新啟動apache2
service httpd restart

15.修改index
cp /var/www/html/openwebmail/redirect.html /var/www/html/index.html


下集預告:郵件伺服器 Part-6:MySPAM

0 意見:

##EasyReadMore##