Postfix 安装和配置

原创 操作系统

Postfix 安装和配置

其中 蓝色字体需用户输入,白色字体是系统显示,红色字体是我加入的说明.

目录

一、 安装linux系统.. 3

1、 硬件:DELL 2950. 3

2、 软件:Redhat as 4.5. 3

3、 安装软件时不安装所有的服务器选项。.. 3

二、 查看系统信息及所需软件说明.. 3

1、 系统相关.. 3

2、 软件相关.. 4

3、 模块安装.. 5

三、 卸载系统原有组件.. 6

四、 增加系统相关的用户和组.. 8

五、 开始安装.. 8

1、 安装Mysql 9

? 安装.. 9

? 启动及共享链接库.. 9

2、 安装Openssl 10

3、 安装BerkeleyDB. 10

? 安装.. 10

? 禁用和移除旧版本文件.. 11

? 链接新文件到动态库.. 11

4、 安装Apache 11

? 安装.. 11

? 加入到自动运行队列.. 12

5、 安装GD库.. 12

? 安装libpng. 12

? 安装jpeg. 12

? 安装freetype 13

? 安装fontconfig. 13

? 安装xmkmf 13

? 安装xpm. 14

? 安装gd. 14

6、 安装courier-authlib. 14

? 安装.. 14

? 修改配置文件.. 15

? 共享链接库.. 16

? 启动及加入到自动运行队列.. 16

7、 安装SASL. 16

? 安装.. 16

? 共享链接库.. 17

? 启动及加入到自动运行队列.. 18

? 新建配置文件.. 18

8、 安装PHP. 19

? 安装.. 19

? 配置相关文件支持.. 19

? 配置phpmyadmin. 20

9、 安装Postfix. 21

? 安装.. 21

? 建立邮件存放目录及备份旧文件.. 22

? 配置main.cf文件.. 22

? 配置master.cf文件.. 24

? 添加为支持虚拟域和虚拟用户所用到的配置文件.. 27

10、 安装pcre 27

11、 安装zlib. 27

12、 安装courier-imap. 28

? 安装.. 28

? 编辑配置文件启用pop3及imap. 24

? 启动及加入自动运行队列.. 24

13、 maildrop. 29

? 安装.. 29

? 2:配置maildrop的日志文件.. 29

14、 安装clamav. 30

? 安装.. 30

? 新建相关的文件及目录.. 30

? 配置库文件及开机自启动.. 26

? 启动服务及添加自动任务.. 26

15、 安装perl相关组件.. 32

? 安装ghostscript 33

? 安装tiff 33

? 安装html2ps 33

? 安装jasper 33

? 安装ImageMagick. 33

? 错误解决方法:.. 38

16、 安装amavisd. 38

? 安装.. 38

? 配置amavisd.conf文件.. 31

? 测试启动.. 40

? 测试启动spamassassin. 40

? 启动amavis并测试postfix ,正常情况下应出现下面的提示.. 41

? 增加Chinese_rules.cf支持.. 43

17、 安装extmail 43

? 安装extmail 43

? 安装extman. 43

? 设置extmail 43

? 设置extman. 46

? 导入extman数据.. 47

? 建立maildrop日志文件.. 48

? 更改extmail及extman的模板文件,使显示更加人性化.. 48

六、 安装图形日志显示支持.. 48

1、 安装libart 48

2、 安装TCL支持.. 48

3、 安装rrdtool 49

4、 启动图形日志.. 49

七、 进入web页管理.. 49

1、 重新启动服务.. 49

2、 测试.. 49

? 建立域.. 52

? 建立用户.. 53

一、安装linux系统

1、 硬件:DELL 2950

2、 软件:Redhat as 4.5

3、 安装软件时不安装所有的服务器选项。

二、查看系统信息及所需软件说明

1、 系统相关

[root@redhat ~]#hostname //主机名称
redhat.test.com
[root@redhat ~]# cat /proc/version //系统版本
Linux version 2.6.9-5.EL(gcc version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4))
#1 Wed Jan 5 19:22:18 EST 2005
[root@redhat ~]# ifconfig eth0 //IP地址
eth0 Link encap:Ethernet HWaddr 00:0C:29:1D:E1:68
inet addr:192.168.44.80 Bcast:192.168.44.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe1d:e168/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3193 errors:3 dropped:0 overruns:0 frame:0
TX packets:331 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:423261 (413.3 KiB) TX bytes:35564 (34.7 KiB)
Interrupt:10 Base address:0x1400

2、 软件相关

mysql

http://downloads.mysql.com/archives.php?p=mysql-4.1

邮件数据库

openssl

www.openssl.org

提供SSL

BerkeleyDB

http://www.oracle.com/database/berkeley-db.html

安装perl组件及病毒库时的组件

Apache

http://archive.apache.org/dist/httpd/binaries/

Web服务器

libpng

http://www.libpng.org/pub/png/libpng.html

png图片支持

jpeg

ftp://ftp.uu.net/graphics/jpeg/

jpeg图片支持

freetype

http://www.fretype.org

Freetype字体支持

fontconfig

http://www.fontconfig.org

字体配置支持

xpm

http://koala.ilog.fr/ftp/pub/xpm/

xpm图片支持

GD

http://www.boutell.com/gd/

GD库支持

PHP

http://www.php.net

PHP支持

phpMyAdmin

http://sourceforge.net/projects/phpmyadmin/

图形化管理mysql

SASL

http://cyrusimap.web.cmu.edu/downloads.html#sasl

用户认证工具

courier-authlib

www.courier-mta.org/authlib/

用户认证工具

courier-imap

www.courier-mta.org/imap/

imap及pop3工具

pcre

http://www.pcre.org/

pcre支持

clamav

http://sourceforge.net/project/showfiles.php?group_id=86638&package_id=90197

防病毒

perl

http://search.cpan.org/search

perl相关模块

amavisd-new

http://www.ijs.si/software/amavisd/#download

防病毒及防垃圾邮件相关

extmail

http://www.extmail.org/

邮件Web前台

extman

http://www.extmail.org/

邮件Web管理后台

Postfix

ftp://postfix.cn99.com/postfix/index.html

邮件服务器

RRDtool

http://oss.oetiker.ch/rrdtool/pub/?M=D

图形化日志支持工具

SpamAssassin

http://search.cpan.org/

反垃圾邮件工具

libart

http://oss.oetiker.ch/rrdtool/pub/libs/

RRD支持库文件

html2ps

http://user.it.uu.se/~jan /html2ps-1.0b5.tar.gz

ImageMgick所需文件

Jasper

http://www.ece.uvic.ca/ ~mdadams/jasper/software/jasper-1.701.0.zip

ImageMgick所需文件

ImageMagick

http://sourceforge.net/project/showfiles.php? group_id=24099

图片显示支持

3、 模块安装

在http://search.cpan.org/search下载以下perl模块

1

2

3

4

5

BerKeleyDB

Comperss-Raw-zlib

IO-Compress-Base

IO-Compress-Zlib

Compress-Zlib

IO-Zlib

Array-Compcre

Sub-Updevel

Test-Simple

Test-Exception

Tree-Dag-Node

Test-Warn

Net-SsLeay

IO-Socket-SSL

IO-String

Algorithm-Diff

Text-Diff

Archive-Tar

Archive-Zip

DBI

DBD-Mysql

IO-Socket-INET6

IP-country

File-Temp

NetAddr-IP

NET-CIDR-Lite

NET-IP

NET-Ident

Digest-SHA

Digest-SHAL

Digest-HMAC

NET-DNS

Version

NET-DNS-Resolver-Programmable

HTML-Tagset

HTML-Parser

Extutils-CBuilder

Encode-Detect

Extutils-Parsexs

Error

GD

GD-securityImage

GD-securityImage-util

Unix-Syslog

Sys-Hostname-Long

Regexp-Common

URI

Mail-SPF

Mail-SPF-Query

TimeDate

Pod-Escapes

Pod-Simple

Test-Pod

MailTools

Mail-DKIM

Crypt-Openssl-Random

Crypt-Openssl-RSA

Mail-DomainKeys

MIME-Tools

Libww-Perl

SpamAssassin

Convery-TNEF

Convert-UUlib

NET-Server

Time-HiRes

File-Tail

Log-Log4perl

22.1 Socket6-0.19

41.1 PerlMagick

 

三、卸载系统原有组件

因为这里的安装方式都是采用源码,所以如果系统中存在旧有的版本,则会引起冲突,这里要做的是把一些和源码包冲突的软件卸载.

在使用命令进行查询时,当执行完命令后没有提示则表示系统未安装查询的组件,否则请卸载查询出来的组件.

[root@redhat ~]# rpm -qa | grep httpd //查询是否已安装软件
[root@redhat ~]# rpm -qa | grep mysql
[root@redhat ~]# rpm -qa | grep php
[root@redhat ~]# rpm -qa |grep sasl
cyrus-sasl-md5-2.1.19-5.EL4 //系统已安装有软件
cyrus-sasl-2.1.19-5.EL4
cyrus-sasl-plain-2.1.19-5.EL4
cyrus-sasl-devel-2.1.19-5.EL4
[root@redhat ~]# rpm -e --nodeps cyrus-sasl-md5-2.1.19-5.EL4 cyrus-sasl-2.1.19-5.EL4 \
cyrus-sasl-plain-2.1.19-5.EL4 cyrus-sasl-devel-2.1.19-5.EL4 //卸载SASL
[root@redhat ~]# rpm -qa |grep sendmail
sendmail-8.13.1-2
[root@redhat ~]# service sendmail stop
Shutting down sendmail: [ OK ]
Shutting down sm-client: [ OK ]
[root@redhat ~]# rpm -e --nodeps sendmail
[root@redhat ~]#

