之前使用exchang 做的邮件服务器,   或者使用winmail等,配置相对来说,比较容易.于是呼:一直想在利用开源软件做架设一下mail服务器.
之后在网上找了点资料. 主要是看看各位网络大侠们写的blog. 目前利用postfix架设邮件服务器的资料相当的多. sendmail 和qmail邮件系统的用户估计相对少一点. 那就用postfix吧。下面是我安装的步骤:
 
一.  在局域网内的架设的话,要架设一台dns服务器,以便能解析A记录和mx交换记录。  (在公网上可以省略了。可以利用域名代理商修改域名的相关信息了)
 
域名:test.com
邮件服务器域名: mail.test.com
 mx 记录                     mail.test.com
 
二. 在工作机安装一下虚拟机,vmware workstation 6.5. 安装的linux .
我用的是cent os 4.4  32位的。(目前centos好像5.3了,)懒的去下载新版本的镜像文件了。 安装好后,ip:192.168.18.247  hostname设为mail.test.com
 
三. 安装所需软件 (以下是我是在安装的时候根据自己的情况选择的相关版本,仅供参考)
mysql                  mysql-5.1.36-linux-i686-glibc23.tar.gz
openssl               openssl-0.9.7a-43.10 (使用的是系统自带的,)
Apache               httpd-2.2.11.tar.bz2
BerkeleyDB     db-4.7.25.tar.gz
PHP                    php-5.2.10.tar.gz
libpng                 libpng-1.2.8-config.tar.gz
jpeg                     jpegsrc.v6b.tar.gz
freetype              freetype-2.3.2.tar.gz
fontconfig          fontconfig-2.4.0.tar.gz
xpm                     xpm-3.4i.tar.gz
gd                        gd-2.0.34.tar.gz
xmkmf                fontconfig-devel-2.2.3-7.centos4.i386.rpm
                            freetype-devel-2.1.9-4.el4.i386.rpm
                             xorg-x11-devel-6.8.2-1.EL.13.37.i386.rpm
SASL                   cyrus-sasl-2.1.23.tar.gz
courier-authlib  courier-authlib-0.62.4.tar.bz2
courier-imap     courier-imap-4.5.1.tar.bz2
pcre                     pcre-7.6.tar.bz2
clamav                  clamav-0.94.2.tar.tar
amavisd-new       amavisd-new-2.6.4.tar.gz
extmail                 extmail-1.1.0.tar.gz
extman                  extman-1.0.0.tar.gz
Postfix                     postfix-2.5.0.tar.tar
RRDtool                rrdtool-1.2.26.tar.gz
SpamAssassin      Mail-SpamAssassin-3.2.5.tar.gz
ghostscript             ghostscript-8.54.tar.bz2
tiff                             tiff-3.8.2.tar.gz
html2ps                    html2ps-1.0b5.tar.tar
jasper                        jasper-1.701.0.zip
ImageMagick          ImageMagick-6.5.5-10.tar.bz2
 
所安装的perl软件
 
1.BerkeleyDB-0.39.tar.gz
2.Compress-Raw-Zlib-2.020.tar.gz
3.IO-Compress-2.020.tar.gz
4.IO-Compress-Zlib-2.015
5.Compress-Zlib-2.015.tar.gz
6.IO-Zlib-1.10.tar.gz
7.Array-Compare-1.18.tar.gz
8.Sub-Uplevel-0.2002.tar.gz
9. Test-Simple-0.92.tar.gz
10.Test-Exception-0.27.tar.gz
11.Tree-DAG_Node-1.06.tar.gz
12.Test-Warn-0.11.tar.gz
13. Net-SSLeay-1.35.tar.gz
14.IO-Socket-SSL-1.26.tar.gz
15.IO-stringy-2.110.tar.gz
16.Algorithm-Diff-1.1902.tar.gz
17.Text-Diff-1.37.tar.gz
18.Archive-Tar-1.52.tar.gz
19. Archive-Zip-1.30.tar.gz
20.DBI-1.609.tar.gz
21.Socket6-0.23.tar.gz
22..DBD-mysql-4.012.tar.gz
23.IO-Socket-INET6-2.56.tar.gz
24.IP-Country-2.27.tar.gz
25.File-Temp-0.22.tar.gz
26. NetAddr-IP-4.027.tar.gz
27.Net-CIDR-Lite-0.20.tar.gz
28.Net-IP-1.25.tar.gz
29. Net-Ident-1.20.tar.gz
30. Digest-SHA-5.47.tar.gz
31.Digest-SHA1-2.12.tar.gz
32.Digest-HMAC-1.01.tar.gz
33.Net-DNS-0.65.tar.gz
34.version-0.7701.tar.gz
35. Net-DNS-Resolver-Programmable-v0.003
36. HTML-Tagset-3.20.tar.gz
37.HTML-Parser-3.61.tar.gz
38. ExtUtils-CBuilder-0.2603.tar.gz
39. Encode-Detect-1.01.tar.gz
40.ExtUtils-ParseXS-2.2002.tar.gz
41.Error-0.15.tar.gz
42.GD-2.44.tar.gz
43.PerlMagick-6.54.tar.gz
44.GD-SecurityImage-1.70.tar.gz
45.GD-SecurityImage-Utils-1.02.tar.gz
46.Unix-Syslog-1.1.tar.gz
47.Sys-Hostname-Long-1.4.tar.gz
48. Regexp-Common-2.122.tar.gz
49.URI-1.38.tar.gz
50.Mail-SPF-v2.006.tar.gz
51. Mail-SPF-Query-1.999.1.tar.gz
52.TimeDate-1.19.tar.gz
53. Pod-Escapes-1.04.tar.gz
54.Test-Simple-0.92.tar.gz
55.Test-Pod-1.26.tar.gz
56.MailTools-2.04.tar.gz
57.Crypt-OpenSSL-Random-0.04.tar.gz
58.Crypt-OpenSSL-RSA-0.25.tar.gz
59.Mail-DKIM-0.36.tar.gz
60.Mail-DomainKeys-1.0.tar.gz
61. MIME-tools-5.427.tar.gz
62.libwww-perl-5.830.tar.gz
63.Mail-SpamAssassin-3.2.5.tar.gz
64.Convert-TNEF-0.17.tar.gz
65.Convert-UUlib-1.12.tar.gz
66.Net-Server-0.97.tar.gz
67.Time-HiRes-1.9719.tar.gz
68. Log-Log4perl-1.24.tar.gz
以上这些perl要重新安装的.下载地址http://search.cpan.org/search
 
