DNS服务器搭建
第一步
搭建DNS服务器使DNS服务器能够解析mail.hf.com为192.168.101.2
首先设置ip与主机
[root@localhost ~]# grep HOSTNAME /etc/sysconfig/network
HOSTNAME=dns.hf.com(设置主机名)
[root@localhost ~]# ifconfig eth0 |grep "inet addr"(配置网卡)
          inet addr:192.168.101.2 Bcast:192.168.101.255 Mask:255.255.255.0
[root@localhost ~]#
配置本地yum仓库
[root@localhost ~]# mkdir /mnt/cdrom
[root@localhost ~]# mount /dev/cdrom /mnt/cdrom
[root@localhost ~]# grep baseurl /etc/yum.repos.d/rhel-debuginfo.repo
baseurl=file:///mnt/cdrom/Server
[root@localhost ~]# grep enabled /etc/yum.repos.d/rhel-debuginfo.repo
enabled=1
[root@localhost ~]#
 
 
第二步
安装DNS包 并配置相关文件
[root@dns ~]#yum -y install bind bind-chroot caching-nameserver
[root@dns ~]# vim /var/named/chroot/etc/named.conf(修改DNS住配置文件)
14 options {
 15         listen-on port 53 { any; };
 16         listen-on-v6 port 53 { ::1; };
27         allow-query     { any; };
 28         allow-query-cache { localhost; };
36 view localhost_resolver {
 37         match-clients      { any; };
 38         match-destinations { any; };
 39         recursion yes;
 40         include "/etc/named.rfc1912.zones";
 41 };
修改区域文件(建立正向和反向区域)
[root@dns ~]# vim /var/named/chroot/etc/named.rfc1912.zones
zone "localdomain" IN {
         type master;
          file "hf.com.db";
         allow-update { none; };
 };
 
  zone "101.169,192.in-addr.arpa" IN {
          type master;
         file "back.hf.com.db";
         allow-update { none; };
  };      
[root@dns ~]# cd /var/named/chroot/var/named/
[root@dns named]# cp -p named.zero hf.com.db
[root@dns named]# cp -p hf.com.db back.hf.com.db
[root@dns named]# cat hf.com.db (正向文件)
$TTL    86400
@               IN SOA hf.com.      root.hf.com. (
                                201204010             ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
        IN      NS      dns.hf.com.
        IN      MX 5   mail.hf.com.
dns     IN      A       192.168.101.2
mail    IN      A       192.168.101.1
 
[root@dns named]# cat back.hf.com.db(反向文件)
$TTL    86400
@               IN SOA hf.com.      root.hf.com. (
                                201204010             ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
        IN      NS      dns.hf.com.
        IN      MX 5   mail.hf.com.
2       IN      PTR     dns.hf.com.
1       IN      PTR     mail.hf.com.
 
[root@dns named]#
 
 
 
 
邮件服务器搭建
第一步 配置基本
[root@mail ~]# ifconfig eth0 |grep "inet addr"(配置网卡信息)
          inet addr:192.168.101.1 Bcast:192.168.101.255 Mask:255.255.255.0
[root@mail ~]# grep HOSTNAME /etc/sysconfig/network
HOSTNAME=mail.hf.com(主机名)
[root@mail ~]#
[root@mail ~]# cat /etc/yum.repos.d/rhel-debuginfo.repo (yum信息)
[rhel-debuginfo]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///mnt/cdrom/Server
enabled=1
gpgcheck=1
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
[root@mail ~]#
 
首先把系统自带的sendmail 服务关闭或者卸载
[root@mail ~]#service sendmial stop
[root@mail ~]#chkconfig –level 35 sendmail off
 
 
 
第二步 安装apache软件
下面我们将把所有需要的安装包放到并解压到/usr/src/下面以方便我们统一管理维护
[root@mail ~]# cd /usr/src/
[root@mail src]# tar -zxvf httpd-2.2.9.tar.gz 解压到当前目录
[root@mail src]# cd httpd-2.2.9
[root@mail httpd-2.2.9]# ./configure --prefix=/usr/local/apache2 --enable-rewrite --enable-so --enable-auth-digest --enable-cgi --with-ssl=/usr/lib --enable-ssl --enable-suexec --with-suexec-caller=daemon --with-suexec-docroot=/usr/local/apache2/htdocs
[root@mail httpd-2.2.9]# make 编译
[root@mail httpd-2.2.9]# make install 安装
[root@mail httpd-2.2.9]# vim /usr/local/apache2/bin/apachectl修改文件
#!/bin/sh
#chkconfig:35 85 15
#description:Apach is a World Wibe Web Server
[root@mail httpd-2.2.9]# cd /usr/local/apache2/bin/ 进入目录
[root@mail bin]# cp apachectl /etc/init.d/apache 复制文件
[root@mail bin]# chkconfig --add apache 增加服务
[root@mail bin]# service apache start 启动服务
访问测试 输入 http://mail.hf.com
 

 
第三步创建mysql服务器
首先解压
[root@mail ~]# cd /usr/src/
[root@mail src]# tar -zxvf mysql-5.0.95.tar.gz
[root@mail src]# cd mysql-5.0.95(进入目录)
[root@mail mysql-5.0.95]# useradd -M -s /sbin/nologin mysql 创建用户mysql
[root@mail mysql-5.0.95]# yum -y install libtermcap-devel安装依赖(默认情况下已安装)
预编译
[root@mail mysql-5.0.95]#./configure --prefix=/usr/local/mysql --without-debug --with-extra-charsets=utf8,gbk --enable-assembler --with-mysql-ldflags=-all-static --with-client-ldflags=-all-static --with-unix-socket-path=/tmp/mysql.sock --with-ssl --with-mysqld-us
 
[root@mail mysql-5.0.95]#make 编译
[root@mail mysql-5.0.95]#make install 安装
[root@mail mysql-5.0.95]# cp support-files/my-medium.cnf /etc/my.cnf 拷贝文件
[root@mail mysql-5.0.95]# chown -R root.mysql /usr/local/mysql/修改所属及所属组
[root@mail mysql-5.0.95]# chown -R mysql.mysql /usr/local/mysql/var
[root@mail mysql-5.0.95]# echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf将路径导入
[root@mail mysql-5.0.95]# ldconfig
[ro [root@mail mysql-5.0.95]# ln -s /usr/local/mysql/lib/mysql/lib* /usr/lib 创建软连接
[root@mail mysql-5.0.95]# ln -s /usr/local/mysql/bin/* /usr/local/bin/ 创建软连接
[root@mail mysql-5.0.95]# mysql_install_db --user=mysql
[root@mail mysql-5.0.95]# cp support-files/mysql.server /etc/init.d/mysqld
[root@mail mysql-5.0.95]# echo "export PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
[root@mail mysql-5.0.95]# mysqladmin -u root password 123456
[root@mail mysql-5.0.95]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.95-log Source distribution
 
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
mysql>
 

第四步搭建PHP
首先安装依赖
[root@mail src]# tar -jxvf libmcrypt-2.5.8.tar.bz2
[root@mail src]# cd libmcrypt-2.5.8
[root@mail libmcrypt-2.5.8]# ./config
[root@mail libmcrypt-2.5.8]# make
[root@mail libmcrypt-2.5.8]# make install
[root@mail libmcrypt-2.5.8]# cd ../
[root@mail src]# tar -jxvf mhash-0.9.9.9.tar.bz2
[root@mail src]# cd mhash-0.9.9.9
[root@mail mhash-0.9.9.9]# ./configure
[root@mail mhash-0.9.9.9]# make
[root@mail mhash-0.9.9.9]# make install
[root@mail mhash-0.9.9.9]# ln -s /usr/local/lib/libmcrypt* /usr/lib
[root@mail mhash-0.9.9.9]# ln -s /usr/local/lib/libmhash.* /usr/lib/
[root@mail mhash-0.9.9.9]# cd ../
[root@mail src]# tar -zxvf mcrypt-2.6.8.tar.gz
[root@mail src]# cd mcrypt-2.6.8
[root@mail mcrypt-2.6.8]# ./configure
[root@mail mcrypt-2.6.8]# make
[root@mail mcrypt-2.6.8]# make install
安装php包
[root@mail mcrypt-2.6.8]# cd ../
[root@mail src]# tar -zxvf php-5.4.0.tar.gz
[root@mail src]# cd php-5.4.0
[root@mail php-5.4.0]#
[root@mail php-5.4.0]# ./configure --prefix=/usr/local/php5 --with-mysql=/usr/local/mysql/ --with-zlib --enable-xml --disable-rpath --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --with-curl --with-curlwrappers --enable-fpm --enable-fastcgi --with-mcrypt --with-gd --with-openssl --with-mhash --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc -enable-zip --enable-soap --enable-mbstring --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/php5
[root@mail php-5.4.0]#make
[root@mail php-5.4.0]#make install
[root@mail php-5.4.0]# cp php.ini-production /usr/local/php5/php.ini
[root@mail php-5.4.0]# vim /usr/local/apache2/conf/httpd.conf
[root@mail php-5.2.13]# vim /usr/local/apache2/conf/httpd.conf
53 LoadModule php5_module        modules/libphp5.so
54 AddType application/x-httpd-php .php
167 <IfModule dir_module>
168     DirectoryIndex index.php index.html
169 </IfModule>
第五部测试
[root@mail php-5.4.0]#[root@mail php-5.2.13]# cat /usr/local/apache2/htdocs/index.php
<?php
        phpinfo();
?>
 在浏览器中输入http://mail.hf.com/indx.php
 
 

 
 
[root@mail php-5.4.0]# vim /usr/local/php5/php.ini
error_reporting = E_ALL & ~E_DEPRECATED
date.timezone = Asia/Shanghai
 
[root@mail php-5.4.0]#service apache restart
[root@mail php-5.4.0]#
 
[root@mail htdocs]# cat index.php 将index.php修改为 测试 与mysql的链接
<?php
$link=mysql_connect('localhost','test','');
if (!$link) echo"Fail sorry";
else echo "OKOKOKOK";
        phpinfo();
?>
[root@mail htdocs]#
测试结果如下
 

 
 
 
第六步搭建postfix
[root@mail ~]# groupadd -g 1200 postdrop
[root@mail ~]# groupadd -g 1000 postfix
[root@mail ~]# useradd -M -u 1000 -g postfix -G postdrop -s /sbin/nologin postfix
[root@mail ~]# cd /usr/src/
[root@mail src]# tar -zxvf postfix-2.6.2.tar.gz
[root@mail src]# cd postfix-2.6.2
[root@mail src]# gunzip postfix-2.6.2-vda-ng.patch.gz
[root@mail postfix-2.6.2]#
[root@mail postfix-2.6.2]# patch -p1 < ../postfix-2.6.2-vda-ng.patch
patching file README_FILES/VDA_README
patching file src/global/mail_params.h
patching file src/util/file_limit.c
patching file src/virtual/mailbox.c
patching file src/virtual/maildir.c
patching file src/virtual/virtual.c
patching file src/virtual/virtual.h
[root@mail postfix-2.6.2]#
[root@mail postfix-2.6.2]# make makefile 'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl' 'AUXLIBS=-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lm -L/usr/lib/sasl2 -lsasl2'
[root@mail postfix-2.6.2]# make
[root@mail postfix-2.6.2]# make install
[root@mail postfix-2.6.2]#vim /etc/postfix/main.cf 修改文件
inet_interfaces = all 默认设置
myhostname = mail.hf.com 主机名
mydomain = hf.com 邮件域名
myorigin = $mydomain 外发邮件时发件人地址中的邮件域名
mydestination = $mydomain, $myhostname 可接收的邮件地址中的域名
home_mailbox = Maildir/ 邮件存储位置格式
[root@mail postfix-2.6.2]# postfix check
[root@mail postfix-2.6.2]# postfix start
postfix/postfix-script: starting the Postfix mail system
第七步发送邮件测试
 
[root@mail postfix-2.6.2]# useradd -g mailusers -s /sbin/nologin kaimen
[root@mail postfix-2.6.2]# useradd -g mailusers -s /sbin/nologin guanmen
[root@mail postfix-2.6.2]# passwd kaimen
Changing password for user kaimen.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@mail postfix-2.6.2]# passwd guanmen
Changing password for user guanmen.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@mail postfix-2.6.2]#
发送邮件
[root@mail postfix-2.6.2]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mail.hf.com ESMTP Postfix
hello localhost
502 5.5.2 Error: command not recognized
HELO localhost
250 mail.hf.com
mail from:kaimen@hf.com        
250 2.1.0 Ok
rcpt to:guanmen@hf.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
Subject:A test mail
Hello
this is a test mail if you are guanmen .OK!
.
250 2.0.0 Ok: queued as DE0902584E7
quit
221 2.0.0 Bye
Connection closed by foreign host.
收件查看
[root@mail postfix-2.6.2]# cat /home/guanmen/Maildir/new/1332627934.V802I178a0aM806505.mail.hf.com
Return-Path: <kaimen@hf.com>
X-Original-To: guanmen@hf.com
Delivered-To: guanmen@hf.com
Received: from localhost (localhost.localdomain [127.0.0.1])
       by mail.hf.com (Postfix) with SMTP id DE0902584E7
        for <guanmen@hf.com>; Sun, 25 Mar 2012 06:22:47 +0800 (CST)
Subject:A test mail
Message-Id: <20120324222315.DE0902584E7@mail.hf.com>
Date: Sun, 25 Mar 2012 06:22:47 +0800 (CST)
From: kaimen@hf.com
To: undisclosed-recipients:;
 
Hello
this is a test mail if you are guanmen .OK!
[root@mail postfix-2.6.2]#
哈哈 终于成功了一点 继续努力
第八步接下来构建邮件接收服务器
[root@mail src]# tar -zxvf dovecot-1.1.4.tar.gz
[root@mail src]# cd dovecot-1.1.4
[root@mail dovecot-1.1.4]# ./configure --sysconfdir=/etc --with-mysql
[root@mail dovecot-1.1.4]# make
[root@mail dovecot-1.1.4]# make install
拷贝配置文件,并对其进行修改
[root@mail dovecot-1.1.4]# cp /etc/dovecot-example.conf /etc/dovecot.conf
[root@mail dovecot-1.1.4]# vim /etc/dovecot.conf
24 protocols = pop3 imap
 48 disable_plaintext_auth = no
 89 ssl = no
218 mail_location = maildir:~/Maildir
 创建
[root@mail dovecot-1.1.4]# vim /etc/pam.d/dovecot
auth required pam_nologin.so
auth include system-auth
account include system-auth
session include system-auth
[root@mail dovecot-1.1.4]# vim /etc/pam.d/dovecot
[root@mail dovecot-1.1.4]# /usr/local/sbin/dovecot -c /etc/dovecot.conf
Error: Login user doesn't exist: dovecot
Fatal: Invalid configuration in /etc/dovecot.conf
[root@mail dovecot-1.1.4]# useradd -M -s /sbin/nologin dovecot
[root@mail dovecot-1.1.4]# /usr/local/sbin/dovecot -c /etc/dovecot.conf
[root@mail dovecot-1.1.4]# echo "/usr/local/sbin/dovecot -c /etc/dovecot.conf" >
> /etc/rc.local
[root@mail dovecot-1.1.4]# netstat -tupln |grep dovecot查看端口
tcp        0      0 0.0.0.0:110                 0.0.0.0:*                   LISTEN      18406/dovecot      
tcp        0      0 0.0.0.0:143                 0.0.0.0:*                   LISTEN      18406/dovecot      
测试
[root@mail dovecot-1.1.4]# telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
+OK Dovecot ready.
user guanmen
+OK
pass guanmen
+OK Logged in.
list
+OK 1 messages:
1 492
.
retr 1
+OK 492 octets
Return-Path: <kaimen@hf.com>
X-Original-To: guanmen@hf.com
Delivered-To: guanmen@hf.com
Received: from localhost (localhost.localdomain [127.0.0.1])
        by mail.hf.com (Postfix) with SMTP id DE0902584E7
        for <guanmen@hf.com>; Sun, 25 Mar 2012 06:22:47 +0800 (CST)
Subject:A test mail
Message-Id: <20120324222315.DE0902584E7@mail.hf.com>
Date: Sun, 25 Mar 2012 06:22:47 +0800 (CST)
From: kaimen@hf.com
To: undisclosed-recipients:;
 
Hello
this is a test mail if you are guanmen .OK!
.
quit
+OK Logging out.
Connection closed by foreign host.
[root@mail dovecot-1.1.4]#
说明dovecot成功了
第九步配置SquirrelMAIL
[root@mail src]# tar -zxvf squirrelmail-webmail-1.4.22.tar.gz
[root@mail apache2]# cd /usr/src/
[root@mail src]# mv squirrelmail-webmail-1.4.22 webmail
[root@mail src]# cd webmail/
[root@mail webmail]# mkdir -p attach data
[root@mail webmail]# chown -R daemon:daemon attach/ data/
[root@mail webmail]# chmod 730 attach/
[root@mail webmail]# cd config
[root@mail config]# cp config_default.php config.php
[root@mail config]# vim config.php修改配置文件
118 $domain = 'hf.cn';
231 $imap_server_type = 'dovecot';
499 $data_dir = '/usr/local/apache2/htdocs/webmail/data/';
517 $attachment_dir = '/usr/local/apache2/htdocs/webmail/attach/';
1012 $squirrelmail_default_language = 'zh_CN';
1027 $default_charset = 'zh_CN.UTF-8';
 
重启 服务
在浏览器地址栏中输入http://mail.hf.com/webmail
 
 

 

 

 

 

测试成功
第十步安装extman
[root@mail ~]# service mysqld restart
[root@mail ~]# service mysqld restart
[root@mail ~]# cd /usr/src/
[root@mail src]# tar -zxvf extman-0.2.5.tar.gz
 [root@mail src]# cd extman-0.2.5/docs/
[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]#
[root@mail docs]# postconf -m |grep mysql
mysql
[root@mail docs]#
第十一步配置postfix
root@mail docs]# Vim /usr/src/extman-0.25-docs
readme_directory = no
virtual_mailbox_base=/mailbox
virtual_alias_maps=mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_maps=mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_domains=mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_uid_maps = static:1000
virtual_gid_maps = static:1000
[root@mail docs]# cp mysql_virtual_* /etc/postfix/
第十二步虚拟用户设置SMTP发信认证
[root@mail src]# tar -jxvf courier-authlib-0.62.4.tar.bz2
[root@mail src]# cd courier-authlib-0.62.4
[root@mail courier-authlib-0.62.4]# ./configure --prefix=/usr/local/courier-authlib --without-stdheaderdir --with-authmysql --with-redhat --with-mysql-libs=/usr/local/mysql/lib/mysql --with-mysql-includes=/usr/local/mysql/include/mysql
[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]# echo "/usr/local/courier-authlib/lib/courier-authlib" >> /etc/ld.so.conf
[root@mail courier-authlib-0.62.4]# ldconfig
[root@mail courier-authlib-0.62.4]#
[root@mail authlib]# cp authdaemonrc authdaemonrc.bak
[root@mail authlib]# vim authdaemonrc
27 authmodulelist="authmysql"
34 authmodulelistorig="authmysql"
[root@mail authlib]# chmod -R 755 /usr/local/courier-authlib/var/spool/authdaemon/
[root@mail authlib]# cp authmysqlrc authmysqlrc.bak
[root@mail authlib]# vim authmysqlrc
26 MYSQL_SERVER           localhost //mysql数据库服务器位置
 27 MYSQL_USERNAME        extmail   //管理员帐号
 28 MYSQL_PASSWORD        extmail  //密码
49 MYSQL_SOCKET           /tmp/mysql.sock
68 MYSQL_DATABASE        extmail    //虚拟用户数据库
 83 MYSQL_USER_TABLE      mailbox  //从mailbox表获取邮件账户信息
92 MYSQL_CRYPT_PWFIELD password  //从password获取密码
113 MYSQL_UID_FIELD       uidnumber  //从uidnumber字段映射本地uid
119 MYSQL_GID_FIELD       gidnumber  //从gidnumber字段映射本地gid
128 MYSQL_LOGIN_FIELD    username  
133 MYSQL_HOME_FIELD    concat('/mailbox/',homedir)
139 MYSQL_NAME_FIELD     name
150 MYSQL_MAILDIR_FIELD concat('/mailbox/',maildir)
复制脚本启动服务
[root@mail authlib]# cp /usr/src/courier-authlib-0.62.4/courier-authlib.sysvinit /etc/
init.d/courier-authlib
[root@mail authlib]# chmod 755 /etc/init.d/courier-authlib 更改权限
[root@mail authlib]# chkconfig --level 35 courier-authlib on 设置开机启动
[root@mail authlib]# service courier-authlib start
Starting Courier authentication services: authdaemond
修改Cyrus sasl
[root@mail authlib]# vim /usr/lib/sasl2/smtpd.conf
[root@mail authlib]# cat /usr/lib/sasl2/smtpd.conf
pwcheck_method:authdaemond
authdaemond_path:/usr/local/courier-authlib/var/spool/authdaemon/socket
环境变量
[root@mail authlib]#
修改Dovecot配置
[root@mail authlib]# vim /etc/dovecot.conf 
 mail_location = maildir:/mailbox/%d/%n/Maildir
 auth default {
   mechanisms = plain
   passdb sql {
     args = /etc/dovecot-mysql.conf
   }
   userdb sql {
     args = /etc/dovecot-mysql.conf
   }
建立查询数据库
[root@mail authlib]# vim /etc/dovecot-mysql.conf
driver = mysql
connect = host=localhost dbname=extmail user=extmail password=extmail
default_pass_scheme = CRYPT
password_query = SELECT username AS user,password AS password FROM mailbox WHERE username = '%u'
user_query = SELECT maildir,uidnumber AS uid,gidnumber AS gid FROM mailbox WHERE username = '%u'
建立虚拟用户
[root@mail authlib]# mkdir -p /mailbox/extmail.org/postmaster/Maildir/
[root@mail authlib]# chown -R postfix:postfix /mailbox/
[root@mail authlib]# pkill dovecot
[root@mail authlib]# dovecot
[root@mail Maildir]# chown -R postfix:postfix /mailbox
[root@mail Maildir]# /usr/local/courier-authlib/sbin/authtest -s login postmaster@extmail.org extmail
Authentication succeeded.   虚拟用户测试成功
 
     Authenticated: postmaster@extmail.org (uid 1000, gid 1000)
    Home Directory: /mailboxextmail.org/postmaster
           Maildir: /mailbox/extmail.org/postmaster/Maildir/
             Quota: (none)
Encrypted Password: $1$phz1mRrj$3ok6BjeaoJYWDBsEPZb5C0
Cleartext Password: extmail
           Options: (none)
[root@mail Maildir]#
第十三步 Extmail平台搭建
需要三个依赖包
[root@mail ~]# cd /usr/src/
[root@mail src]# tar -zxvf Unix-Syslog-1.1.tar.gz
[root@mail src]# cd Unix-Syslog-1.1
[root@mail Unix-Syslog-1.1]# perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for Unix::Syslog
[root@mail Unix-Syslog-1.1]# make
[root@mail Unix-Syslog-1.1]# make install
[root@mail ~]# cd /usr/src/
[root@mail src]# tar -zxvf DBI-1.616.tar.gz
[root@mail src]# cd DBI-1.616
[root@mail DBI-1.616]# perl Makefile.PL
[root@mail DBI-1.616]#make
[root@mail DBI-1.616]#make install
 
 
[root@mail ~]# cd /usr/src/
[root@mail src]# tar -zxvf DBD-mysql-4.020.tar.gz
[root@mail src]# cd DBD-mysql-4.020
[root@mail DBD-mysql-4.020]# perl Makefile.PL
[root@mail DBD-mysql-4.020]# make
[root@mail DBD-mysql-4.020]# make intall
安装Extmail
[root@mail DBI-1.616]# cd ../
[root@mail src]# tar -zxvf extmail-1.0.5.tar.gz
[root@mail src]# mv extmail-1.0.5 /usr/local/apache2/htdocs/
[root@mail src]# cd /usr/local/apache2/htdocs/
[root@mail htdocs]# mv extmail-1.0.5 extmail
[root@mail htdocs]# cd extmail/
[root@mail extmail]# chown -R postfix:postfix cgi
[root@mail extmail]# cp webmail.cf.default webmail.cf
修改配置文件
 
[root@mail extmail]# vim webmail.cf
2 SYS_CONFIG = /usr/local/apache2/htdocs/extmail/
5 SYS_LANGDIR = /usr/local/apache2/htdocs/extmail/lang
8 SYS_TEMPLDIR = /usr/local/apache2/htdocs/extmail/html
112 SYS_MAILDIR_BASE = /mailbox
124 SYS_MYSQL_USER = extmail
125 SYS_MYSQL_PASS = extmail
126 SYS_MYSQL_DB = extmail
127 SYS_MYSQL_HOST = localhost
128 SYS_MYSQL_SOCKET = /tmp/mysql.sock
 
 
 
 
 
 
调整apache主配置文件添加extman相关路径
#vim  /usr/local/apache2/conf/httpd.conf
NameVirtualHost *:80
<VirtualHost *:80>
ServerName mail.hf.com
DocumentRoot /usr/local/apache2/htdocs/extmail/html/
ScriptAlias /extmail/cgi/ "/usr/local/apache2/htdocs/extmail/cgi/"
Alias /extmail "/usr/local/apache2/htdocs/extmail/html/"
ScriptAlias /extman/cgi "/usr/local/apache2/htdocs/extman/cgi/"
Alias /extman "/usr/local/apache2/htdocs/extman/html/"
</VirtualHost>
#/usr/local/apache2/bin/apachectl restart
客户端访问登陆测试
 

 
 
 
 
 

 
 默写功能还未能成功实现 待续