[root@redhat ~]# rpm -qa |grep perl
perl-HTML-Tagset-3.03-30
perl-XML-Parser-2.34-5
perl-libxml-enno-1.02-31
perl-Digest-HMAC-1.01-13
perl-XML-NamespaceSupport-1.08-6
perl-XML-Twig-3.13-6
perl-XML-LibXML-1.58-1
perl-5.8.5-12
perl-URI-1.30-4
perl-DateManip-5.42a-3
perl-HTML-Parser-3.35-6
perl-libwww-perl-5.79-5
perl-libxml-perl-0.07-30
perl-XML-Encoding-1.01-26
perl-Digest-SHA1-2.07-5
perl-Net-DNS-0.48-1
perl-Convert-ASN1-0.18-3
perl-XML-Grove-0.46alpha-27
perl-LDAP-0.31-5
perl-XML-LibXML-Common-0.13-7
perl-Filter-1.30-6
perl-Parse-Yapp-1.05-32
perl-XML-Dumper-0.71-2
perl-Time-HiRes-1.55-3
perl-XML-SAX-0.12-7
perl-Crypt-SSLeay-0.51-5
[root@redhat ~]# rpm -qa | grep perl > perl
[root@redhat ~]# for i in $(cat perl | grep -v perl-5.8.5-12 ) ; do rpm -e --nodeps $i ;done //卸载perl相关
[root@redhat ~]#

四、增加系统相关的用户和组

[root@redhat ~]# groupadd mysql
[root@redhat ~]# groupadd vmail
[root@redhat ~]# groupadd postfix
[root@redhat ~]# groupadd postdrop
[root@redhat ~]# groupadd amavis
[root@redhat ~]# groupadd clamav
[root@redhat ~]# groupmod -g 1001 vmail
[root@redhat ~]# useradd mysql -g mysql
[root@redhat ~]# useradd vmail -g vmail -u 1001
[root@redhat ~]# useradd postfix -g postfix
[root@redhat ~]# useradd amavis -g amavis
[root@redhat ~]# useradd clamav -g clamav

其中用户和组的作用相信大家看了前面的软件相关大概可以看出其作用了,其中vmail是用来登录Webmail的帐号,

而postdrop则是在邮件中起postdrop的作用.

五、开始安装

1、 安装Mysql

? 安装

[root@redhat ~]# cd /usr/local/src
[root@redhat src]# tar mysql-5.0.41-linux-i686.tar.gz
[root@redhat src]# cp �Cr mysql-5.0.41-linux-i686 /usr/local/mysql
[root@redhat src]# cd /usr/local/mysql/
[root@redhat mysql]# chown -R root . //注意这些地方的点号
[root@redhat mysql]# chown -R mysql data
[root@redhat mysql]# chown -R mysql data/mysql/.
[root@redhat mysql]# chgrp -R mysql .
[root@redhat mysql]# cp ./support-files/my-medium.cnf /etc/my.cnf
[root@redhat mysql]# ./scripts/mysql_install_db --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OK

? 启动及共享链接库

[root@redhat mysql]# bin/mysqld_safe --user=mysql &
[1] 29422
[root@redhat mysql]# Starting mysqld daemon with databases from /usr/local/mysql/data

[root@redhat mysql]#/usr/local/mysql/bin/mysqlshow -p
Enter password: //测试数据库,如有下面显示则表示成功
+--------------------+
| Databases |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
[root@redhat mysql]#
[root@redhat mysql]# echo "/usr/local/mysql/lib" >> /etc/ld.so.conf
[root@redhat mysql]# ldconfig �Cv //加入动态链接库中

3:加入到自动运行队列

[root@redhat mysql]# cp /usr/local/mysql/support-files/mysql.server /etc/rc.d/init.d/mysqld
[root@redhat mysql]# chmod 700 /etc/rc.d/init.d/mysqld
[root@redhat mysql]# chkconfig --add mysqld
[root@redhat mysql]# chkconfig --level 345 mysqld on
[root@redhat mysql]# export PATH=$PATH:/usr/local/mysql/bin //设置mysql的运行路径

2、 安装Openssl

因为Openssl在这里的作用不是很明显,而且系统中默认一般都自带有,所以这里没有采用源码的方式安装,

在这里只是做一次查询,如果想用源码的方式,这个和普通的编译方式一样,没什么特别要求的地方.

[root@redhat src]# rpm -qa |grep ssl
openssl-devel-0.9.7a-43.1
openssl-0.9.7a-43.1
xmlsec1-openssl-1.2.6-3

3、 安装BerkeleyDB

安装这个软件的原因是因为后面的Perl组件包中必须要有它的支持才能进行下去,所以这个是不能省的.

? 安装

[root@redhat src]#tar zxvf db-4.5.20.tar.gz
[root@redhat src]# cd db-4.5.20/build_unix
[root@redhat build_unix]#../dist/configure --prefix=/usr/local/BerkeleyDB
[root@redhat build_unix]#make
[root@redhat build_unix]#make install

? 禁用和移除旧版本文件

[root@redhat build_unix]# mv /usr/include/db4 /usr/include/db4.off
[root@redhat build_unix]# rm /usr/include/db_cxx.h
rm: remove symbolic link `/usr/include/db_cxx.h'? y
[root@redhat build_unix]# rm /usr/include/db.h
rm: remove symbolic link `/usr/include/db.h'? y
[root@redhat build_unix]#rm /usr/include/db_185.h
rm: remove symbolic link `/usr/include/db_185.h'? y
[root@redhat build_unix]#

? 链接新文件到动态库

[root@redhat build_unix]# ln -sv /usr/local/BerkeleyDB/include /usr/include/db4
create symbolic link `/usr/include/db4' to `/usr/local/BerkeleyDB/include'
[root@redhat build_unix]# ln -sv /usr/local/BerkeleyDB/include/db.h /usr/include/db.h
create symbolic link `/usr/include/db.h' to `/usr/local/BerkeleyDB/include/db.h'
[root@redhat build_unix]# ln -sv /usr/local/BerkeleyDB/include/db_cxx.h /usr/include/db_cxx.h
create symbolic link `/usr/include/db_cxx.h' to `/usr/local/BerkeleyDB/include/db_cxx.h'
[root@redhat build_unix]# echo "/usr/local/BerkeleyDB/lib" >> /etc/ld.so.conf
[root@redhat build_unix]# ldconfig -v

4、 安装Apache

安装Apache有两个要注意的地方,因为我这里用的Postfix的后台管理是extman这个程序,而它是通过CGI的

方式来进行管理的,所以这里启用了suexec的功能,还有一个是关于网站的存放路径的,如果不指定,那么在启

用suexec后会出现 suexec-docroot的错误.

? 安装

[root@redhat httpd]# tar zxvf httpd-2.2.4.tar.gz
[root@redhat httpd]# cd httpd-2.2.4
[root@redhat httpd-2.2.4]# ./configure --prefix=/usr/local/httpd --sysconfdir=/etc/httpd --enable-so --enable-ssl --enable-track-vars \
> --enable-rewrite --with-zlib --enable-mods-shared=most --enable-suexec --with-suexec-caller=daemon --with-suexec-docroot=/var/www/
[root@redhat httpd-2.2.4]# make
[root@redhat httpd-2.2.4]# make install

? 加入到自动运行队列

[root@redhat httpd-2.2.4]# echo "/usr/local/httpd/bin/apachectl start" >> /etc/rc.local

5、 安装GD库

GD库的主要作用是配置相关的图形及字符的正确显示,包括类似验证码的功能和后面的图形日志的显示.

? 安装libpng

[root@redhat src]# tar zxvf libpng-1.2.16.tar.gz
[root@redhat src]# cd libpng-1.2.16
[root@redhat libpng-1.2.16]# ./configure --prefix=/usr/local/png
[root@redhat libpng-1.2.16]# make
[root@redhat libpng-1.2.16]# make install
[root@redhat libpng-1.2.16]# ln -sv /usr/local/png/lib/* /usr/lib/

? 安装jpeg

[root@redhat src]#mkdir /usr/local/jpeg
[root@redhat src]# cd /usr/local/jpeg/
[root@redhat src]#mkdir -pv lib include man man/man1
[root@redhat src]# tar zxvf jpegsrc.v6b.tar.gz
[root@redhat src]# cd jpeg-6b/
[root@redhat jpeg-6b]# ./configure --prefix=/usr/local/jpeg --enable-shared --enable-static
[root@redhat jpeg-6b]# make
[root@redhat jpeg-6b]# make install
[root@redhat jpeg-6b]# ln -sv /usr/local/jpeg/lib/* /usr/lib/

? 安装freetype

[root@redhat src]# tar zxvf freetype-2.3.2.tar.gz
[root@redhat src]# cd freetype-2.3.2
[root@redhat freetype-2.3.2]# ./configure --prefix=/usr/local/freetype2
[root@redhat freetype-2.3.2]# make
[root@redhat freetype-2.3.2]#make install