四. 具体安装过程
 
卸载系统原有组件
因为这里的安装方式都是采用源码,所以如果系统中存在旧有的版本,则会引起冲突,这里要做的是把一些和源码包冲突的软件卸载.在使用命令进行查询时,当执行完命令后没有提示则表示系统未安装查询的组件,否则请卸载查询出来的组件
 
root@mail ~]# rpm -qa | grep httpd //查询是否已安装软件
[root@mail ~]# rpm -qa | grep mysql
[root@mail ~]# rpm -qa | grep php
[root@mail ~]# 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@mail ~]# 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@mail ~]# rpm -qa |grep sendmail
sendmail-8.13.1-2
[root@mail ~]# service sendmail stop
Shutting down sendmail:                                    [  OK  ]
Shutting down sm-client:                                   [  OK  ]
[root@mail ~]# rpm -e --nodeps sendmail
[root@mail~]#
卸载perl相关的组件
 
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 ~]# //卸载perl相关
[root@redhat ~]# rpm -e --nodeps perl-XML-NamespaceSupport-1.08-6 \
perl-XML-Twig-3.13-6 perl-XML-LibXML-1.58-1 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 perl-HTML-Tagset-3.03-30 \
perl-XML-Parser-2.34-5 perl-libxml-enno-1.02-31 perl-Digest-HMAC-1.01-13
 
增加系统相关的用户和组
[root@mail ~]groupadd mysql
[root@mail ~]# groupadd vmail
[root@mail ~]# groupadd postfix
[root@mail ~]# groupadd postdrop
[root@mail ~]# groupadd amavis
[root@mail ~]# groupadd clamav
[root@mail ~]# groupmod -g 1001 vmail
[root@mail ~]# useradd mysql -g mysql
[root@mail ~]# useradd vmail -g vmail -u 1001
[root@mail ~]# useradd postfix -g postfix
[root@mail ~]# useradd amavis -g amavis
[root@mail ~]# useradd clamav -g clamav
安装Mysql

1:安装
[root@mail tmp]# tar -zxvf  mysql-5.1.36-linux-i686-glibc23.tar.gz
[root@mail tmp]# mv mysql-5.1.36-linux-i686 /usr/local/mysql
[root@mail tmp]# cd /usr/local/mysql/
[root@mail mysql]# chown -R root . //注意这些地方的点号
[root@mail mysql]# chown -R mysql data
[root@mail mysql]# chown -R mysql data/mysql/.
[root@mail mysql]# chgrp -R mysql .
[root@mail mysql]# cp ./support-files/my-medium.cnf /etc/my.cnf
[root@mail mysql]# ./scripts/mysql_install_db --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OK 
  2:启动及共享链接库
[root@mail mysql]# bin/mysqld_safe --user=mysql &
[1] 29422
[root@mail mysql]# Starting mysqld daemon with databases from /usr/local/mysql/data
[root@mail mysql]#/usr/local/mysql/bin/mysqlshow -p
Enter password: //测试数据库,如有下面显示则表示成功
+--------------------+
| Databases |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
[root@mail mysql]#
[root@mail mysql]# echo "/usr/local/mysql/lib" >> /etc/ld.so.conf
[root@mail mysql]# ldconfig -v      //加入动态链接库中 
  3:加入到自动运行队列
[root@mail mysql]# cp /usr/local/mysql/support-files/mysql.server /etc/rc.d/init.d/mysqld
[root@mail mysql]# chmod 700 /etc/rc.d/init.d/mysqld
[root@mail mysql]# chkconfig --add mysqld
[root@mail mysql]# chkconfig --level 345 mysqld on
[root@mail mysql]# export PATH=$PATH:/usr/local/mysql/bin
[root@mail mysql]# //设置mysql的运行路径 
 
安装Openssl 
一般系统自带了,用源码包安装也可以.
[root@redhat tmp]# rpm -qa |grep ssl
openssl-devel-0.9.7a-43.1
openssl-0.9.7a-43.1
xmlsec1-openssl-1.2.6-3
 
安装BerkeleyDB 
安装这个软件的原因是因为后面的Perl组件包中必须要有它的支持才能进行下去,所以这个是不能省的.
  1:安装
[root@mail tmp]#tar zxvf db-4.7.25.tar.gz
[root@mail tmp]# cd db-4.7.25/build_unix
[root@mail build_unix]#../dist/configure --prefix=/usr/local/BerkeleyDB
[root@mail build_unix]#make
[root@mail build_unix]#make install 
  2:禁用和移除旧版本文件
[root@mail build_unix]# mv /usr/include/db4 /usr/include/db4.off
[root@mail build_unix]# rm /usr/include/db_cxx.h
rm: remove symbolic link `/usr/include/db_cxx.h'? y
[root@mail build_unix]# rm /usr/include/db.h
rm: remove symbolic link `/usr/include/db.h'? y
[root@mail build_unix]#rm /usr/include/db_185.h
rm: remove symbolic link `/usr/include/db_185.h'? y
[root@mail build_unix]# 
  3:链接新文件到动态库
[root@mail build_unix]# ln -sv /usr/local/BerkeleyDB/include /usr/include/db4
create symbolic link `/usr/include/db4' to `/usr/local/BerkeleyDB/include'
[root@mail 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@mail 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@mail build_unix]# echo "/usr/local/BerkeleyDB/lib" >> /etc/ld.so.conf
[root@mail build_unix]# ldconfig -v 
 
安装Apache
安装Apache有两个要注意的地方,因为我这里用的Postfix的后台管理是extman这个程序,而它是通过CGI的方式来进行管理的,所以这里启用了suexec的功能,还有一个是关于网站的存放路径的,如果不指定,那么在启用suexec后会出现 suexec-docroot的错误.
  1:安装
[root@mail httpd]# tar zxvf httpd-2.2.4.tar.gz
[root@mail httpd]# cd httpd-2.2.4
[root@mail httpd-2.2.4]# ./configure --prefix=/usr/local/apache2
--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@mail httpd-2.2.4]# make
[root@mail httpd-2.2.4]# make install 
  2:加入到自动运行队列
