Chinaunix首页 | 论坛 | 博客
  • 博客访问: 180903
  • 博文数量: 32
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 290
  • 用 户 组: 普通用户
  • 注册时间: 2004-10-16 12:00
文章分类

全部博文(32)

分类: LINUX

2007-12-03 21:07:15

虽然现在已经不做系统管理员了,但是这篇笔记作得挺详细,
不仅具有纪念意义,还具有相当的实际意义,
我曾按这里叙述的方法安装过qmail三、四次,
有安装在公网服务器上的,也有安装在局域网中的内部邮件服务器,屡试不爽:)

安装步骤:
----------------------------------------------(一)-------------------------------------------------------------
qmail: (1.03)

按照Life with Qmail文档安装



----------------------------------------------(二)---------------------------------------------------------------
vpopmail: (5.4.6)

1) 添加用户和组:

# groupadd vchkpw
# useradd -g vchkpw vpopmail -d /opt/vpopmail

2) 创建tcp.smtp文件(或者使用/etc/tcp.smtp)

# mkdir ~vpopmail/etc
# cat > ~vpopmail/etc/tcp.smtp << "EOF"
127.0.0.1:allow,RELAYCLIENT=""
:allow
EOF
# cd ~vpopmail/etc
# tcprules tcp.smtp.cdb tcp.smtp.tmp < tcp.smtp

3) 编译安装vpopmail

# ./configure --enable-passwd=y --disable-clear-passwd --enable-qmaildir=/opt/qmail \
      --prefix=/opt/vpopmail
# make
# make install-strip

4) 管理

* 建立虚拟域
#cd /home/vpopmail/bin
# ./vadddomain nevertell.name
系统会提醒你输入这个域的管理员的密码。然后程序会修改下面一些必要的qmail配置文件 来使得qmail能支持这个新的域:
/var/qmail/control/locals
/var/qmail/control/rcpthosts
/var/qmail/control/virtualdomains
/var/qmail/users/assign
/var/qmail/users/cdb
然后就可以增加/删除用户/改变用户密码
* 增加用户
# cd /home/vpopmail/bin
# ./vadduser user@nevertell.name
系统会提示输入密码
* 删除用户
# cd /home/vpopmail/bin
# ./deluser user@nevertell.name
* 改变用户密码
# cd /home/vpopmail/bin
# ./vpasswd user@nevertell.name


----------------------------------------------(三)-----------------------------------------------------------------
courier-imap: (3.0.8)

./configure  --disable-root-check --prefix=/opt/courier-imap --without-ipv6 \
      --enable-unicode=utf-8,iso-8859-1,gb2312


----------------------------------------------(四)-------------------------------------------------------------
wwwMail:
(这是以前公司自己开发的一个qmail的web前端,支持apache+php+imap。)
(目前有很多开源的webmail可以用,以下记录的实际上是apache服务器及相关支持的安装过程)

******************************************************************* php+imap需要的支持
wget ftp://ftp.cac.washington.edu/imap/imap-2004d.tar.Z
make slx                                                 *** 编译之前要修改两个文件:
cp c-client/c-client.a /usr/local/lib/libc-client.a      ***    ./Makefile
cp c-client/rfc822.h /usr/local/include/                 ***    ./src/osdep/unix/Makefile
cp c-client/mail.h /usr/local/include/                   *** 改SSLTYPE=none
cp c-client/linkage.h /usr/local/include/
*********************************************************************
apache: (1.3.31)
./configure --prefix=/opt/apache_mail
*********************************************************************
php: (4.1.2)
./configure --prefix=/opt/php_mail --without-mysql --with-imap --with-apache=../apache_1.3.31
make
make install
***********************************************************************
cd ../apache-1.3.31
 ./configure --activate-module=src/modules/php4/libphp4.a --prefix=/opt/apache_mail
make
make install


----------------------------------------------(End)-----------------------------------------------------------------

_________________

附:wwwMail安装过程笔录:

编译php的时候:

---------------------------------------------------------------------------------------------------
首先出现错误一:(php4.3.9)
# ./configure --prefix=/opt/php_mail --without-mysql --with-imap --with-apache=../apache_1.3.31
...
checking for IMAP support... yes
configure: error: Cannot find rfc822.h. Please check your IMAP installation

解决:
wget
make slx
cp c-client/c-client.a /usr/local/lib/libc-client.a
cp c-client/rfc822.h /usr/local/include/
cp c-client/mail.h /usr/local/include/
cp c-client/linkage.h /usr/local/include/


------------------------------------------------------------------------------------------------------
重编译出现错误二:(php4.3.9)
# ./configure --prefix=/opt/php_mail --without-mysql --with-imap --with-apache=../apache_1.3.31
...
checking for IMAP support... yes
checking for pam_start in -lpam... yes
checking for crypt in -lcrypt... yes
checking whether SSL libraries are needed for c-client... no
checking whether IMAP works... no
configure: error: build test failed. Please check the config.log for details.


------------------------------------------------------------------------------------------------------
改用php4.1.2:
# ./configure --prefix=/opt/php_mail --without-mysql --with-imap --with-apache=../apache_1.3.31
...
checking for IMAP support... yes
checking for pam_start in -lpam... no
checking for crypt in -lcrypt... (cached) yes
configure: error: This c-client library is build with SSL support.

Add --with-imap-ssl<=DIR> to your configure line. Check config.log for details.


---------------------------------------------------------------------------------------------------------
于是使用编译参数:--with-imap-ssl
# ./configure --prefix=/opt/php_mail --without-mysql --with-imap-ssl --with-apache=../apache_1.3.31
...
编译通过
但打开并没有看见imap项
说明php安装过程未结合imap


-----------------------------------------------------------------------------------------------------------
最后:
进入imap-2004d目录,修改两个文件:
./Makefile 和 ./src/osdep/unix/Makefile
改其中的 SSLTYPE=nopwd 为 SSLTYPE=none

重编译安装libc-client:
make slx
cp c-client/c-client.a /usr/local/lib/libc-client.a
cp c-client/rfc822.h /usr/local/include/
cp c-client/mail.h /usr/local/include/
cp c-client/linkage.h /usr/local/include/

清理系统并重编译安装php:(4.1.2)
./configure --prefix=/opt/php_mail --without-mysql --with-imap --with-apache=../apache_1.3.31

一切正常。


------------------------------------------------------------------------------------------------------------

阅读(3219) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~