? 安装fontconfig

[root@redhat src]# tar zxvf fontconfig-2.4.0.tar.gz
[root@redhat src]# cd fontconfig-2.4.0
[root@redhat fontconfig-2.4.0]# ./configure --prefix=/usr/local/fontconfig --with-freetype-config=/usr/local/freetype2/bin/freetype-config
[root@redhat fontconfig-2.4.0]# make
[root@redhat fontconfig-2.4.0]# make install

? 安装xmkmf

//安装xmkmf的原因是编译xpm时要用来这个工具
[root@redhat src]# rpm -ivh freetype-devel-2.1.9-1.i386.rpm
warning: freetype-devel-2.1.9-1.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:freetype-devel ########################################### [100%]
[root@redhat src]# rpm -ivh fontconfig-devel-2.2.3-7.i386.rpm
warning: fontconfig-devel-2.2.3-7.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:fontconfig-devel ########################################### [100%]
[root@redhat src]# rpm -ivh xorg-x11-devel-6.8.1-23.EL.i386.rpm
warning: xorg-x11-devel-6.8.1-23.EL.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:xorg-x11-devel ########################################### [100%]
[root@redhat src]#

? 安装xpm

//在rhel5中有直接的rpm包,librxpm.rpm libxpm-devel.rpm
[root@redhat src]# tar zxvf xpm-3.4k.tar.gz
[root@redhat src]# cd xpm-3.4k
[root@redhat xpm-3.4k]# xmkmf -a
[root@redhat xpm-3.4k]# make
[root@redhat xpm-3.4k]# make install

? 安装gd

[root@redhat src]# tar zxvf gd-2.0.34.tar.gz
[root@redhat src]# cd gd-2.0.34
[root@redhat gd-2.0.34]#./configure --prefix=/usr/local/gd --with-png=/usr/local/png/ --with-jpeg=/usr/local/jpeg/ \

> --with-freetyp=/usr/local/freetype2/ --with-fontconfig =/usr/local/fontconfig/--with-xpm
[root@redhat gd-2.0.34]# cp /usr/local/png/include/png.h ./
[root@redhat gd-2.0.34]# cp /usr/local/png/include/pngconf.h ./
[root@redhat gd-2.0.34]# make
[root@redhat gd-2.0.34]# make install

6、 安装courier-authlib

? 安装

[root@redhat src]# tar jxvf courier-authlib-0.59.3.tar.bz2
[root@redhat src]# cd courier-authlib-0.59.3
[root@redhat courier-authlib-0.59.3]# ./configure --with-redhat --with-authmysql=yes --with-mailuser=vmail --with-mailgroup=vmail \

> --with-mysql-libs=/usr/local/mysql/lib --with-mysql-includes=/usr/local/mysql/include --prefix=/usr/local/authlib --without-stdheaderdir
[root@redhat courier-authlib-0.59.3]# make
[root@redhat courier-authlib-0.59.3]# make install
[root@redhat courier-authlib-0.59.3]# make install-configure
[root@redhat courier-authlib-0.59.3]# grep "authdaemonvar" /usr/local/authlib/etc/authlib/authdaemonrc //找出配置文件中authdaemonvar的设置
##NAME: authdaemonvar:2
# authdaemonvar is here, but is not used directly by authdaemond. It's
authdaemonvar=/usr/local/authlib/var/spool/authdaemon

? 修改配置文件

[root@redhat courier-authlib-0.59.3]# vi /usr/local/authlib/etc/authlib/authdaemonrc
authmodulelist="authmysql" //第27行
authmodulelistorig="authmysql" //第34行
DEBUG_LOGIN=2 //第75行

//此文件中请不要使用空格符,应使用TAB键
[root@redhat courier-authlib-0.59.3]# vi /usr/local/authlib/etc/authlib/authmysqlrc
MYSQL_SERVER localhost //26行
MYSQL_USERNAME extmail //27行
MYSQL_PASSWORD extmail //28行
MYSQL_DATABASE extmail //68行
MYSQL_SOCKET /tmp/mysql.sock //49行
MYSQL_USER_TABLE mailbox //75行
MYSQL_CLEAR_PWFIELD password //84行
DEFAULT_DOMAIN test.com //97行
MYSQL_UID_FIELD '1001' //105行
MYSQL_GID_FIELD '1001' //111行
MYSQL_LOGIN_FIELD username //120行
MYSQL_HOME_FIELD concat('/var/mailbox/',maildir) //125行
MYSQL_NAME_FIELD name //131行
MYSQL_MAILDIR_FIELD concat('/var/mailbox/',maildir) //142行
MYSQL_QUOTA_FIELD concat(quota,'S') //157行

? 共享链接库

[root@redhat courier-authlib-0.59.3]# echo "/usr/local/authlib/lib/courier-authlib" >> /etc/ld.so.conf
[root@redhat courier-authlib-0.59.3]# ldconfig -v

? 启动及加入到自动运行队列

[root@redhat courier-authlib-0.59.3]# cp courier-authlib.sysvinit /etc/init.d/courier-authlib
[root@redhat courier-authlib-0.59.3]# chmod 755 /etc/init.d/courier-authlib
[root@redhat courier-authlib-0.59.3]# chkconfig --add courier-authlib
[root@redhat courier-authlib-0.59.3]# chkconfig --level 2345 courier-authlib on
[root@redhat courier-authlib-0.59.3]# service courier-authlib start
Starting Courier authentication services: authdaemond
[root@redhat courier-authlib-0.59.3]# chmod +x /usr/local/authlib/var/spool/authdaemon
[root@redhat courier-authlib-0.59.3]#

7、 安装SASL

? 安装

[root@redhat src]# tar zxvf cyrus-sasl-2.1.21.tar.gz
[root@redhat src]# cd cyrus-sasl-2.1.21
[root@redhat cyrus-sasl-2.1.21]# ./configure --prefix=/usr/local/sasl2 --disable-anon -enable-plain --enable-login --enable-sql \
> --with-mysql=/usr/local/mysql --with-mysql-includes=/usr/local/mysql/include --with-mysql-libs=/usr/local/mysql/lib \
> --with-authdaemond=/usr/local/authlib/var/spool/authdaemon/socket
[root@redhat cyrus-sasl-2.1.21]# patch -p1 < sasl.patch //只在出现下面的错时才用
[root@redhat cyrus-sasl-2.1.21]# make
[root@redhat cyrus-sasl-2.1.21]# make install

如果在编译的过程中出现如"client.c:64: error: static declaration of 'global_callbacks' follows non-static declaration

saslint.h:112…",需要加一个补丁程序,然后再执行编译过程。我的在rhel4下没出现错误,但在rhel5下出现错误.文件的内容如下:

[root@redhat cyrus-sasl-2.1.21]# vi sasl.patch
--- cyrus-sasl-2.1.20/lib/client.c~ 2003-11-11 11:26:06.000000000 -0500
+++ cyrus-sasl-2.1.20/lib/client.c 2005-05-31 22:34:14.000000000 -0400
@@ -61,7 +61,7 @@

static cmech_list_t *cmechlist; /* global var which holds the list */

-static sasl_global_callbacks_t global_callbacks;
+sasl_global_callbacks_t global_callbacks;

static int _sasl_client_active = 0;

? 共享链接库

[root@redhat cyrus-sasl-2.1.21]# mv /usr/lib/sasl2 /usr/lib/sasl2.OFF
[root@redhat cyrus-sasl-2.1.21]# ln -sv /usr/local/sasl2/lib/* /usr/lib
create symbolic link `/usr/lib/libsasl2.la' to `/usr/local/sasl2/lib/libsasl2.la'
create symbolic link `/usr/lib/libsasl2.so' to `/usr/local/sasl2/lib/libsasl2.so'
create symbolic link `/usr/lib/libsasl2.so.2' to `/usr/local/sasl2/lib/libsasl2.so.2'
create symbolic link `/usr/lib/libsasl2.so.2.0.21' to `/usr/local/sasl2/lib/libsasl2.so.2.0.21'
create symbolic link `/usr/lib/sasl2' to `/usr/local/sasl2/lib/sasl2'
[root@redhat cyrus-sasl-2.1.21]# ln -sv /usr/local/sasl2/lib/* /usr/local/lib
create symbolic link `/usr/local/lib/libsasl2.la' to `/usr/local/sasl2/lib/libsasl2.la'
create symbolic link `/usr/local/lib/libsasl2.so' to `/usr/local/sasl2/lib/libsasl2.so'
create symbolic link `/usr/local/lib/libsasl2.so.2' to `/usr/local/sasl2/lib/libsasl2.so.2'
create symbolic link `/usr/local/lib/libsasl2.so.2.0.21' to `/usr/local/sasl2/lib/libsasl2.so.2.0.21'
create symbolic link `/usr/local/lib/sasl2' to `/usr/local/sasl2/lib/sasl2'
[root@redhat cyrus-sasl-2.1.21]#ln -sv /usr/local/sasl2/include/sasl/* /usr/local/include
create symbolic link `/usr/local/include/hmac-md5.h' to `/usr/local/sasl2/include/sasl/hmac-md5.h'
create symbolic link `/usr/local/include/md5global.h' to `/usr/local/sasl2/include/sasl/md5global.h'
create symbolic link `/usr/local/include/md5.h' to `/usr/local/sasl2/include/sasl/md5.h'
create symbolic link `/usr/local/include/prop.h' to `/usr/local/sasl2/include/sasl/prop.h'
create symbolic link `/usr/local/include/sasl.h' to `/usr/local/sasl2/include/sasl/sasl.h'
create symbolic link `/usr/local/include/saslplug.h' to `/usr/local/sasl2/include/sasl/saslplug.h'
create symbolic link `/usr/local/include/saslutil.h' to `/usr/local/sasl2/include/sasl/saslutil.h'
[root@redhat cyrus-sasl-2.1.21]# mkdir -pv /var/state/saslauthd
mkdir: created directory `/var/state'
mkdir: created directory `/var/state/saslauthd'
[root@redhat cyrus-sasl-2.1.21]# echo "/usr/local/sasl2/lib" >&gt; /etc/ld.so.conf
[root@redhat cyrus-sasl-2.1.21]# echo "/usr/local/sasl2/lib/sasl2" &gt;&gt; /etc/ld.so.conf
[root@redhat cyrus-sasl-2.1.21]# ldconfig -v