[root@mail httpd-2.2.4]# echo "/usr/local/apache2/bin/apachectl start" >> /etc/rc.local
 
 
安装GD库
GD库的主要作用是配置相关的图形及字符的正确显示,包括类似验证码的功能和后面的图形日志的显示.
  1:安装libpng
[root@mail php]# tar zxvf libpng-1.2.8-config.tar.gz
[root@mail php]# cd libpng-1.2.8-config
[root@mail libpng-1.2.16]# ./configure --prefix=/usr/local/png
[root@mail libpng-1.2.16]# make
[root@mail libpng-1.2.16]# make install
[root@mail libpng-1.2.16]# ln -sv /usr/local/png/lib/* /usr/lib/ 
  2:安装jpeg
[root@mail php]#mkdir /usr/local/jpeg
[root@mail php]# mkdir /usr/local/jpeg/bin
[root@mail php]#mkdir /usr/local/jpeg/lib
[root@mail php]# mkdir /usr/local/jpeg/include
[root@mail php]# mkdir /usr/local/jpeg/man
[root@mail php]# mkdir /usr/local/jpeg/man/man1
[root@mail php]# tar zxvf jpegsrc.v6b.tar.gz
[root@mail php]# cd jpeg-6b/
[root@mail jpeg-6b]# ./configure --prefix=/usr/local/jpeg --enable-shared --enable-static
[root@mail jpeg-6b]# make
[root@mail jpeg-6b]# make install
[root@mail jpeg-6b]# ln -sv /usr/local/jpeg/lib/* /usr/lib/ 
  3:安装freetype
[root@mail php]# tar zxvf freetype-2.3.2.tar.gz
[root@mail php]# cd freetype-2.3.2
[root@mail freetype-2.3.2]# ./configure --prefix=/usr/local/freetype2
[root@mail freetype-2.3.2]# make
[root@mail freetype-2.3.2]#make install 
  4:安装fontconfig
[root@mail php]# tar zxvf fontconfig-2.4.0.tar.gz
[root@mail php]# cd fontconfig-2.4.0
[root@mail fontconfig-2.4.0]# ./configure --prefix=/usr/local/fontconfig \
--with-freetype-config=/usr/local/freetype2/bin/freetype-config
[root@mail fontconfig-2.4.0]# make
[root@mail fontconfig-2.4.0]# make install 
  5:安装xmkmf
//安装xmkmf的原因是编译xpm时要用来这个工具
[root@mail php]# 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@mail php]# 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@mail php]# 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@mail php]# 
  6:安装xpm
//在rhel5中有直接的rpm包,librxpm.rpm libxpm-devel.rpm
[root@mail php]# tar zxvf xpm-3.4i.tar.gz
[root@mail php]# cd xpm-3.4i
[root@mail xpm-3.4k]# xmkmf -a
[root@mail xpm-3.4k]# make
[root@mail xpm-3.4k]# make install 
  7:安装gd
[root@mail tmp]# tar zxvf gd-2.0.34.tar.gz
[root@mail php]# cd gd-2.0.34
[root@mail 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@mail gd-2.0.34]# cp /usr/local/png/include/png.h ./
[root@mail gd-2.0.34]# cp /usr/local/png/include/pngconf.h ./
[root@mail gd-2.0.34]# make
[root@mail gd-2.0.34]# make install
 
安装courier-authlib
 1:安装
[root@mail tmp]# tar jxvf courier-authlib-0.62.4.tar.bz2
[root@mail tmp]# cd courier-authlib-0.62.4
[root@mail courier-authlib-0.62.4]# ./configure --with-mail --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@mail courier-authlib-0.62.4]# make
[root@mail courier-authlib-0.62.4]# make install
[root@mail courier-authlib-0.62.4]# make install-configure
[root@mail courier-authlib-0.62.4]# 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 
  2:更改相关配置文件
[root@mail courier-authlib-0.62.4]# vi /usr/local/authlib/etc/authlib/authdaemonrc
authmodulelist="authmysql" 
authmodulelistorig="authmysql"
DEBUG_LOGIN=2  
 
//此文件中请不要使用空格符,应使用TAB键
[root@mail courier-authlib-0.59.3]# vi /usr/local/authlib/etc/authlib/authmysqlrc
MYSQL_SERVER   localhost 
MYSQL_USERNAME  extmail
MYSQL_PASSWORD  extmail
MYSQL_DATABASE  extmail
MYSQL_SOCKET  /tmp/mysql.sock
MYSQL_USER_TABLE  mailbox
MYSQL_CLEAR_PWFIELD  password
DEFAULT_DOMAIN  test.com
MYSQL_UID_FIELD  '1001'
MYSQL_GID_FIELD  '1001'
MYSQL_LOGIN_FIELD  username
MYSQL_HOME_FIELD  concat('/var/mailbox/',maildir)   
MYSQL_NAME_FIELD  name      //131行
MYSQL_MAILDIR_FIELD  concat('/var/mailbox/',maildir)  
MYSQL_QUOTA_FIELD  concat(quota,'S')    
  3:共享链接库
[root@mail courier-authlib-0.62.4]# echo "/usr/local/authlib/lib/courier-authlib" >> /etc/ld.so.conf
[root@mail courier-authlib-0.62.4]# ldconfig -v 
  4:启动及加入到自动运行队列
[root@mail courier-authlib-0.62.4]# cp courier-authlib.sysvinit /etc/init.d/courier-authlib
[root@mail courier-authlib-0.62.4]# chmod 755 /etc/init.d/courier-authlib
[root@mail courier-authlib-0.62.4]# chkconfig --add courier-authlib
[root@mail courier-authlib-0.62.4]# chkconfig --level 2345 courier-authlib on
[root@mail courier-authlib-0.62.4]# service courier-authlib start
Starting Courier authentication services: authdaemond
[root@mail courier-authlib-0.62.4]# chmod +x /usr/local/authlib/var/spool/authdaemon
[root@mail courier-authlib-0.62.4]# 
 
安装SASL
1:安装
[root@mail tmp]# tar zxvf cyrus-sasl-2.1.23.tar.tar
[root@mail tmp]# cd cyrus-sasl-2.1.23 
[root@mail cyrus-sasl-2.1.23]# ./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@mail cyrus-sasl-2.1.23]# make
[root@mail cyrus-sasl-2.1.23]# make install 
 
