一、 安裝配置Sendmail<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
//-------------------------郵件服務器主程序sendmail和配置工具-------------------------//
#rpm -ivh sendmail-<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />8.12.8-4.i386.rpm
#rpm -ivh m4-1.4.1-13.i386.rpm
#rpm -ivh sendmail-cf-8.12.8-4.i386.rpm
#rpm -ivh sendmail-doc-8.12.8-4.i386.rpm
//簡單配置
#vi /etc/mail/sendmail.cf
O DaemonPortOptions=Port=smtp,Addr=127.0.0.1,Name=MTA
O DaemonPortOptions=Port=smtp,Addr=127.0.0.1,Name=MTA //添加此句
//啓動服務器
#service sendmail start
//檢驗sendmail是否啓動
#pstree|grep sendmail
|-2*[sendmail] //表示成功啓動
//-------------------------IMAP協議---POP3協議模塊----------------------//
#rpm -ivh imap-2001a-18.i386.rpm
//修改imap和pop3的配置
#vi /etc/xinetd.d/ipop3
disable=yes 改爲 disable=no
#vi /etc/xinetd.d/imap
disable=yes 改爲 disable=no
#vi /etc/xinetd.d/ipop2
disable=yes 改爲 disable=no
#vi /etc/xinetd.d/pop3s
disable=yes 改爲 disable=no
#vi /etc/xinetd.d/imaps
disable=yes 改爲 disable=no
//重新啓動xinetd
#service xinetd restart
//-------------------------繼續配置sendmail------------ local-host-names ----------//
#vi /etc/mail/local-host-names
//內容如下
nihao.dlut.edu.cn
Nihao.dlut.edu.cn
localhost
localhost.localdomain
[127.0.0.1]
[202.118.75.92] //註釋:nihao.dlut.edu.cn的IP地址就是202.118.75.92
#service sendmail restart //重新啓動sendmail
//--------------------------修改access文件---------------------------------------//
//文件內容如下
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
nihao.dlut.edu.cn OK
263.com RELAY
163.com RELAY
#cd /etc/mail
#makemap hash access.db < access //生成數據庫
//添加用戶
#useradd 用戶名
#passwd 用戶名 //設置其密碼
/////////////////////////////////至此SendMail配置結束//////////////////////////////////////////
二、安裝配置OpenMail
//-------------------------------接下來配置Web界面-----OpenMail-------------------------------//
// Open WebMail 安裝需求:
//1、支援 CGI 的 Web server;2、Perl 5.005 以上 (需有 suid perl 支援) ;3、CGI.pm-2.74.tar.gz (必要) ;
//4、MIME-Base64-2.12.tar.gz (必要) ;5、libnet-1.0901.tar.gz (必要) ;6、Text-Iconv-1.2.tar.gz (必要) 。
//2.1安裝 CGI.pm 套件
cd /tmp
tar -zxvf CGI.pm-2.74.tar.gz
cd CGI.pm-2.74
perl Makefile.PL
make
make install
//2.2安裝 MIME-Base64 套件
cd /tmp
tar -zxvf MIME-Base64-2.12.tar.gz
cd MIME-Base64-2.12
perl Makefile.PL
make
make install
//2.3安裝 libnet 套件
cd /tmp
tar -zxvf libnet-1.0901.tar.gz
cd libnet-1.0901
perl Makefile.PL //註釋:ans 'no' if asked to update configuration)
make
make install
//2.4安裝perl-Text-Iconv
rpm -Uvh --force perl-Text-Iconv-1.2-RH80.i386.rpm
//2.5 安裝perl-CGI
rpm -Uvh --force perl-CGI-2.752-34.99.6.i386.rpm
//2.6 安裝suidperl
rpm -Uvh --force perl-suidperl-5.8.0-55.i386.rpm
//--------------------------------安裝 Open WebMail----------------------------------//
#rpm -ivh openwebmail-2.32-1.i386.rpm
//將網頁文件移至/var/www/html目錄裏
#mv /var/www/data/openwebmail /var/www/html/
#cd /var/www/cgi-bin/openwebmail
#./openwebmail-tool.pl --init //初始化 Open WebMail
#/etc/init.d/xinetd restart //重啓服務器
在瀏覽器中瀏覽http://your_server_hostname/cgi-bin/openwebmail/openwebmail.pl進行測試
可以用netstat –l 命令來查看端口的檢測情況