? 启动及加入到自动运行队列

[root@redhat cyrus-sasl-2.1.21]# echo "/usr/local/sasl2/sbin/saslauthd -a shadow pam"&gt;&gt;/etc/rc.local
[root@redhat cyrus-sasl-2.1.21]# /usr/local/sasl2/sbin/saslauthd -a shadow pam

? 新建配置文件

[root@redhat cyrus-sasl-2.1.21]# vi /usr/local/lib/sasl2/smtpd.conf
pwcheck_method:authdaemond
mech_list:PLAIN LOGIN
log_level:3
authdaemond_path:/usr/local/authlib/var/spool/authdaemon/socket

8、 安装PHP

? 安装

[root@redhat src]# tar zxvf php-5.2.3.tar.gz
[root@redhat src]# cd php-5.2.3
[root@redhat php-5.2.3]# ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config \
&gt; --with-apxs2=/usr/local/httpd/bin/apxs --with-libxml-dir=/usr/include/libxml2/libxml --with-gd=/usr/local/gd/ \
&gt; --with-png=/usr/local/png/ --with-jpeg=/usr/local/jpeg/ --with-xpm --with-zlib --enable-debug --enable-magic-quotes --enable-libgcc \
&gt; --enable-ftp --enable-mbstring=all --enable-sockets --with-gnu-ld
[root@redhat php-5.2.3]# make
[root@redhat php-5.2.3]# make install
[root@redhat php-5.2.3]# cp php.ini-recommended /usr/local/php/etc/php.ini

? 配置相关文件支持

//建立相关网页路径
[root@redhat php-5.2.3]# mkdir -pv /var/www/extsuite
mkdir: created directory `/var/www'
mkdir: created directory `/var/www/extsuite'

[root@redhat php-5.2.3]# vi /etc/httpd/httpd.conf
AddType application/x-httpd-php .php .phtml //第352行增加
AddType application/x-httpd-php-source .phps
<Directory "/var/www"> //第174行
DirectoryIndex index.html index.html.var index.php index.htm //第209行
//第126行起增加以下内容
<VirtualHost *:80>
ServerName redhat.test.com
DocumentRoot /var/www/extsuite/extmail/html/
ScriptAlias /extmail/cgi /var/www/extsuite/extmail/cgi
Alias /extmail /var/www/extsuite/extmail/html
ScriptAlias /extman/cgi /var/www/extsuite/extman/cgi
Alias /extman /var/www/extsuite/extman/html
SuexecUserGroup vmail vmail //suexec用户执行权限
Alias /phpadmin /var/www/phpadmin //图形管理mysql
</VirtualHost>

//配置httpd-vhost.conff文件,以支持虚拟主机,先删除原有的27-43
行的内容,然后再最后增加以下内容
[root@redhat php-5.2.3]# vi /etc/httpd/extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerName redhat.test.com
DocumentRoot /var/www/extsuite/extmail/html/
ScriptAlias /extmail/cgi /var/www/extsuite/extmail/cgi
Alias /extmail /var/www/extsuite/extmail/html
ScriptAlias /extman/cgi /var/www/extsuite/extman/cgi
Alias /extman /var/www/extsuite/extman/html
SuexecUserGroup vmail vmail
</VirtualHost>

? 配置phpmyadmin

配置phpmyadmin用于管理mysql,测试启动Apache

[root@redhat tmp]# tar zxvf phpMyAdmin-2.11.2-all-languages.tar.gz
[root@redhat tmp]# mv phpMyAdmin-2.11.2-all-languages /var/www/phpadmin
[root@redhat tmp]# cd /var/www/phpadmin/
[root@redhat phpadmin]# cp ./libraries/config.default.php ./config.inc.php
[root@redhat phpadmin]# vi config.inc.php
$cfg['Servers'][$i]['auth_type'] = 'http'; //修改144行

//建立测试文件,启动Apache
[root@redhat www]# vi ./phpamin/phpinfo1.php
<?php phpinfo(); ?>
[root@redhat www]# /usr/local/httpd/bin/apachectl start
Warning: DocumentRoot [/var/www/extsuite/extmail/html/] does not exist
[root@redhat www]# //不存在的原因是还没建立相关文件,将在后面进行

在浏览器中输入http://IP/phpadmin/phpinfo1.php 如有php的信息输出,则php安装成功

9、 安装Postfix

? 安装

[root@redhat tmp]# tar zxvf postfix-2.5-20071006.tar.gz
[root@redhat tmp]# cd postfix-2.5-20071006
//make -f这一句请去掉所有的'\',我这里是为了显示方便,因为其中含有单引号
[root@redhat postfix-2.5-20071006]# make -f Makefile.init makefiles 'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -DUSE_CYRUS_SASL \
-I/usr/local/sasl2/include/sasl -I/usr/local/BerkeleyDB/include -DUSE_TLS -I-DUSE_TLS -I/usr/include/openssl' \
'AUXLIBS=-L/usr/local/mysql/lib -lmysqlclient -lz -lm -L/usr/local/sasl2/lib -lsasl2 \
-L/usr/local/BerkeleyDB/lib -L/usr/lib -lssl -lcrypto'
[root@redhat postfix-2.5-20071006]# make
[root@redhat postfix-2.5-20071006]# make install
install_root: [/]
tempdir: [/tmp/postfix-2.5-20071006]
config_directory: [/etc/postfix]
daemon_directory: [/usr/libexec/postfix]
command_directory: [/usr/sbin]
queue_directory: [/var/spool/postfix]
sendmail_path: [/usr/sbin/sendmail]
newaliases_path: [/usr/bin/newaliases]
mailq_path: [/usr/bin/mailq]
mail_owner: [postfix]
setgid_group: [postdrop]
html_directory: [no] /var/www/postfix_html
manpage_directory: [/usr/local/man] /usr/local/postfix/man
readme_directory: [no]
[root@redhat postfix-2.5-20071006]# newaliases

? 建立邮件存放目录及备份旧文件