2:共享链接库
[root@redhat cyrus-sasl-2.1.23]# mv /usr/lib/sasl2 /usr/lib/sasl2.OFF
[root@redhat cyrus-sasl-2.1.23]# 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.23]# 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.23]#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.23]# mkdir -pv /var/state/saslauthd
mkdir: created directory `/var/state'
mkdir: created directory `/var/state/saslauthd'
[root@redhat cyrus-sasl-2.1.23]# echo "/usr/local/sasl2/lib" >> /etc/ld.so.conf
[root@redhat cyrus-sasl-2.1.23]# echo "/usr/local/sasl2/lib/sasl2" >> /etc/ld.so.conf
[root@redhat cyrus-sasl-2.1.23]# ldconfig -v 
  3:启动及加入到自动运行队列
[root@redhat cyrus-sasl-2.1.23]# echo "/usr/local/sasl2/sbin/saslauthd -a shadow pam">>/etc/rc.local
[root@redhat cyrus-sasl-2.1.23]# /usr/local/sasl2/sbin/saslauthd -a shadow pam 
  4:新建配置文件
[root@redhat cyrus-sasl-2.1.23]# 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 
allow_plaintext: true
auxprop_plugin: mysql
sql_hostnames: localhost
sql_user: extmail
sql_passwd: extmail
sql_database: extmail
sql_select: select password from mailbox where username='%u'
 
(注:后面蓝色的字体注的是设置了mysql数据库密码后,需要设置的。)
 
安装PHP
 
1:安装
[root@mail tmp]# tar zxvf php-5.2.10.tar.gz
[root@mail tmp]# cd php-5.2.10
[root@mail php-5.2.10]# ./configure --prefix=/usr/local/php \
--with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-apxs2=/usr/local/httpd/bin/apxs \
--with-libxml-dir=/usr/include/libxml2/libxml --with-gd=/usr/local/gd/ \
--with-png=/usr/local/png/ --with-jpeg=/usr/local/jpeg/ --with-xpm \
--with-zlib --enable-debug --enable-magic-quotes --enable-libgcc \
--enable-ftp --enable-mbstring=all --enable-sockets --with-gnu-ld
[root@mail php-5.2.10]# make
[root@mail php-5.2.10]# make install
[root@mail php-5.2.10]# cp php.ini-recommended /usr/local/php/etc/php.ini 
  2:配置相关文件支持
//建立相关网页路径
[root@mail php-5.2.10]# mkdir -pv /var/www/extsuite
mkdir: created directory `/var/www'
mkdir: created directory `/var/www/extsuite' 
 
//配置httpd.conf文件
[root@mail php-5.2.10]# vi /usr/local/apache2/conf/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 mail.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@mail php-5.2.10]# vi /usr/local/apache2/conf/extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerName mail.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> 
  3:配置phpmyadmin用于管理mysql,测试启动Apache
[root@mail tmp]# tar zxvf phpMyAdmin-2.11.9.2-all-languages-utf-8-only.tar.gz 
[root@mail tmp]# mv phpMyAdmin-2.11.9.2-all-languages-utf-8-only /var/www/phpadmin
[root@mail tmp]# cd /var/www/phpadmin/
[root@mail phpadmin]# cp ./libraries/config.default.php ./config.inc.php
[root@mail phpadmin]# vi config.inc.php
$cfg['Servers'][$i]['auth_type'] = 'http'; //修改144行 
 
//建立测试文件,启动Apache
[root@mail www]# vi ./phpamin/phpinfo1.php
<?php phpinfo(); ?>
[root@mail www]# /usr/local/httpd/bin/apachectl start
Warning: DocumentRoot [/var/www/extsuite/extmail/html/] does not exist
[root@mail www]# //不存在的原因是还没建立相关文件,将在后面进行
 
安装Postfix
1:安装
[root@mail tmp]# tar zxvf postfix-2.5.0.tar.tar
[root@mail tmp]# cd  postfix-2.5.0
//make -f这一句请去掉所有的'\',我这里是为了显示方便,因为其中含有单引号
[root@mail  postfix-2.5.0]# 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@mail  postfix-2.5.0]# make
[root@mail  postfix-2.5.0]# make install
install_root: [/]
tempdir: [/tmp/ postfix-2.5.0]
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@mail  postfix-2.5.0]# newaliases 
  2:建立邮件存放目录及备份旧文件
