在CentOS5中安裝Qmail商業郵件系統
chengkinhung
|
21#
chengkinhung 发表于 2007-07-26 08:56
===============================================================================
4) 配置自动启动脚本: =============================================================================== 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; 测试连接: telnet localhost 143 ------------------------------------------------------------------------------- vi /etc/rc.d/rc.local; #请在authdaemond后面加入下面两行: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /usr/local/sbin/authdaemond start /etc/rc.d/init.d/imap start /etc/rc.d/init.d/imaps start ------------------------------------------------------------------------------- 请注意: Courier-IMAP does not use inetd or xinetd. Any inetd or xinetd configuration settings for the IMAP and POP3 ports must be turned off. Courier-IMAP will not start if inetd or xinetd is listening for IMAP or POP3 connections. =============================================================================== =============================================================================== 5) 安装sqwebmail(webmail): =============================================================================== 参考网站: http://www.courier-mta.org/sqwebmail/ 下载资源: http://www.courier-mta.org/download.php#sqwebmail cd /usr/local/src/qmail/courier/; wget http://prdownloads.sourceforge.n ... bmail-5.1.5.tar.bz2; 或者下載最新版本: wget http://prdownloads.sourceforge.n ... bmail-5.1.6.tar.bz2; tar jxvf sqwebmail-5.1.6.tar.bz2; cd sqwebmail-5.1.6; ------------------------------------------------------------------------------- 設定環境參數: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - INCS=-I/usr/include/mysql; export INCS; LIBS='-L/usr/lib/mysql -lmysqlclient -lz'; export LIBS; CPPFLAGS=-I/usr/include/mysql; export CPPFLAGS; LDFLAGS=-L/usr/lib/mysql; export LDFLAGS; ------------------------------------------------------------------------------- mkdir /var/www/sqwebmail/; (建立安裝目录) ------------------------------------------------------------------------------- 安装pcre-devel; #sqwebmail编译需要pcre资源,否则报错 ------------------------------------------------------------------------------- yum list | grep pcre; #先检查一下是否已经安装pcre套件 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - pcre.i386 4.5-3.2.RHEL4 installed pcre-devel.i386 4.5-3.2.RHEL4 base - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - yum install pcre-devel; ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- 开始安装: ------------------------------------------------------------------------------- ./configure \ --with-cachedir \ --without-gzip \ --enable-webpass=yes \ --enable-softtimeout=1800 \ --enable-autopurge=7 \ --enable-maxpurge=90 \ --enable-unicode \ --enable-cgibindir=/var/www/cgi-bin \ --prefix=/var/www/sqwebmail \ --enable-imagedir=/var/www/html/images/sqwebmail \ --enable-imageurl=/images/sqwebmail/ \ --with-maxargsize=20971520 \ --with-maxformargsize=20971520 \ --with-maxmsgsize=20971520 \ --without-ispell \ --with-authshadow \ --without-authmysql \ --with-authldap \ --with-authuserdb \ --with-authpwd \ --without-authpam \ --with-authvchkpw \ --without-authdaemon make configure-check; make; make check; make install-strip; # Do a make install if this doesn't work make install-configure; # Install configuration files 检查安装生成的相关目录和权限是否正确: ll /var/www/sqwebmail/; #这是程序主目录 ll /var/www/cgi-bin/sqwebmail; #这是web界面的cgi程序文件 ll /var/www/html/images/sqwebmail/; #这是web界面的图象资源目录 考虑安全因素,应将sqwebmail的属主设定为vpopmail.vchkpw用户和群组: chown vpopmail.vchkpw /var/www/cgi-bin/sqwebmail; /var/www/sqwebmail/libexec/sqwebmaild.rc start; #启动服务 ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- 设置开机自动启动: ------------------------------------------------------------------------------- vi /etc/rc.d/rc.local; #加入如下一行: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /var/www/sqwebmail/libexec/sqwebmaild.rc start - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- 设置定时执行清理cache的任务: ------------------------------------------------------------------------------- vi /etc/crontab; #加入如下一行: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 20 * * * * root /var/www/sqwebmail/share/sqwebmail/cleancache.pl - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- 测试安装结果: 打開瀏覽器,对应您的域名或者IP地址,输入如下连接: ------------------------------------------------------------------------------- http://xxx.xxx.xxx.xxx/cgi-bin/sqwebmail 注意: 请在[User ID]中输入电邮地址全名,例如postmaster@test.com, 在[Password]中 输入此邮件用户帐号的密码. ------------------------------------------------------------------------------- =============================================================================== =============================================================================== 6) 安装maildrop(mail delivery agent with filtering abilities): =============================================================================== maildrop是Courier mail server的一部分,用于Courier Mail Server的邮件过滤发送代理, 它可用来替代procmail作为本地邮件的发送代理.如果你想使用sqwebmail的郵件過濾(mail filtering),你就必須安裝maildrop作為傳輸代理. 绝大多数用户使用maildrop都是因为其 过滤能力强,过滤语言灵活,支持Quota,并且可与MySQL/LDAP及小型dbm对接,可外挂各种程序, 如SpamAssassin和杀毒软件,甚至SMS等,实现复杂的功能. (例如在本安裝系统后面將會安装 Qmail-Scanner就要使用Maildrop中的reformmime功能) 参考网站: http://www.courier-mta.org/maildrop/ 下载资源: http://www.courier-mta.org/download.php#maildrop cd /usr/local/src/qmail/courier; wget http://prdownloads.sourceforge.net/courier/maildrop-2.0.3.tar.bz2; 或者下載最新版本: wget http://prdownloads.sourceforge.net/courier/maildrop-2.0.4.tar.bz2; tar jxvf maildrop-2.0.4.tar.bz2; cd maildrop-2.0.4; ./configure \ --enable-maildirquota; make; make install-strip; #If make install-strip fails, try make install. make install-man; # cd ..; /usr/local/bin/maildrop -v; #检查安装结果 ------------------------------------------------------------------------------- maildrop 2.0.4 Copyright 1998-2005 Double Precision, Inc. GDBM extensions enabled. Courier Authentication Library extension enabled. Maildir quota extension enabled. This program is distributed under the terms of the GNU General Public License. See COPYING for additional information. ------------------------------------------------------------------------------- 请注意: 如果没有出现"Courier Authentication Library extension enabled",说明你的 maidrop还不支持courier auth,请检查原因(可試試指定authlib路径)再重新编译. =============================================================================== |