[root@redhat postfix-2.5-20071006]# mkdir -pv /var/mailbox
[root@redhat postfix-2.5-20071006]# chown -R vmail.vmail /var/mailbox
[[root@redhat postfix-2.5-20071006]# mv /etc/postfix/main.cf /etc/postfix/main.cf.old
[root@redhat postfix-2.5-20071006]# mv /etc/postfix/master.cf /etc/postfix/master.cf.old

? 配置main.cf文件

//main.cf中的注解太多了,不如重新新建来得直观

//注意此文件中的有空格的地方
[root@redhat postfix-2.5-20071006]# vi /etc/postfix/main.cf
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = redhat.test.com
mydomain = test.com
myorigin = $mydomain
inet_interfaces = all
mydestination =
unknown_local_recipient_reject_code = 550
mynetworks = 192.168.44.0/24, 127.0.0.0/8

############################CYRUS-SASL########################
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,
reject_invalid_hostname,reject_non_fqdn_hostname,reject_unknown_sender_domain,
reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unknown_recipient_domain,
reject_unauth_pipelining,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $mydomain
smtpd_sasl_security_options = noanonymous
smtpd_sasl_application_name = smtpd
smtpd_banner = Welcome to our $myhostname ESMTP,Warning: Version not Available!
#############################SASL-END##############################
#############################Virtual Mailbox Settings################
virtual_mailbox_base=/var/mailbox
virtual_mailbox_maps=mysql:/etc/postfix/mysql/mysql_virtual_mailbox_maps.cf
virtual_mailbox_domains=mysql:/etc/postfix/mysql/mysql_virtual_domains_maps.cf
virtual_alias_domains=
virtual_alias_maps=mysql:/etc/postfix/mysql/mysql_virtual_alias_maps.cf
virtual_uid_maps=static:1001
virtual_gid_maps=static:1001
virtual_transport=maildrop
maildrop_destination_recipient_limit=1
maildrop_destination_concurrency_limit=1
#################################Mailbox END###########################

#################################Quota Settings########################
message_size_limit=1433600
virtual_mailbox_limit=20791520
virtual_create_maildirsize=yes
virtual_mailbox_extended=yes
virtual_mailbox_limit_maps=mysql:/etc/postfix/mysql/virtual_mailbox_limit_override=yes
virtual_maildir_limit_message=User's maildir has overdrawn his diskspace quota,try again later.
virtual_overquota_bounce=yes
################################Quota END############################

################################Amavis Start##########################
content_filter=amavisfeed:[127.0.0.1]:10024
max_use=10
################################Amavis END###########################

debug_peer_level = 2

debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
html_directory = /var/www/postfix_html
manpage_directory = /usr/local/postfix/man
sample_directory = /etc/postfix

? 配置master.cf文件

//注意此文件中的有空格的地方
[root@redhat postfix-2.5-20071006]# vi /etc/postfix/master.cf
smtp inet n - n - - smtpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - n - - smtp
relay unix - - n - - smtp
-o fallback_relay=
showq unix n - n - - showq
error unix - - n - - error
retry unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
maildrop unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/bin/maildrop -w 90 -d ${recipient}
old-cyrus unix - n n - - pipe
flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
cyrus unix - n n - - pipe
user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=bsmtp argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
amavisfeed unix - - n - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
-o disable_dns_lookups=yes
-o max_use=20
127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_data_restrictions=reject_unauth_pipelining
-o smtpd_end_of_data_restrictions=
-o smtpd_restriction_classes=
-o mynetworks=127.0.0.0/8
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_milters
-o local_header_rewrite_clients=

? 添加为支持虚拟域和虚拟用户所用到的配置文件

//直接在extman中复制过去就可以了
[root@redhat src]# mkdir -pv /etc/postfix/mysql
[root@redhat src]# tar zxvf extman-0.2.3.tar.gz
[root@redhat src]# cd /tmp/extman-0.2.3/docs
[root@redhat docs]# cp ./mysql_virtual_alias_maps.cf /etc/postfix/mysql/mysql_virtual_alias_maps.cf
[root@redhat docs]# cp ./mysql_virtual_limit_maps.cf /etc/postfix/mysql/mysql_virtual_mailbox_limit_maps.cf
[root@redhat docs]# cp ./mysql_virtual_mailbox_maps.cf /etc/postfix/mysql/mysql_virtual_mailbox_maps.cf
[root@redhat docs]# cp ./mysql_virtual_domains_maps.cf /etc/postfix/mysql/mysql_virtual_domains_maps.cf
[root@redhat docs]#

10、 安装pcre

//maildrop时需要
[root@redhat src]# tar jxvf pcre-7.2.tar.bz2
[root@redhat src]# cd pcre-7.2
[root@redhat pcre-7.2]# ./configure
[root@redhat pcre-7.2]# make
[root@redhat pcre-7.2]# make install

11、 安装zlib

//clamav的新版本需zlib大于1.2.2
[root@redhat src]# tar zxvf zlib-1.2.3.tar.gz
[root@redhat src]# cd zlib-1.2.3
[root@redhat zlib-1.2.3]# ./configure --prefix=/usr --shared
[root@redhat zlib-1.2.3]# make
[root@redhat zlib-1.2.3]# make install

12、 安装courier-imap

? 安装

[root@redhat src]# tar jxvf courier-imap-4.1.3.tar.bz2
[root@redhat src]# cd courier-imap-4.1.3
[root@redhat courier-imap-4.1.3]# export COURIERAUTHCONFIG=/usr/local/authlib/bin/courierauthconfig
[root@redhat courier-imap-4.1.3]# ./configure --prefix=/usr/local/imap --with-redhat --disable-root-check \
&gt; --enable-unicode=utf-8,iso-8859-1,gb2312,gbk,gb18030 --with-trashquota --with-dirsync --with-mysql-libs=/usr/local/mysql/lib \
&gt; --with-mysql-includes=/usr/local/mysql/include --with-authmysql --with-authmysql=yes --disable-root-check
[root@redhat courier-imap-4.1.3]# make
[root@redhat courier-imap-4.1.3]# make install
[root@redhat courier-imap-4.1.3]# make install-configure

? 编辑配置文件启用pop3及imap

[root@redhat courier-imap-4.1.3]# vi /usr/local/imap/etc/pop3d
POP3DSTART=YES //第140行
[root@redhat courier-imap-4.1.3]# vi /usr/local/imap/etc/imapd
IMAPDSTART=YES //第403行

? 启动及加入自动运行队列

[root@redhat courier-imap-4.1.3]# cp courier-imap.sysvinit /usr/local/imap/sbin/imapd
[root@redhat courier-imap-4.1.3]# chmod +x /usr/local/imap/sbin/imapd
[root@redhat courier-imap-4.1.3]# /usr/local/imap/sbin/imapd start
[root@redhat courier-imap-4.1.3]# cp courier-imap.sysvinit /etc/rc.d/init.d/courier-imapd
[root@redhat courier-imap-4.1.3]# chmod 755 /etc/rc.d/init.d/courier-imapd
[root@redhat courier-imap-4.1.3]# chkconfig --add courier-imapd
[root@redhat courier-imap-4.1.3]# chkconfig --level 2345 courier-imapd on

13、 maildrop

? 安装

[root@redhat src]# tar jxvf maildrop-2.0.4.tar.bz2
[root@redhat src]# cd maildrop-2.0.4
[root@redhat maildrop-2.0.4]# ln -sv /usr/local/authlib/bin/courierauthconfig /usr/bin
create symbolic link `/usr/bin/courierauthconfig' to `/usr/local/authlib/bin/courierauthconfig'
[root@redhat maildrop-2.0.4]# ln -sv /usr/local/authlib/include/* /usr/include
[root@redhat maildrop-2.0.4]#./configure --prefix=/usr/local/maildrop --enable-sendmail=/usr/sbin/sendmail --enable-trusted-users='root vmail' \
&gt; --enable-syslog=1 --enable-maildirquota --enable-maildrop-uid=1001 --enable-maildrop-gid=1001 --with-trashquota --with-dirsync

[root@redhat maildrop-2.0.4]# make
[root@redhat maildrop-2.0.4]# make install
[root@redhat maildrop-2.0.4]# cp /usr/local/maildrop/bin/maildrop /usr/bin
[root@redhat maildrop-2.0.4]# 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.

? 2:配置maildrop的日志文件

[root@redhat maildrop-2.0.4]# vi /etc/maildroprc
logfile "/var/log/maildrop.log"
VERBOSE="4"

14、 安装clamav

? 安装

[root@redhat src]# tar zxvf clamav-0.91.2.tar.gz
[root@redhat src]# cd clamav-0.91.2
[root@redhat clamav-0.91.2]# ./configure --prefix=/usr/local/clamav --with-dbdir=/usr/local/share/clamav --disable-zlib-vcheck \
&gt; --sysconfdir=/etc/clamav
[root@redhat clamav-0.91.2]# make
[root@redhat clamav-0.91.2]# make install

? 新建相关的文件及目录

[root@redhat clamav-0.91.2]# mkdir /var/log/clamav
[root@redhat clamav-0.91.2]# chmod -R 744 /var/log/clamav
[root@redhat clamav-0.91.2]# chown -R amavis:amavis /var/log/clamav
[root@redhat clamav-0.91.2]# chown -R amavis.amavis /usr/local/share/clamav
[root@redhat clamav-0.91.2]# mkdir /var/run/clamav
[root@redhat clamav-0.91.2]# chmod 700 /var/run/clamav
[root@redhat clamav-0.91.2]# chown amavis.amavis /var/run/clamav

[root@redhat clamav-0.91.2]# mv /etc/clamav/freshclam.conf /etc/clamav/freshclam.conf.old
[root@redhat clamav-0.91.2]#vi /etc/clamav/freshclam.conf
DatabaseDirectory /usr/local/share/clamav
UpdateLogFile /var/log/clamav/freshclam.log
LogVerbose yes
LogSyslog yes
LogFacility LOG_MAIL
PidFile /var/run/freshclam.pid
DatabaseOwner amavis
DatabaseMirror db.CN.clamav.net
DatabaseMirror database.clamav.net
DatabaseMirror database.clamav.net

[root@redhat clamav-0.91.2]# mv /etc/clamav/clamd.conf /etc/clamav/clamd.conf.old
[root@redhat clamav-0.91.2]# vi /etc/clamav/clamd.conf
LogFile /var/log/clamav/clamd.log
LogSyslog yes
LogFacility LOG_MAIL
LogVerbose yes
PidFile /var/run/clamav/clamd.pid
DatabaseDirectory /usr/local/share/clamav
LocalSocket /var/run/clamav/clamd.socket
StreamMaxLength 20M
User amavis
ScanELF yes
ScanPDF yes
ScanMail yes
PhishingSignatures yes

? 配置库文件及开机自启动

[root@redhat clamav-0.91.2]# cp contrib/init/RedHat/clamd /etc/rc.d/init.d/clamd
[root@redhat clamav-0.91.2]# cp contrib/init/RedHat/clamav-milter /etc/rc.d/init.d/clamav-milter
[root@redhat clamav-0.91.2]# chkconfig --add clamd
[root@redhat clamav-0.91.2]# chkconfig --add clamav-milter
[root@redhat clamav-0.91.2]# chkconfig --level 2345 clamd on
[root@redhat clamav-0.91.2]# chkconfig --level 2345 clamav-milter on
[root@redhat clamav-0.91.2]# echo "/usr/local/clamav/lib" &gt;&gt; /etc/ld.so.conf
[root@redhat clamav-0.91.2]# ldconfig -v

? 启动服务及添加自动任务

[root@redhat clamav-0.91.2]# vi /etc/rc.d/init.d/clamd
progdir="/usr/local/clamav/sbin" //第19行
[root@redhat clamav-0.91.2]# service clamd start
Starting clamd: [ OK ]
[root@redhat clamav-0.91.2]#
[root@redhat clamav-0.91.2]# crontab -e
37 * * * * /usr/local/clamav/bin/freshclam //增加系统启动任务
[root@redhat clamav-0.91.2]#/usr/local/clamav/bin/freshclam
ClamAV update process started at Thu Dec 6 04:09:24 2007
WARNING: Your ClamAV installation is OUTDATED!
WARNING: Local version: 0.91.2 Recommended version: 0.92
DON'T PANIC! Read http://www.clamav.net/support/faq
Downloading main-45.cdiff [100%]

15、 安装perl相关组件

安装Perl组件是这里最麻烦的地方,一个是因为要求的组件比较多,另一个则是它对其它组件的依赖信较强.也许有人说可以通过自动

的方式来进行安装,我也有尝试过,但却总是有组件安装不成功(如MIME-Tools),而且非常耗时间.还不如手动安装来得讯速,可以按

http://WWW.5dmail.net/html/2008-1-25/200812595932.htm 介绍的方法将相关的组件下载下来,然后按照下面的方法顺序安装.

在安装perl组件到GD-SecurityImage会要求用户安装PerlImageMagick的组件,而ImageMagick则需要下面这些软件的支持,

否则可能在显示验证码的时候出现错误.

ghostscript

http://sourceforge.net/project/showfiles.php?group_id=1897

ImageMagick相关

tiff

ftp://ftp.remotesensing.org/libtiff

ImageMagick相关

PerlMagick-6.32

http://search.cpan.org/~jcristy/PerlMagick-6.32/Magick.pm

PerlMagick模块

? 安装ghostscript

[root@redhat src]# tar zxvf ghostscript-8.54.tar.gz
[root@redhat src]# cd ghostscript-8.54
[root@redhat ghostscript-8.54]# ./configure
[root@redhat ghostscript-8.54]# make
[root@redhat ghostscript-8.54]# make install

? 安装tiff

[root@redhat src]# tar zxvf tiff-3.8.2.tar.gz
[root@redhat src]# cd tiff-3.8.2
[root@redhat tiff-3.8.2]# ./configure
[root@redhat tiff-3.8.2]# make
[root@redhat tiff-3.8.2]# make install

? 安装html2ps

[root@redhat src]# tar zxvf html2ps-1.0b5.tar.gz
[root@redhat src]# cd html2ps-1.0b5
[root@redhat html2ps-1.0b5]# chmod +x install
[root@redhat html2ps-1.0b5]# ./install

? 安装jasper

[root@redhat src]# unzip jasper-1.701.0.zip
[root@redhat src]# cd jasper-1.701.0
[root@redhat jasper-1.701.0]# ./configure --disable-opengl --disable-libjpeg
[root@redhat jasper-1.701.0]# make
[root@redhat jasper-1.701.0]# make install

? 安装ImageMagick

[root@redhat src]# ln -sv /usr/local/png/include/* /usr/include
create symbolic link `/usr/include/libpng12' to `/usr/local/png/include/libpng12'
create symbolic link `/usr/include/pngconf.h' to `/usr/local/png/include/pngconf.h'
create symbolic link `/usr/include/png.h' to `/usr/local/png/include/png.h'
[root@redhat src]# ln -sv /usr/local/jpeg/include/* /usr/include
[root@redhat src]# tar zxvf ImageMagick-6.3.7-9.tar.gz
[root@redhat src]# cd ImageMagick-6.3.7
[root@redhat ImageMagick-6.3.7]# ./configure --without-fpx --without-jbig --without-rsvg --without-lcms
[root@redhat ImageMagick-6.3.7]# make
[root@redhat ImageMagick-6.3.7]# make install

//安装Perl的第一个组件,请按顺序安装
tar zxvf BerkeleyDB-0.32.tar.gz 01
cd BerkeleyDB-0.32
perl Makefile.PL
make
make install
cd ..
tar zxvf Compress-Raw-Zlib-2.008.tar.gz 02
tar zxvf IO-Compress-Base-2.008.tar.gz 03
tar zxvf IO-Compress-Zlib-2.008.tar.gz 04
tar zxvf Compress-Zlib-2.008.tar.gz 05
tar zxvf IO-Zlib-1.08.tar.gz 06
tar zxvf Array-Compare-1.14.tar.gz 07
tar zxvf Sub-Uplevel-0.18.tar.gz 08
tar zxvf Test-Simple-0.74.tar.gz 09
tar zxvf Test-Exception-0.26.tar.gz 10
tar zxvf Tree-DAG_Node-1.06.tar.gz 11
tar zxvf Test-Warn-0.10.tar.gz 12
tar zxvf Net-SSLeay-1.32.tar.gz 13
tar zxvf IO-Socket-SSL-1.12.tar.gz 14
tar zxvf IO-stringy-2.110.tar.gz 15
tar zxvf Algorithm-Diff-1.1902.tar.gz 16
tar zxvf Text-Diff-0.35.tar.gz 17
tar zxvf Archive-Tar-1.38.tar.gz 18
tar zxvf Archive-Zip-1.23.tar.gz 19
tar zxvf DBI-1.601.tar.gz 20
tar zxvf Socket6-0.19.tar.gz 21 在安装到perl模块DBD-mysql时,请先安装Socket6
tar zxvf DBD-mysql-3.0008.tar.gz 22
tar zxvf IO-Socket-INET6-2.51.tar.gz 23
tar zxvf IP-Country-2.23.tar.gz 24
tar zxvf File-Temp-0.20.tar.gz 25
tar zxvf NetAddr-IP-4.007.tar.gz 26
tar zxvf Net-CIDR-Lite-0.20.tar.gz 27
tar zxvf Net-IP-1.25.tar.gz 28
tar zxvf Net-Ident-1.20.tar.gz 29
tar zxvf Digest-SHA-5.45.tar.gz 30
tar zxvf Digest-SHA1-2.11.tar.gz 31
tar zxvf Digest-HMAC-1.01.tar.gz 32
tar zxvf Net-DNS-0.61.tar.gz 33
tar zxvf version-0.74.tar.gz 34
tar zxvf Net-DNS-Resolver-Programmable-v0z 35
tar zxvf HTML-Tagset-3.10.tar.gz 36
tar zxvf HTML-Parser-3.56.tar.gz 37
tar zxvf ExtUtils-CBuilder-0.21.tar.gz 38
tar zxvf Encode-Detect-1.00.tar.gz 39
tar zxvf ExtUtils-ParseXS-2.18.tar.gz 40
tar zxvf Error-0.17011.tar.gz 41

tar zxvf GD-2.35.tar.gz 42

tar zxvf BerkeleyDB-0.32.tar.gz 1
cd BerkeleyDB-0.32
ln -sv /usr/local/jpeg/lib/* /usr/lib
create symbolic link `/usr/lib/libjpeg.a' to `/usr/local/jpeg/lib/libjpeg.a'
create symbolic link `/usr/lib/libjpeg.la' to `/usr/local/jpeg/lib/libjpeg.la'
create symbolic link `/usr/lib/libjpeg.so' to `/usr/local/jpeg/lib/libjpeg.so'
ln: `/usr/lib/libjpeg.so.62': File exists
ln: `/usr/lib/libjpeg.so.62.0.0': File exists
perl Makefile.PL
Where is libgd installed? [/usr/lib] /usr/local/gd/lib
Please choose the features that match how libgd was built:
Build JPEG support? [y]
Build PNG support? [y]
Build FreeType support? [y]
Build GIF support? [y]
Build support for animated GIFs? [y]
Build XPM support? [y]
If you experience compile problems, please check the @INC, @LIBPATH and @LIBS
arrays defined in Makefile.PL and manually adjust, if necessary.
Checking if your kit is complete...
Looks good
Writing Makefile for GD

tar zxvf PerlMagick-6.32.tar.gz 43
tar zxvf GD-SecurityImage-1.64.tar.gz 44
tar zxvf GD-SecurityImage-Utils-1.02.tar. 45
tar zxvf Unix-Syslog-1.0.tar.gz 46
tar zxvf Sys-Hostname-Long-1.4.tar.gz 47
tar zxvf Regexp-Common-2.120.tar.gz 48
tar zxvf URI-1.35.tar.gz 49
tar zxvf Mail-SPF-v2.005.tar.gz 50
tar zxvf Mail-SPF-Query-1.999.1.tar.gz 51
tar zxvf TimeDate-1.16.tar.gz 52
tar zxvf Pod-Escapes-1.04.tar.gz 53
tar zxvf Pod-Simple-3.05.tar.gz 54
tar zxvf Test-Pod-1.26.tar.gz 55
tar zxvf MailTools-2.02.tar.gz 56
tar zxvf Crypt-OpenSSL-Random-0.04.tar.gz 57
tar zxvf Crypt-OpenSSL-RSA-0.25.tar.gz 58
tar zxvf Mail-DKIM-0.29.tar.gz 59
tar zxvf Mail-DomainKeys-1.0.tar.gz 60
tar zxvf MIME-tools-5.425.tar.gz 61
tar zxvf libwww-perl-5.808.tar.gz 62
tar zxvf Mail-SpamAssassin-3.2.3.tar.gz 63
tar zxvf Convert-TNEF-0.17.tar.gz 64
tar zxvf Convert-UUlib-1.09.tar.gz 65
tar zxvf Net-Server-0.97.tar.gz 66
tar zxvf Time-HiRes-1.9711.tar.gz 67
tar zxvf Time-HiRes-1.9711.tar.gz 68
tar zxvf Log-Log4perl-1.14.tar.gz 69
//其它组件的安装方式类同,只有特殊处理时下面会给出说明

GD后,请不要先急着安装GD-SecurityImage,请先安装PerlMagick,方法同上.如果Magick安装不成功,也可以通过rpm的方式来安装,

在系统自带的光盘中有,方法如下:

[root@redhat tmp]# rpm -ivh ImageMagick-6.0.7.1-5.i386.rpm
warning: ImageMagick-6.0.7.1-5.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:ImageMagick ########################################### [100%]
/sbin/ldconfig: /usr/local/mysql/lib/libmysqlclient_r.so.15 is not a symbolic link
/sbin/ldconfig: /usr/local/mysql/lib/libndbclient.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/mysql/lib/libmysqlclient.so.15 is not a symbolic link
[root@redhat tmp]# rpm -ivh ImageMagick-perl-6.0.7.1-5.i386.rpm
warning: ImageMagick-perl-6.0.7.1-5.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:ImageMagick-perl ########################################### [100%]

? 错误解决方法:

A:Can't locate RRDs.pm in @INC.....

解决方法:

find /usr -name "RRDs.pm"

ln -sv /usr/local/rrdtool/lib/perl/5.8.5/i386-linux-thread-multi/RRDs.pm /usr/lib/perl5/5.8.5

再启动:

B:Can't locate loadable ojbect for module RRDs

解决:

ln -sv /usr/local/rrdtool/lib/perl/5.8.5/i386-linux-thread-multi/auto/RRDs/RRDs.so /usr/lib/perl5/5.8.5/i386-linux-thread-multi/

再启动ok

(假如碰到少别的模块都能够用查找链接这种方法解决,很难找到就是没安装咯,一个是pm模块,一个是so库)

16、 安装amavisd

? 安装

[root@redhat src]# tar zxvf amavisd-new-2.5.2.tar.gz
[root@redhat src]#cd amavisd-new-2.5.2
[root@redhat amavisd-new-2.5.2]# mkdir -p /var/amavis /var/amavis/tmp /var/amavis/var /var/amavis/db
[root@redhat amavisd-new-2.5.2]# chown -R amavis:amavis /var/amavis
[root@redhat amavisd-new-2.5.2]# chmod -R 750 /var/amavis
[root@redhat amavisd-new-2.5.2]# cp amavisd /usr/local/sbin/
[root@redhat amavisd-new-2.5.2]# chown root /usr/local/sbin/amavisd
[root@redhat amavisd-new-2.5.2]# chmod 755 /usr/local/sbin/amavisd
[root@redhat amavisd-new-2.5.2]# cp amavisd.conf /etc/
[root@redhat amavisd-new-2.5.2]# chown root /etc/amavisd.conf
[root@redhat amavisd-new-2.5.2]# chmod 644 /etc/amavisd.conf
[root@redhat amavisd-new-2.5.2]# mkdir /var/virusmails
[root@redhat amavisd-new-2.5.2]# chown amavis:amavis /var/virusmails
[root@redhat amavisd-new-2.5.2]# chmod 750 /var/virusmails
[root@redhat amavisd-new-2.5.2]#

? 配置amavisd.conf文件

[root@redhat src]# vi /etc/amavisd.conf
$max_servers=8;
$daemon_user = 'amavis';
$daemon_group = 'amavis';
$mydomain = 'test.com';
$db_home = "$MYHOME/db";
$inet_socket_port = 10024;
$sa_tag_level_deflt = -100;
$sa_tag2_level_deflt = 6.3;
$sa_kill_level_deflt = $sa_tag2_level_deflt;
$virus_admin = "virusalert@$mydomain";
$sa_spam_subject_tag = '***SPAM*** ';
$notify_method = $forward_method;
$forward_method = 'smtp:127.0.0.1:10025';
$final_virus_destiny = D_DISCARD;
$final_banned_destiny = D_DISCARD;
$final_spam_destiny = D_PASS;
$virus_admin = "postmaster\@$mydomain"; # notifications recip.
$mailfrom_notify_admin = "postmaster\@$mydomain"; # notifications sender
$mailfrom_notify_recip = "postmaster\@$mydomain"; # notifications sender
$mailfrom_notify_spamadmin = "postmaster\@$mydomain"; # notifications sender
$mailfrom_to_quarantine = ''; # null return path; uses original sender if undef
['ClamAV-clamd',
&ask_daemon, ["CONTSCAN {}n", "/var/run/clamav/clamd.socket"],
qr/bOK$/, qr/bFOUND$/,
qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],

? 测试启动

[root@redhat amavisd-new-2.5.2]# /usr/local/sbin/amavisd debug
//如果出现以下的错误,则需重新编译 perl 模块 Convert-UUlib
Problem in Amavis::Unpackers code: Can't locate Convert/UUlib.pm in @INC

? 测试启动spamassassin

//更改/etc/mail/spammassassin/local.cf中的值为下面的参数
required_hits 10.0
rewrite_subject 1
required_score 5.0
rewrite_header Subject *****SPAM*****
report_safe 1
use_bayes 1
bayes_auto_learn 1
skip_rbl_checks 1
use_razor2 0
use_pyzor 0
ok_locales all
[root@linux ~]# spamassassin -d --lint
[root@linux ~]# /usr/bin/spamd -d
[26002] warn: server socket setup failed, retry 1: spamd: could not create INET socket on
[26002] warn: server socket setup failed, retry 2: spamd: could not create INET socket on
[26002] error: spamd: could not create INET socket on 127.0.0.1:783: Address already in use
spamd: could not create INET socket on 127.0.0.1:783: Address already in use
[root@linux ~]# echo "/usr/bin/spamd -d" &gt;&gt; /etc/rc.local
[root@linux ~]#

? 启动amavis并测试postfix ,正常情况下应出现下面的提示

[root@redhat amavisd-new-2.5.2]# /usr/local/sbin/amavisd
[root@redhat amavisd-new-2.5.2]# postfix start
postfix/postfix-script: starting the Postfix mail system
[root@redhat amavisd-new-2.5.2]# telnet localhost 10024
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 [127.0.0.1] ESMTP amavisd-new service ready
EHLO test.com
250-[127.0.0.1]
250-VRFY
250-PIPELINING
250-SIZE
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250 XFORWARD NAME ADDR PROTO HELO

[root@redhat amavisd-new-2.5.2]# telnet localhost 10025
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 [127.0.0.1] ESMTP amavisd-new service ready
EHLO test.com

//测试smtp及sasl功能,正常情况应如下示
[root@redhat etc]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 Welcome to our redhat.test.com ESMTP,Warning: Version not Available!
EHLO test.com
250-redhat.test.com
250-PIPELINING
250-SIZE 1433600
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN //注意要显示这两行
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

//如果上述没有显示,且/var/log/maillog文件中有下面的提示,请按下面的方法排除
Jan 8 13:59:19 redhat postfix/smtpd[32315]: fatal: open database /etc/aliases.d
No such file or directory
[root@redhat etc]# postfix stop
[root@redhat amavisd-new-2.5.2]# cd /etc/
[root@redhat etc]# postalias aliases
[root@redhat etc]# postfix start

? 增加Chinese_rules.cf支持

Chinese_rules.cf是教育科研网的反垃圾邮件小组对大量垃圾邮件和正常邮件进行分析后得出的一个关键字/分数规则集,

用于处理中文(简体)垃圾邮件还是比较有效的。这里我们通过如下命令增加到系统,而且由于该规则每周更新一次,

为了达到最好效果,最好在crontab里增加自动更新的内容,输入:

[root@redhat etc]# wget -N -P /usr/share/spamassassin www.ccert.edu.cn/spam/sa/Chinese_rules.cf
[root@redhat etc]# /usr/bin/crontab -e 0 0 1 * * wget -N -P /usr/share/spamassassin www.ccert.edu.cn/spam/sa/Chinese_rules.cf;

/usr/local/sbin/amavisd stop;/usr/local/sbin/amavisd start

17、 安装extmail

? 安装extmail

[root@redhat src]# tar zxvf extmail-1.0.3.tar.gz
[root@redhat src]# mv extmail-1.0.3 /var/www/extsuite/extmail

? 安装extman

[root@redhat src]# tar zxvf extman-0.2.3.tar.gz
[root@redhat src]# mv extman-0.2.3 /var/www/extsuite/extman

? 设置extmail

[root@redhat src]# cd /var/www/extsuite/extmail/
[root@redhat extmail]# cp webmail.cf.default webmail.cf
SYS_CONFIG = /var/www/extsuite/extmail/
SYS_LANGDIR = /var/www/extsuite/extmail/lang
SYS_TEMPLDIR = /var/www/extsuite/extmail/html
SYS_SHOW_WARN = 0
SYS_PERMIT_NOQUOTA = 1
SYS_SESS_DIR = /tmp/
SYS_LOG_ON = 1
SYS_LOG_TYPE = syslog
SYS_LOG_FILE = /var/log/extmail.log
SYS_CAPTCHA_ON = 1
SYS_CAPTCHA_KEY = r3s9b6a7
SYS_CAPTCHA_LEN = 6
SYS_SESS_TIMEOUT = 0
SYS_SESS_COOKIE_ONLY = 1
SYS_USER_PSIZE = 10
SYS_USER_SCREEN = auto
SYS_USER_LANG = zh_CN
SYS_APP_TYPE = WebMail
SYS_USER_TEMPLATE = default
SYS_USER_CHARSET = utf-8
SYS_USER_TRYLOCAL = 1
SYS_USER_TIMEZONE = +0800
SYS_USER_SHOW_HTML = 1
SYS_USER_ADDR2ABOOK = 1
SYS_MESSAGE_SIZE_LIMIT = 5242880
SYS_MIN_PASS_LEN = 2
SYS_MFILTER_ON = 1
SYS_NETDISK_ON = 1
SYS_SHOW_SIGNUP = 1
SYS_DEBUG_ON = 1
SYS_AUTH_TYPE = mysql
SYS_MAILDIR_BASE = /var/mailbox
SYS_AUTH_SCHEMA = virtual
SYS_CRYPT_TYPE = md5crypt
SYS_MYSQL_USER = extmail
SYS_MYSQL_PASS = extmail
SYS_MYSQL_DB = extmail
SYS_MYSQL_HOST = localhost
SYS_MYSQL_SOCKET = /tmp/mysql.sock
SYS_MYSQL_TABLE = mailbox
SYS_MYSQL_ATTR_USERNAME = username
SYS_MYSQL_ATTR_DOMAIN = domain
SYS_MYSQL_ATTR_PASSWD = password
SYS_MYSQL_ATTR_CLEARPW = clearpwd
SYS_MYSQL_ATTR_QUOTA = quota
SYS_MYSQL_ATTR_NDQUOTA = netdiskquota
SYS_MYSQL_ATTR_HOME = homedir
SYS_MYSQL_ATTR_MAILDIR = maildir
SYS_MYSQL_ATTR_DISABLEWEBMAIL = disablewebmail
SYS_MYSQL_ATTR_DISABLENETDISK = disablenetdisk
SYS_MYSQL_ATTR_DISABLEPWDCHANGE = disablepwdchange
SYS_MYSQL_ATTR_ACTIVE = active
SYS_AUTHLIB_SOCKET = /usr/local/authlib/var/spool/authdaemon/socket
SYS_G_ABOOK_TYPE = file
SYS_G_ABOOK_FILE_PATH = /var/www/extsuite/extmail/globabook.cf
SYS_G_ABOOK_FILE_LOCK = 1
SYS_G_ABOOK_FILE_CONVERT = 0
SYS_G_ABOOK_FILE_CHARSET = utf-8

? 设置extman

[root@redhat extmail]# cd ../extman
[root@redhat extman]# vi webman.cf
SYS_CONFIG = /var/www/extsuite/extman/
SYS_LANGDIR = /var/www/extsuite/extman/lang
SYS_TEMPLDIR = /var/www/extsuite/extman/html
SYS_MAILDIR_BASE = /var/mailbox
SYS_SHOW_WARN = 0
SYS_SESS_DIR = /tmp/extman
SYS_CAPTCHA_ON = 1 //如果不能正确显示验证码,请将这个值设为0
SYS_CAPTCHA_KEY = r3s9b6a7
SYS_CAPTCHA_LEN = 6
SYS_PSIZE = 10
SYS_APP_TYPE = ExtMan
SYS_TEMPLATE_NAME = default
SYS_DEFAULT_EXPIRE = 1y
SYS_GROUPMAIL_SENDER = [email protected]
SYS_DEFAULT_SERVICES = webmail,smtpd,smtp,pop3,netdisk
SYS_ISP_MODE = no
SYS_DOMAIN_HASHDIR = yes
SYS_DOMAIN_HASHDIR_DEPTH = 2x2
SYS_USER_HASHDIR = yes
SYS_USER_HASHDIR_DEPTH = 2x2
SYS_MIN_UID = 500
SYS_MIN_GID = 100
SYS_DEFAULT_UID = 1001
SYS_DEFAULT_GID = 1001
SYS_QUOTA_MULTIPLIER = 1048576
SYS_QUOTA_TYPE = courier
SYS_DEFAULT_MAXQUOTA = 500
SYS_DEFAULT_MAXALIAS = 100
SYS_DEFAULT_MAXUSERS = 100
SYS_DEFAULT_MAXNDQUOTA = 500
SYS_USER_DEFAULT_QUOTA = 5
SYS_USER_DEFAULT_NDQUOTA = 5
SYS_USER_DEFAULT_EXPIRE = 1y
SYS_BACKEND_TYPE = mysql
SYS_CRYPT_TYPE = md5crypt
SYS_MYSQL_USER = webman
SYS_MYSQL_PASS = webman
SYS_MYSQL_DB = extmail
SYS_MYSQL_HOST = localhost
SYS_MYSQL_SOCKET = /tmp/mysql.sock
SYS_MYSQL_TABLE = manager
SYS_MYSQL_ATTR_USERNAME = username
SYS_MYSQL_ATTR_PASSWD = password
SYS_RRD_DATADIR = /var/lib
SYS_RRD_TMPDIR = /tmp/viewlog
SYS_RRD_QUEUE_ON = yes

? 导入extman数据

[root@redhat extsuite]# mkdir /tmp/extman
[root@redhat extsuite]# chown -R vmail:vmail /tmp/extman
[root@redhat src]# chown -R vmail:vmail /var/www/extsuite/extmail
[root@redhat src]# chown -R vmail:vmail /var/www/extsuite/extman
[root@redhat var]# cd www/extsuite/extman/docs/
[root@redhat docs]# export PATH=$PATH:/usr/local/mysql/bin
[root@redhat docs]# mysql -u root -p < ./extmail.sql
Enter password:

//在初始化数据库时,请更改init.sql中extmail.org的名称为自已域名
[root@redhat docs]# mysql -u root -p &lt; ./init.sql
Enter password:
[root@redhat docs]#

? 建立maildrop日志文件

[root@redhat extmail]# touch /var/log/maildrop.log
[root@redhat extmail]# chown vmail.vmail /var/log/maildrop.log

? 更改extmail及extman的模板文件,使显示更加人性化

[root@redhat ~]# vi /var/www/extsuite/extmail/html/default/index.html
&lt;INPUT TYPE="text" class="input_n" NAME="domain"> 将161行的内容改为如下
<select name="domain" size="1" class="input_select">
<option value="linux.com">linux.com</option></select>
[root@redhat ~]# vi /var/www/extsuite/extman/html/default/index.html
<input name=username [email protected] class=login_input> //第114行

六、安装图形日志显示支持

1、 安装libart

[root@redhat src]# tar zxvf libart_lgpl-2.3.17.tar.gz
[root@redhat src]# cd libart_lgpl-2.3.17
[root@redhat libart_lgpl-2.3.17]# ./configure
[root@redhat libart_lgpl-2.3.17]# make
[root@redhat libart_lgpl-2.3.17]# make install

2、 安装TCL支持

[root@redhat rrdtool-1.2.26]# rpm -qa |grep tcl
tcl-8.4.7-2
tclx-8.3.5-4
[root@redhat src]# rpm -ivh tcl-devel-8.4.7-2.i386.rpm
warning: tcl-devel-8.4.7-2.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:tcl-devel ########################################### [100%]

3、 安装rrdtool

[root@redhat ~]# cp /usr/local/lib/pkgconfig/libart-2.0.pc /usr/lib/pkgconfig/
[root@redhat src]# tar zxvf rrdtool-1.2.26.tar.gz
[root@redhat src]# cd rrdtool-1.2.26
[root@redhat rrdtool-1.2.26]# ./configure --perfix=/usr/local/rrdtool
[root@redhat rrdtool-1.2.26]# make
[root@redhat rrdtool-1.2.26]# make install

4、 启动图形日志

[root@redhat src]# cp -r /var/www/extsuite/extman/addon/mailgraph_ext/ /usr/local/mailgraph_ext/
[root@redhat src]# /usr/local/mailgraph_ext/mailgraph-init start
Starting mail statistics grapher: mailgraph_ext
[root@redhat src]# /usr/local/mailgraph_ext/qmonitor-init start
Starting queue statistics grapher: qmonitor
[root@redhat ~]# echo "/usr/local/mailgraph_ext/mailgraph-init start" &gt;&gt; /etc/rc.d/rc.local
[root@redhat ~]# echo "/usr/local/mailgraph_ext/qmonitor-init start" &gt;&gt; /etc/rc.d/rc.local

七、进入web页管理

1、 重新启动服务

[root@redhat src]# /usr/local/httpd/bin/apachectl stop
[root@redhat src]# /usr/local/httpd/bin/apachectl start
[root@redhat 5.8.5]# postfix stop
[root@redhat 5.8.5]# postfix start

2、 测试

在浏览器中输入http://redhat.test.com/如图:应先建立postmaster用户,否则在/var/mailbox下不会生成目录,但网页却会提示成功.

用户名默认是root,密码是extmail*123*

? 建立域

? 建立用户

 

由于blog的格式问题 部分图片可能无法显示,更具体的内容请到 http://down.51cto.com/data/488782 下载附件

你可能感兴趣的:(安装,用户,target,blank)