[root@mail  postfix-2.5.0]# mkdir -pv /var/mailbox
[root@mail  postfix-2.5.0]# chown -R vmail.vmail /var/mailbox
[[root@mail  postfix-2.5.0]# mv /etc/postfix/main.cf /etc/postfix/main.cf.old
[root@mail  postfix-2.5.0]# mv /etc/postfix/master.cf /etc/postfix/master.cf.old 
  3:配置main.cf文件
//main.cf中的注解太多了,不如重新新建来得直观
[root@mail  postfix-2.5.0]# vi /etc/postfix/main.cf
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = mail.test.com
mydomain = test.com
myorigin = $mydomain
inet_interfaces = all
mydestination =
unknown_local_recipient_reject_code = 550
mynetworks = 192.168.18.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 
  4:配置master.cf文件
//注意此文件中的有空格的地方
[root@mail  postfix-2.5.0]# 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} #flags=前面有两个空格
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前面有空格
 -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= 
  5:添加为支持虚拟域和虚拟用户所用到的配置文件
//直接在extman中复制过去就可以了
[root@mail tmp]# mkdir -pv /etc/postfix/mysql
[root@mail tmp]# tar zxvf extman-0.2.3.tar.gz
[root@mail tmp]# cd /tmp/extman-0.2.3/docs
[root@mail docs]# cp ./mysql_virtual_alias_maps.cf /etc/postfix/mysql/mysql_virtual_alias_maps.cf
[root@mail docs]# cp ./mysql_virtual_limit_maps.cf /etc/postfix/mysql/mysql_virtual_mailbox_limit_maps.cf
[root@mail docs]# cp ./mysql_virtual_mailbox_maps.cf /etc/postfix/mysql/mysql_virtual_mailbox_maps.cf
[root@mail docs]# cp ./mysql_virtual_domains_maps.cf /etc/postfix/mysql/mysql_virtual_domains_maps.cf
[root@mail docs]# 
  6:安装pcre
//maildrop时需要
[root@mail httpd]# tar jxvf pcre-7.6.tar.bz2
[root@mail httpd]# cd pcre-7.6
[root@mail pcre-7.6]# ./configure
[root@mail pcre-7.6]# make
[root@mail pcre-7.6]# make install 
  7:安装zlib
//clamav的新版本需zlib大于1.2.2
[root@mail php]# tar zxvf zlib-1.2.3.tar.gz
[root@mail php]# cd zlib-1.2.3
[root@mail zlib-1.2.3]# ./configure --prefix=/usr --shared
[root@mail zlib-1.2.3]# make
[root@mail zlib-1.2.3]# make install 
 
安装courier-imap
 
1:安装
[root@mail tmp]# tar jxvf courier-imap-4.5.1.tar.bz2 
[root@mail tmp]# cd courier-imap-4.5.1
[root@mail courier-imap-4.5.1]# export COURIERAUTHCONFIG=/usr/local/authlib/bin/courierauthconfig
[root@mail courier-imap-4.5.1]# ./configure --prefix=/usr/local/imap \
--with-mail --disable-root-check \
--enable-unicode=utf-8,iso-8859-1,gb2312,gbk,gb18030 --with-trashquota \
--with-dirsync --with-mysql-libs=/usr/local/mysql/lib \
--with-mysql-includes=/usr/local/mysql/include --with-authmysql \
--with-authmysql=yes --disable-root-check
[root@mail courier-imap-4.5.1]# make
[root@mail courier-imap-4.5.1]# make install
[root@mail courier-imap-4.5.1]# make install-configure 
  2:编辑配置文件启用pop3及imap
[root@mail courier-imap-4.5.1]# vi /usr/local/imap/etc/pop3d
POP3DSTART=YES //第140行
[root@mail courier-imap-4.5.1]# vi /usr/local/imap/etc/imapd
IMAPDSTART=YES     //第403行 
  3:启动及加入自动运行队列
[root@mail courier-imap-4.5.1]# cp courier-imap.sysvinit /usr/local/imap/sbin/imapd
[root@mail courier-imap-4.5.1]# chmod +x /usr/local/imap/sbin/imapd
[root@mail courier-imap-4.5.1]# /usr/local/imap/sbin/imapd start
[root@mail courier-imap-4.5.1]# cp courier-imap.sysvinit /etc/rc.d/init.d/courier-imapd
[root@mail courier-imap-4.5.1]# chmod 755 /etc/rc.d/init.d/courier-imapd
[root@mail courier-imap-4.5.1]# chkconfig --add courier-imapd
[root@mail courier-imap-4.5.1]# chkconfig --level 2345 courier-imapd on 
安装maildrop
1:安装
[root@mail tmp]# tar jxvf maildrop-2.2.0.tar.bz2
[root@mail tmp]# cd maildrop-2.2.0
[root@mail maildrop-2.2.0]# ln -sv /usr/local/authlib/bin/courierauthconfig /usr/bin
create symbolic link `/usr/bin/courierauthconfig' to `/usr/local/authlib/bin/courierauthconfig'
[root@mail maildrop-2.2.0]# ln -sv /usr/local/authlib/include/* /usr/include
[root@mail maildrop-2.2.0]#./configure --prefix=/usr/local/maildrop \
--enable-sendmail=/usr/sbin/sendmail --enable-trusted-users='root vmail' \
--enable-syslog=1 --enable-maildirquota --enable-maildrop-uid=1001 \
--enable-maildrop-gid=1001 --with-trashquota --with-dirsync
[root@mail maildrop-2.2.0]# make
[root@mail maildrop-2.2.0]# make install
[root@mail maildrop-2.2.0]# cp /usr/local/maildrop/bin/maildrop /usr/bin
[root@mail maildrop-2.2.0]# maildrop -v
maildrop 2.2.0 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@mail maildrop-2.2.0]# vi /etc/maildroprc
logfile "/var/log/maildrop.log"
VERBOSE="4" 

安装clamav
1:安装
[root@mail tmp]# tar zxvf clamav-0.94.2.tar.gz
[root@mail tmp]# cd clamav-0.94.2
[root@mail clamav-0.94.2]# ./configure --prefix=/usr/local/clamav \
--with-dbdir=/usr/local/share/clamav --disable-zlib-vcheck \
--sysconfdir=/etc/clamav
[root@mail clamav-0.94.2]# make
[root@mail clamav-0.94.2]# make install 
  2:新建相关的文件及目录
[root@mail clamav-0.94.2]# mkdir /var/log/clamav
[root@mail clamav-0.94.2]# chmod -R 744 /var/log/clamav
[root@mail clamav-0.94.2]# chown -R amavis:amavis /var/log/clamav
[root@mail clamav-0.94.2]# chown -R amavis.amavis /usr/local/share/clamav
[root@mail clamav-0.94.2]# mkdir /var/run/clamav
[root@mail clamav-0.94.2]# chmod 700 /var/run/clamav
[root@mail clamav-0.94.2]# chown amavis.amavis /var/run/clamav 
 
//freshclam.conf内容
[root@mail clamav-0.94.2]# mv /etc/clamav/freshclam.conf /etc/clamav/freshclam.conf.old
[root@mail clamav-0.94.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 
 
//clamd文件内容
[root@mail clamav-0.94.2]# mv /etc/clamav/clamd.conf /etc/clamav/clamd.conf.old
[root@mail clamav-0.94.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 
  3:配置库文件及开机自启动
[root@mail clamav-0.94.2]# cp contrib/init/mail/clamd /etc/rc.d/init.d/clamd
[root@mail clamav-0.94.2]# cp contrib/init/mail/clamav-milter /etc/rc.d/init.d/clamav-milter
[root@mail clamav-0.94.2]# chkconfig --add clamd
[root@mail clamav-0.94.2]# chkconfig --add clamav-milter
[root@mail clamav-0.94.2]# chkconfig --level 2345 clamd on
[root@mail clamav-0.94.2]# chkconfig --level 2345 clamav-milter on
[root@mail clamav-0.94.2]# echo "/usr/local/clamav/lib" >> /etc/ld.so.conf
[root@mail clamav-0.94.2]# ldconfig -v 
  4:启动服务及添加自动任务
[root@mail clamav-0.94.2]# vi /etc/rc.d/init.d/clamd
progdir="/usr/local/clamav/sbin" //第19行
[root@mail clamav-0.94.2]# service clamd start
Starting clamd: [ OK ]
[root@mail clamav-0.94.2]#
[root@mail clamav-0.94.2]# crontab -e
37 * * * * /usr/local/clamav/bin/freshclam //增加系统启动任务
[root@mail clamav-0.94.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.94.2 Recommended version: 0.94
DON'T PANIC! Read [url]http://www.clamav.net/support/faq[/url]
Downloading main-45.cdiff [100%] 
 
安装perl相关组件
1:安装ghostscript
[root@mail tmp]# tar zxvf ghostscript-8.54.tar.gz
[root@mail tmp]# cd ghostscript-8.54
[root@mail ghostscript-8.54]# ./configure
[root@mail ghostscript-8.54]# make
[root@mail ghostscript-8.54]# make install 
  2:安装tiff
[root@mail tmp]# tar zxvf tiff-3.8.2.tar.gz
[root@mail tmp]# cd tiff-3.8.2
[root@mail tiff-3.8.2]# ./configure
[root@mail tiff-3.8.2]# make
[root@mail tiff-3.8.2]# make install 
  3:安装html2ps
[root@mail tmp]# tar zxvf html2ps-1.0b5.tar.gz
[root@mail tmp]# cd html2ps-1.0b5
[root@mail html2ps-1.0b5]# chmod +x install
[root@mail html2ps-1.0b5]# ./install 
  4:安装jasper
[root@mail tmp]# unzip jasper-1.701.0.zip
[root@mail tmp]# cd jasper-1.701.0
[root@mail jasper-1.701.0]# ./configure --disable-opengl --disable-libjpeg
[root@mail jasper-1.701.0]# make
[root@mail jasper-1.701.0]# make install 
  5:安装ImageMagick
[root@mail ImageMagick-6.5.5]# 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@mail ImageMagick-6.5.5]# ln -sv /usr/local/jpeg/include/* /usr/include
[root@mail tmp]# tar jxvf ImageMagick-6.5.5-10.tar.bz2
[root@mail tmp]# cd ImageMagick-6.5.5
[root@mail ImageMagick-6.5.5]# ./configure --without-fpx --without-jbig \
--without-rsvg --without-lcms
[root@mail ImageMagick-6.5.5]# make
[root@mail ImageMagick-6.5.5]# make install 
 
6. 安装perl组件,请按前面1-68的顺序一个一个安装
在安装到第42个时(GD),其交互选项较多,特说明如下.
[root@mail GD-2.44]# 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
[root@mail GD-2.44]# 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 

  而在安装完了42(GD)后,请不要先急着安装43(GD-SecurityImage),请先安装新增加的42.1(PerlMagick),方法同上.如果Magick安装不成功,也可以通过rpm的方式来安装,在系统自带的光盘中有,方法如下:
[root@mail 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@mail 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%]

 安装amavisd
1:安装
[root@mail tmp]# tar zxvf amavisd-new-2.6.4 .tar.gz
[root@mail tmp]#cd amavisd-new-2.6.4 
[root@mail amavisd-new-2.6.4 ]# mkdir -p /var/amavis /var/amavis/tmp /var/amavis/var /var/amavis/db
[root@mail amavisd-new-2.6.4 ]# chown -R amavis:amavis /var/amavis
[root@mail amavisd-new-2.6.4 ]# chmod -R 750 /var/amavis
[root@mail amavisd-new-2.6.4 ]# cp amavisd /usr/local/sbin/
[root@mail amavisd-new-2.6.4 ]# chown root /usr/local/sbin/amavisd
[root@mail amavisd-new-2.6.4 ]# chmod 755 /usr/local/sbin/amavisd
[root@mail amavisd-new-2.6.4 ]# cp amavisd.conf /etc/
[root@mail amavisd-new-2.6.4 ]# chown root /etc/amavisd.conf
[root@mail amavisd-new-2.6.4 ]# chmod 644 /etc/amavisd.conf
[root@mail amavisd-new-2.6.4 ]# mkdir /var/virusmails
[root@mail amavisd-new-2.6.4 ]# chown amavis:amavis /var/virusmails
[root@mail amavisd-new-2.6.4 ]# chmod 750 /var/virusmails
[root@mail amavisd-new-2.6.4 ]# 
  2:配置amavisd.conf文件
//因该文件内容较多,这里只列出比较重要的选项,完整的文件将会在附件中给出
要非常注意这个配置文件,之前配置好,一直收不到邮件,就是这个配置文件问题.
[root@mail tmp]# 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$/ ], 
  3:测试启动
[root@mail amavisd-new-2.6.4 ]# /usr/local/sbin/amavisd debug
//如果出现以下的错误,则需重新编译64(Convert-UUlib)
Problem in Amavis::Unpackers code: Can't locate Convert/UUlib.pm in @INC 
  4:测试启动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" >> /etc/rc.local
[root@linux ~]# 
  5:启动amavis并测试postfix ,正常情况下应出现下面的提示
[root@mail amavisd-new-2.6.4 ]# /usr/local/sbin/amavisd
[root@mail amavisd-new-2.6.4 ]# postfix start
postfix/postfix-script: starting the Postfix mail system
[root@mail amavisd-new-2.6.4 ]# 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 
 
//测试smtp及sasl功能,正常情况应如下示
[root@mail etc]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 Welcome to our mail.test.com ESMTP,Warning: Version not Available!
EHLO test.com
250-mail.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 mail postfix/smtpd[32315]: fatal: open database /etc/aliases.d
No such file or directory
[root@mail etc]# postfix stop
[root@mail amavisd-new-2.6.4 ]# cd /etc/
[root@mail etc]# postalias aliases
[root@mail etc]# postfix start 
  6:增加Chinese_rules.cf支持
  Chinese_rules.cf是教育科研网的反垃圾邮件小组对大量垃圾邮件和正常邮件进行分析后得出的一个关键字/分数规则集,用于处理中文(简体)垃圾邮件还是比较有效的。这里我们通过如下命令增加到系统,而且由于该规则每周更新一次,为了达到最好效果,最好在crontab里增加自动更新的内容,输入:
[root@mail etc]# wget -N -P /usr/share/spamassassin [url]www.ccert.edu.cn/spam/sa/Chinese_rules.cf[/url]
[root@mail etc]# /usr/bin/crontab -e
0 0 1 * * wget -N -P /usr/share/spamassassin [url]www.ccert.edu.cn/spam/sa/Chinese_rules.cf[/url];
 /usr/local/sbin/amavisd stop;/usr/local/sbin/amavisd start
 
安装extmail 
  1:安装extmail
[root@mail tmp]# tar zxvf extmail-1.1.0.tar.gz
[root@mail tmp]# mv extmail-1.1.0 /var/www/extsuite/extmail  
  2:安装extman
[root@mail tmp]# tar zxvf extman-1.0.0.tar.gz
[root@mail tmp]# mv extman-1.0.0 /var/www/extsuite/extman  
  3:设置extmail
[root@mail tmp]# cd /var/www/extsuite/extmail/
[root@mail 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  
  4:设置extman
[root@mail extmail]# cd ../extman
[root@mail 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               //这个最好设置在/var/tmp/extman  tmp下面重启会丢掉的.并给目录777权限.
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 =
postmaster@wqgcool.com
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  
  5:导入extman数据
[root@mail extsuite]# mkdir /tmp/extman
[root@mail extsuite]# chown -R vmail:vmail /tmp/extman
[root@mail tmp]# chown -R vmail:vmail /var/www/extsuite/extmail
[root@mail tmp]# chown -R vmail:vmail /var/www/extsuite/extman
//在初始化数据库时,请更改init.sql中extmail.org的名称为自已域名
[root@mail var]# cd www/extsuite/extman/docs/
[root@mail docs]# export PATH=$PATH:/usr/local/mysql/bin
[root@mail docs]# mysql -u root -p < ./extmail.sql
Enter password:
[root@mail docs]# mysql -u root -p < ./init.sql
Enter password:
[root@mail docs]#  
  6:建立maildrop日志文件
[root@mail extmail]# touch /var/log/maildrop.log
[root@mail extmail]# chown vmail.vmail /var/log/maildrop.log  
  7:更改extmail及extman的模板文件,使显示更加人性化
[root@mail ~]# vi /var/www/extsuite/extmail/html/default/index.html
<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@mail ~]# vi /var/www/extsuite/extman/html/default/index.html
<input name=username
value=root@test.com class=login_input> //第114行  
安装图形日志显示支持
  1:安装libart
[root@mail rrdtool]# tar zxvf libart_lgpl-2.3.17.tar.gz
[root@mail rrdtool]# cd libart_lgpl-2.3.17
[root@mail libart_lgpl-2.3.17]# ./configure
[root@mail libart_lgpl-2.3.17]# make
[root@mail libart_lgpl-2.3.17]# make install  
  2:安装TCL支持
[root@mail rrdtool-1.2.26]# rpm -qa |grep tcl
tcl-8.4.7-2
tclx-8.3.5-4
[root@mail tmp]# 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@mail ~]# cp /usr/local/lib/pkgconfig/libart-2.0.pc /usr/lib/pkgconfig/
[root@mail rrdtool]# tar zxvf rrdtool-1.2.26.tar.gz
[root@mail rrdtool]# cd rrdtool-1.2.26
[root@mail rrdtool-1.2.26]# ./configure --perfix=/usr/local/rrdtool
[root@mail rrdtool-1.2.26]# make
[root@mail rrdtool-1.2.26]# make install  
  4:启动图形日志
[root@mail tmp]# cp -r /var/www/extsuite/extman/addon/mailgraph_ext/ /usr/local/mailgraph_ext/
[root@mail tmp]# /usr/local/mailgraph_ext/mailgraph-init start
Starting mail statistics grapher: mailgraph_ext
[root@mail tmp]# /usr/local/mailgraph_ext/qmonitor-init start
Starting queue statistics grapher: qmonitor
[root@mail ~]# echo "/usr/local/mailgraph_ext/mailgraph-init start" >> /etc/rc.d/rc.local
[root@mail ~]# echo "/usr/local/mailgraph_ext/qmonitor-init start" >> /etc/rc.d/rc.local  
进入web页管理
  1:重新启动服务
[root@mail tmp]# /usr/local/httpd/bin/apachectl stop
[root@mail tmp]# /usr/local/httpd/bin/apachectl start
[root@mail 5.8.5]# postfix stop
[root@mail 5.8.5]# postfix start  

  2:在浏览器中输入[url]http://mail.test.com[/url]如图:应先建立postmaster用户,否则在/var/mailbox下不会生成目录,但网页却会提示成功.
 
接下来测试,登录到extman后台,建立相应的两个用户名,进行相关测试. extman 登录后台root,登录密码是extmail*123*
 
最后一步. 安装排错.
在配置Postfix中遇到的一些问题及相关的解决方法,希望在遇到相同的问题时能起参考的作用.在这里有必要提到一些相关的日志文件,因为很多的错误都会在日志中有体现,日志文件的存放位置可以由用户定义,这里所说的日志文件是按前面的文章中定义的存放位置
显示信件列表: postqueue -p
显示信件內容: postcat -q Queue_ID
刪除各別信件:postsuper -d Queue_ID
全部刪除: postsuper -d ALL
扣住信件: postsuper -h Queue_ID
回复: postsuper -H Queue_ID
重新排程:
postsuper -r Queue_ID
postsuper -r ALL
清除信件:
postqueue -f (全部)
postqueue -s 主机名称(个别对象)
要查看Postfix的当前主要配置文件的存放路径:
postconf -n
系统日志:tail -f /var/log/messages
邮件日志:tail -f /var/log/maillog
clamd相关: tail -f /var/log/clamav/clamd.log  tail -f /var/log/clamav/freshclam.log
maildrop相关:tail -f /var/log/maildrop.log
apache相关:tail -f /usr/local/httpd/logs/error_log  tail -f /usr/local/httpd/logs/suexec_log
mysql相关: tail -f /usr/local/mysql/data/linux.linux.com.err
测试amavisd: amavisd -d config debug-sa
测试spam: spamassassin -D --lint
测试maildrop: maildrop -V 10 -d
test@test.com

问题一:
Q
Aug 7 22:26:22 mail postfix/smtpd[16829]: warning: xsasl_cyrus_server_get_mechanism_list:
no applicable SASL mechanisms
Aug 7 22:26:22 mail postfix/smtpd[16829]: fatal: no SASL authentication mechanisms
Aug 7 22:26:23 mail postfix/master[16825]: warning: process /usr/libexec/postfix/smtpd
pid 16829 exit status 1
Aug 7 22:26:23 mail postfix/master[16825]: warning: /usr/libexec/postfix/smtpd:
bad command startup -- throttling
Aug 7 22:28:06 mail postfix/smtpd[16830]: warning: xsasl_cyrus_server_get_mechanism_list:
no applicable SASL mechanisms
Aug 7 22:28:06 mail postfix/smtpd[16830]: fatal: no SASL authentication mechanisms
Aug 7 22:28:07 mail postfix/master[16825]: warning: process /usr/libexec/postfix/smtpd
pid 16830 exit status 1 
A
ln -s /usr/local/lib/sasl2 /usr/lib/sasl2 

问题二:
Q
Jan 15 20:24:43 localhost postfix/smtpd[3048]: warning: SASL authentication problem:
unable to open Berkeley db /etc/sasldb2: No such file or directory 
A
系统已经安装sasl-cyrus 删除掉,然后编译重装 

问题三:
Q
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: 
A
[root@mail tmp]# tar zxvf DBD-mysql-3.0008.tar.gz 重新安装 

问题四:
Q
Can't chdir to /home/mailbox//Maildir, No such file or directory 
A
不能进入邮件目录,请先在extman后台建立postmaster用户 

问题五:
Q
SELECT username, password, "", '1001', '1001', concat('/var/mailbox/',maildir), "", "",
username, "" FROM mailbox WHERE username = "
test@test.com"
maildrop: Timeout quota exceeded. 
A
请检查/usr/local/authlib/etc/authlib/mysqlauthrc的quota配置项 

问题六:
Q
sh: /usr/sbin/sendmail: No such file or directory 
A
ln -s /usr/local/postfix-2.2.8/src/sendmail/sendmail /usr/sbin/sendmail 

问题八:
Q
error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory 
A
[root@linux tmp]# rpm -ivh compat-libstdc++-33-3.2.3-47.3.i386.rpm 

问题九:
Q
Starting mail statistics grapher: mailgraph_ext
Can't locate RRDs.pm in @INC (@INC contains:
/usr/lib/perl5/5.8.5/i386-linux-thread-multi 
A
ln -sv /usr/local/rrdtool/lib/perl/5.8.5/i386-linux-thread-multi/RRDs.pm \
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/ 

问题十:
Q
Can't locate loadable object for module RRDs in @INC (@INC contains:
/usr/lib/perl5/5.8.5/i386-linux-thread-multi 
A
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/ 

问题十一:
Q
Can't load '/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/GD/GD.so'
for module GD: libgd.so.2:
cannot open shared object file: No such file or directory at
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm
line 230., referer: [url]http://192.168.44.200/extman/cgi/index.cgi[/url] 
A
[root@linux tmp]# vi /etc/ld.so.conf
[root@linux tmp]# less /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/X11R6/lib
/usr/local/mysql/lib
/usr/local/BerkeleyDB/lib
/usr/local/authlib/lib/courier-authlib
/usr/local/sasl2/lib
/usr/local/sasl2/lib/sasl2
/usr/local/clamav/lib
/usr/local/lib
/usr/local/authlib/lib/courier-authlib
/usr/local/gd/lib
/usr/local/jpeg/lib
/usr/local/fontconfig/lib
/usr/local/freetype2/lib
/usr/local/png/lib
[root@linux tmp]# ldconfig -v 

问题七:
Q
Jan 28 05:04:56 linux postfix/pickup[13892]: DEBD68075: uid=0 from=<root>
Jan 28 05:04:56 linux postfix/cleanup[14026]: DEBD68075: hold: header Received:
by linux.test.com (Postfix, from userid 0)??id DEBD68075; Mon, 28 Jan 2008 05:04
:56 +0800 (CST) from local; from=<
root@test.com>
Jan 28 05:04:56 linux postfix/cleanup[14026]: DEBD68075: message-id=<20080127210
456.DEBD68075@linux.test.com
A
不要将amavisd和MailScanner装在一起 ##可能有其它解决办法吧 
 
问题十二:
Q
httpd: Syntax error on line 99 of /etc/httpd/httpd.conf:
Cannot load /usr/local/\httpd/modules/libphp5.so into server: /usr/local/\httpd/modules/libphp5.so:
cannot restore segment prot after reloc: Permission denied 
A
1:禁用selinux
2:chcon -t texrel_shlib_t /usr/local/apache2/modules/*.so 
 
问题十三:
Q
Jun 20 15:29:08 mail authdaemond: authldaplib: sysusername=<null>, sysuserid=1001, sysgroupid=1001,
homedir=/var/mailbox/test.com/test01,
address=test01@test.com, fullname=test01,
maildir=test.com/test01/Maildir/, quota=5242880S, options=<null>
Jun 20 15:29:08 mail authdaemond: authldaplib: clearpasswd=<null>,
passwd=$1$8pBM6cXc$Va6UkybwOdSyExU82pQ1A0
Jun 20 15:29:08 mail authdaemond: rebinding with DN
'mail=test01@test.com,virtualDomain=test.com,o=extmailAccount,dc=test.com'
to validate password
Jun 20 15:29:08 mail authdaemond: authentication bind failed, invalid credentials
 
A
vi /etc/authlib/authldaprc
72 #LDAP_AUTHBIND 1 
 
问题十四:
Q
pop3d: chdir test.com/test01: No such file or directory 
A
vi /etc/authlib/authldaprc
#LDAP_MAILDIR mailMessageStore 
 
问题十五:
Q
configure: error: Please fix the library issues listed above and try again. 
A
cp /usr/local/png/lib/pkgconfig/libpng.pc /usr/lib/pkgconfig/ 

问题十六:
Q
Can't locate GD.pm in @INC (@INC contains: 
A
安装GD-2.35.tar.gz 

问题十七:
Q
怎样查看postfix日志成功接收到邮件:(交货到邮件目录) 
A
cat /var/log/maillog |grep "delivered to maildir"
cat /var/log/maillog |grep "delivered to maildir" | egrep -o "(\w+)([@]{1}\w+[.]{1,})(\w+)" 

问题十八:
Q
怎样取当天日志: 
A
cat /var/log/maillog | egrep "`data | awk "`'{print ""$2" "$3""}'`" 

问题十九:
Q
怎样取指定日期日志: 
A
cat /var/log/maill | grep "^Sep\ 25" | egrep "reject|warning|error|fatal|panic" | more 
最后就是关于邮件的备份和邮件服务器防火墙方面的策略了. 到些为止.
 
 
本文参照:
再此感谢.