在DEBIAN 下安装POSTFIX 邮件系统

Ver:0.1

 

软件简介:

所需软件 软件作用
FreeBSD 提供稳定的操作
postfix MTA邮件系统传输代理
MySQL 后台数据库
Cyrus-SASL2 发信认证
Courier-IMAP 提供POP3/IMAP服务
maildrop MDA 邮件投递代理
amavisd-new 提供内容过滤,调用clamav杀毒,调用spamassassin进行邮件评分
clamav 杀毒
Extman 后台用户管理
ExtMail 一个高效率的webmail

作者:冯勇 fengyongchuang # yahoo.com.cn (≠&键盘人生$:71633908)

日期:2006-05-18

技术支持网站:www.extmail.org

QQ群:

网管之家: 5929685
网管之家-UNIX:3791457
Extmail 群/postfix 1: 6769767
Extmail 群/postfix 2: 18051473

版权所有,复制或转载时请保留作者信息。尊重他人的劳动成果就等于尊重自己。

如有问题请到下面网址提问:

http://www.extmail.org/forum/archive/2/0605/1771.html

本次文章的配置文件:mail.tar.gz

一直想写一篇DEBIAN 下的邮件系统安装文档,因为自己太懒一直没有动手,今天闲着没事,把文档写出来,供各位参考同时给自己留一份笔记。

这次没有使用maildrop,原因:
1、debian 里的maildrop 版本好像是1.7的,配置有点复杂,所以没有去研究,如果那位兄弟配置成功,告诉我。
2、公司用webmail 的人少,邮件过滤规则很少人用,以前用maildrop 主要是用他来将垃圾邮件移到垃圾信箱,现在使用了slockd ,垃圾邮件少了,再说没有用webmail。

 

一、安装DEBAIN

1、debian 的好处

其实我喜欢很喜欢这个LINUX发行版,因为他有点像freeBSD 的软件安装方式。我对debian 并不是十分熟悉,如果有写错的地方,请指正。

2、下载debian 可以到官方网站或linuxsir 下载。

我使用的版本是:debian-31r2-i386-netinst.iso

http://debian.linuxsir.org/main/?q=node/92

http://www.us.debian.org/

http://debian.cn99.com

...

3、安装

跟据我的爱好喜欢拿10G 左右的空间作为系统,把数据资料放到另一个分区或硬盘中,并装载到/home/data 这个目录,如果你不喜欢这样,可以跟据自己的爱好,修改配置文档的路径。

4、主机名

安装时可以输入主机名,或者编辑/etc/host.conf 修改你的主机名。

这里使用 mail.extmail.org 为例。

5、更新你的软件包

在复制完文件后,会出现一个配置过程,在配置 apt 那里添加一个安装源,选择ftp 现先择 china 可以选择下面两个安装源:

ftp.linuxforum.net 或 debian.cn99.com

本人用的是网通ADSL 选择ftp.linuxforum.net 好像快一点。

如果你在安装时跳过了这一步,可以进入系统后可以再次运行base-config 选择configure apt 进行再次配置。

6、安装SSH

为了方便安装,建义使用SSH 进行远程操作,方便复制与粘贴。

apt-get install ssh

*至于apt 系统的使用方法,建议大家去看debian 的文档,写得非常详细。

http://debian.linuxsir.org/book/reference/lyoo/

二、安装软件

1、下载需要的软件

到www.extmail.org 下载extmail/extman/slockd ,通过FTP 上传到服务器,并解压

tar zxvf extmail-0\[1\].23-20060219.tar.gz

tar zxvf extman-0\[1\].15-20060518.tar.gz

tar zxvf slockd-0\[1\].08.tar.gz

 

2、安装mysql

mail:~# apt-get install mysql-server

安装完mysql 后,将extman 的数据导入到mysql 中

mail:/home/fy138# cd extman-0.15-20060518/docs

mail:/home/fy138/extman-0.15-20060518/docs# mysql -uroot <extmail.sql

打开extman-0.15-20060518/docs/init.sql 将里{crypt} 这些字符串删除,否则pop3可能无法登陆,如果你懒得去修改init.sql 可以安装完成后用phpmyadmin修改相关记录。

将uidnumber/gidnumber 改为postfix 的uid/gid 查看uid/gid 方法

mail:/etc/postfix# id postfix
uid=105(postfix) gid=106(postfix) groups=106(postfix)

mail:/home/fy138/extman-0.15-20060518/docs# mysql -uroot <init.sql

3、安装apache 2

mail:~# apt-get install apache2

4、安装php4

mail:~# apt-get install php4 php4-mysql libapache2-mod-php4 phpmyadmin

5、安装postfix

mail:~# apt-get install postfix postfix-mysql postfix-tls postfix-doc

在弹出的对话框中选择No configuration。

A、将extman目录下所有 mysql_virtul_*.cf 复制到/etc/postfix 目录下。

mail:~#cd /home/fy138/extman-0.15-20060518/docs

注意,这里我的存放位置是/home/fy138 ,不要照搬了。

mail:/home/fy138/extman-0.15-20060518/docs# cp mysql_virtual_*.cf /etc/postfix/

B、配置 /etc/postfix/main.cf,如果你的main.cf 已存先改名再重新编辑一个,加入下面的内容。

###################BASE##################

myhostname=mail.extmail.org  
mydomain = extmail.org
mydestination = $myhostname
local_recipient_maps = 
smtpd_banner = extmail.org ESMTP Mail System
message_size_limit = 14680064
#################MySQL################

virtual_gid_maps=static:106
virtual_uid_maps=static:105
virtual_transport = virtual virtual_alias_maps =mysql:/etc/postfix/mysql_virtual_alias_maps.cf virtual_mailbox_base = /home/data/domains virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf ################Quota################ virtual_create_maildirsize = yes virtual_mailbox_extended = yes virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf virtual_mailbox_limit_override = yes virtual_maildir_limit_message = Sorry,the user's Maildir has overdrawn his diskspace quota ,please tray again later. virtual_overquota_bounce = yes ##############SASL#################### smtpd_sasl_auth_enable = yes smtpd_sasl2_auth_enable = yes smtpd_sasl_security_options = noanonymous broken_sasl_auth_clients = yes smtpd_recipient_restrictions = permit_mynetworks,
permit_sasl_authenticated,
reject_non_fqdn_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unauth_destination,
reject_unauth_pipelining,
reject_invalid_hostname,
check_policy_service inet:127.0.0.1:10030

将 /etc/postfix/目录下面以mysql_virtul_*.cf 开头的文件,将里面的hosts=localhost 改为hosts=127.0.0.1 ,否则postfix 连接mysql 会出现问题 。

如果更改master.cf 将postfix 不以chroot 方式运行是否正常?还没有去试。

 

将/etc/postfix/master.cf中的下面几行把注释去掉

# only used by postfix-tls
tlsmgr    fifo  -       -       n       300     1       tlsmgr
smtps     inet  n       -       n       -       -       smtpd -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
587       inet  n       -       n       -       -       smtpd -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes

 

6、安装cyrus-sasl2


mail:~# apt-get install libsasl2 libsasl2-modules libsasl2-modules-sql

创建/etc/postfix/sasl/smtpd.conf 加入下面的内容。

pwcheck_method:authdaemond
log_level:3
mech_list:PLAIN LOGIN
authdaemond_path:/var/run/courier/authdaemon/socket

注意:在进行smtpd 认证测试时,maillog 提示找不到 /var/run/courier/authdaemon/socket 通常是下面的问题 :1、权限 2、chroot 。

出错邮件日志:

May 20 17:35:26 mail postfix/smtpd[1229]: warning: SASL authentication failure: cannot connect to Courier authdaemond: No such file or directory

解决方法(引用wangpenghui 原文,Thanks! ^_^,本人使用了第二种方法,另外还要注意smtpd.conf文件中的空格!)

解决方法有如下两种,
1.对于postfix不做任何修改,而是在每次couier-authdaemon启动之后都创建

ln -f /var/run/courier/authdaemon/socket /var/spool/postfix/var/run/courier/authdaemon/socket

的硬链接. 同时对于
/var/run/courier/authdaemon/socket
/var/spool/postfix/var/run/courier/authdaemon/socket

的整个路径赋予postfix用户于读权限。一般为755.
2.第二种就是修改postfix中master.cf文件的如下行:
smtp inet n - - - - smtpd


smtp inet n - n - - smtpd

这样smtpd程序就不是运行在chroot状态,那么postfix的smtpd程序就可以通过smtpd.conf中的
authdaemond_path参数找到authdaemon的socket文件。不过也要注意权限问题,要不然就会出现connection refused的错误。这里指的权限是/var/run/courier/authdaemon/socket整个路径的权限,而不仅仅是socket文件的权限。

第二种方法相对于第一种方法来说,比较容易,但是增大了安全隐患。管理员可自行选择使用哪种方式。
当然,我这里也是抛砖引玉,肯定还有更好的解决办法。希望大家能够赐教。

参考:http://www.extmail.org/forum/archive/2/0605/1723.html

7、安装courier-imap

注意安装时,会提示你是否创建一个目录来放这些配置文件,要选择 YES 否则可能你的文件位置与下面配置的不一样。

mail:~# apt-get install courier-authdaemon courier-authmysql courier-base courier-imap courier-pop courier-pop-ssl courier-imap-ssl

A、配置courier-authdaemon ,autdaemon 是邮件系统认证的主要软件,很多人无法通过SMTPD认证多数问题在这里。

将/etc/courier/authdaemonrc 改名为 /etc/courier/authdaemonrc.bak

authmodulelist="authmysql"
authmodulelistorig="authmysql"
version="authdaemond.mysql"
daemons=5
authdaemover=/var/run/courier/authdaemon
subsystem=mail
DEBUG_LOGIN=2
DEFAULTOPTIONS="wbnodsn=1"

将/etc/courier/authmysqlrc 改名为 authmysqlrc.bak ,创建/etc/courier/authmysqlrc 输入下面的内容。

MYSQL_SERVER    localhost
MYSQL_USERNAME  extmail
MYSQL_PASSWORD  extmail
MYSQL_PORT      0
MYSQL_OPT       0
MYSQL_DATABASE  extmail
MYSQL_SELECT_CLAUSE     SELECT username,password,"",uidnumber,gidnumber,CONCAT('/home/data/domains/',homedir),CONCAT('/home/data/domains/',maildir),quota,name FROM mailbox WHERE username = '$(local_part)@$(domain)'

修改authdaemond 的权限,让其它程序有权限访问他,重启authdaemond

chmod -R +x /var/run/courier/authdaemon

/etc/init.d/courier-authdaemon restart

B、创建测试用户的目录

mail:/etc/postfix# id postfix
uid=105(postfix) gid=106(postfix) groups=106(postfix)

mail:/etc/courier# mkdir -p /home/data/domains/extmail.org/test

mail:/etc/courier# /usr/bin/maildirmake /home/data/domains/extmail.org/test/Maildir      
mail:/etc/courier# chown -R 105:106 /home/data/domains/

C、测试系统

打开一个窗口,输入 tail -f /var/log/mail.log

将测试的用户名和密码进行base64 编码

%perl -MMIME::Base64 -e 'print encode_base64("test\@extmail.org");'                   
dGVzdEBleHRtYWlsLm9yZw==
%perl -MMIME::Base64 -e 'print encode_base64("test");'      
dGVzdA==

测试smtpd 发邮件

mail:/etc/postfix# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 extmail.org ESMTP Mail System
ehlo test
250-mail.extmail.org
250-PIPELINING
250-SIZE 14680064
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250 8BITMIME
auth login
334 VXNlcm5hbWU6
dGVzdEBleHRtYWlsLm9yZw==
334 UGFzc3dvcmQ6
dGVzdA==
235 Authentication successful
mail from:<test@test.com>
250 Ok
rcpt to:<test@extmail.org>
250 Ok
data
354 End data with .
test
.
250 Ok: queued as C2FF131B85
quit
221 Bye
Connection closed by foreign host.

mail.log 应该有如下记录

May 20 19:37:32 mail postfix/smtpd[1763]: connect from localhost[127.0.0.1]
May 20 19:37:40 mail postfix/smtpd[1763]: disconnect from localhost[127.0.0.1]
May 20 19:37:43 mail postfix/smtpd[1763]: connect from localhost[127.0.0.1]
May 20 19:38:24 mail authdaemond.mysql: received auth request, service=smtp, authtype=login
May 20 19:38:24 mail authdaemond.mysql: authmysql: trying this module
May 20 19:38:24 mail authdaemond.mysql: SQL query: SELECT username,password,"",uidnumber,gidnumber,CONCAT('/home/data/domains/',homedir),CONCAT('/home/data/domains/',maildir),quota,name FROM mailbox WHERE username = 'test@extmail.org'
May 20 19:38:24 mail authdaemond.mysql: password matches successfully
May 20 19:38:24 mail authdaemond.mysql: authmysql: sysusername=null, sysuserid=105, sysgroupid=106, homedir=/home/data/domains/extmail.org/test, address=test@extmail.org, fullname=Test user, maildir=/home/data/domains/extmail.org/test/Maildir/, quota=5242880, options=
May 20 19:38:24 mail authdaemond.mysql: authmysql: clearpasswd=null>, passwd=uywiuN.XggXXc
May 20 19:38:24 mail authdaemond.mysql: authmysql: ACCEPT, username test@extmail.org
May 20 19:38:47 mail postfix/smtpd[1763]: C2FF131B85: client=localhost[127.0.0.1], sasl_method=login, sasl_username=test@extmail.org
May 20 19:38:52 mail postfix/cleanup[1770]: C2FF131B85: message-id=20060520113836.C2FF131B85@mail.extmail.org
May 20 19:38:52 mail postfix/qmgr[1699]: C2FF131B85: from=test@test.com, size=328, nrcpt=1 (queue active)
May 20 19:38:52 mail postfix/virtual[1772]: C2FF131B85: to=test@extmail.org, relay=virtual, delay=16, status=sent (delivered to maildir)
May 20 19:38:52 mail postfix/qmgr[1699]: C2FF131B85: removed
May 20 19:38:55 mail postfix/smtpd[1763]: disconnect from localhost[127.0.0.1]

测试pop3 收邮件

mail:/etc/postfix# telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
+OK Hello there.
user test@extmail.org
+OK Password required.
pass test
+OK logged in.
list
+OK POP3 clients that break here, they violate STD53.
1 539
2 423
.
retr 2
+OK 423 octets follow.
Return-Path: test@test.com
X-Original-To: test@extmail.org
Delivered-To: test@extmail.org
Received: from test (localhost [127.0.0.1])
        by mail.extmail.org (Postfix) with ESMTP id C2FF131B85
        for test@extmail.org; Sat, 20 May 2006 19:38:36 +0800 (CST)
Message-Id: 20060520113836.C2FF131B85@mail.extmail.org
Date: Sat, 20 May 2006 19:38:36 +0800 (CST)
From: test@test.com
To: undisclosed-recipients:;

test
.
quit
+OK Bye-bye.
Connection closed by foreign host.

所产生的mail.log

如果你的pop3 信息没有我这里详细,请检查/etc/courier/pop3d 里面有没有打开 DEBUG_LOGIN=2

May 20 19:43:19 mail courierpop3login: Connection, ip=[::ffff:127.0.0.1]
May 20 19:43:28 mail courierpop3login: LOGIN: DEBUG: ip=[::ffff:127.0.0.1], command=USER
May 20 19:43:32 mail courierpop3login: LOGIN: DEBUG: ip=[::ffff:127.0.0.1], command=PASS
May 20 19:43:32 mail courierpop3login: LOGIN: DEBUG: ip=[::ffff:127.0.0.1], username=test@extmail.org
May 20 19:43:32 mail courierpop3login: LOGIN: DEBUG: ip=[::ffff:127.0.0.1], password=test
May 20 19:43:32 mail courierpop3login: authdaemon: starting client module
May 20 19:43:32 mail authdaemond.mysql: received auth request, service=pop3, authtype=login
May 20 19:43:32 mail authdaemond.mysql: authmysql: trying this module
May 20 19:43:32 mail authdaemond.mysql: SQL query: SELECT username,password,"",uidnumber,gidnumber,CONCAT('/home/data/domains/',homedir),CONCAT('/home/data/domains/',maildir),quota,name FROM mailbox WHERE username = 'test@extmail.org'
May 20 19:43:32 mail authdaemond.mysql: password matches successfully
May 20 19:43:32 mail authdaemond.mysql: authmysql: sysusername=null>, sysuserid=105, sysgroupid=106, homedir=/home/data/domains/extmail.org/test, address=test@extmail.org, fullname=Test user, maildir=/home/data/domains/extmail.org/test/Maildir/, quota=5242880, options=null>
May 20 19:43:32 mail authdaemond.mysql: authmysql: clearpasswd=null>, passwd=uywiuN.XggXXc
May 20 19:43:32 mail authdaemond.mysql: authmysql: ACCEPT, username test@extmail.org
May 20 19:43:32 mail courierpop3login: authdaemon: ACCEPT, username test@extmail.org
May 20 19:43:32 mail courierpop3login: LOGIN, user=test@extmail.org, ip=[::ffff:127.0.0.1]
May 20 19:43:46 mail courierpop3login: LOGOUT, user=test@extmail.org, ip=[::ffff:127.0.0.1], top=0, retr=411, time=14

如果日志里出现:

authdaemond.mysql: supplied password 'extmail' does not match encrypted password'{crypt}uywiuN.XggXXc' 请用phpmyadmin检查extmail数据库中mailbox 表中用户密码前面的{crypt}是否已经删除。

如果出现 "Permission denied",请检查目录的权限,及extmail 数据库中mailbox 表中的uidnumber/gidnumber 是否和目录的权限一致。

至此,一个支持虚似域的邮件系统已配置完成,下面继续配置杀毒,反垃圾邮件。

 

三、安装内容过滤反垃圾邮件

1、安装软件包

mail:~# apt-get install amavisd-new spamassassin clamav clamav-daemon clamav-freshclam arc bzip2 lzop zoo cpio

在/etc/postfix/main.cf 加入

content_filter = smtp-amavis:[127.0.0.1]:10024

在/etc/postfix/master.cf 加入

smtp-amavis unix -   -   n     -       2  smtp 
        -o smtp_data_done_timeout=1200 
        -o disable_dns_lookups=yes


127.0.0.1:10025 inet n -       n       -       -  smtpd 
        -o content_filter= 
        -o local_recipient_maps= 
        -o relay_recipient_maps= 
        -o smtpd_restriction_classes= 
        -o smtpd_client_restrictions= 
        -o smtpd_helo_restrictions= 
        -o smtpd_sender_restrictions= 
        -o smtpd_recipient_restrictions=permit_mynetworks,reject
        -o mynetworks=127.0.0.0/8

配置amavisd-new ,编辑/etc/amavis/amavisd.conf,修改下面的内容。

大约在文件的78行位置。

$mydomain = 'extmail.org';

跟据你自己的需要修改发现病毒垃圾邮件等的处理方法。

D_DISCARD 丢弃,D_BOUNCE 退信,D_REJECT 拒绝,D_PASS 通过.

$final_virus_destiny = D_DISCARD; # (defaults to D_BOUNCE)
$final_banned_destiny = D_BOUNCE; # (defaults to D_BOUNCE)
$final_spam_destiny = D_REJECT; # (defaults to D_REJECT)
$final_bad_header_destiny = D_PASS; # (defaults to D_PASS), D_BOUNCE suggested

配置spamassassin,修改/etc/default/spamassassin

ENABLED=1

2、让他随系统启动。

A、配置clamav 以支持amavisd-new 杀毒

编辑/etc/clamav/clamd.conf,将User clamav 改为

User amavis

B、修改目录的权限

mail:/etc/clamav# chown -R amavis:amavis  /var/log/clamav/
mail:/etc/clamav# chown -R amavis:amavis  /var/run/clamav/
mail:/etc/clamav# chown -R amavis:amavis  /var/lib/clamav

编辑/etc/clamav/freshclam.con,将DatabaseOwner clamav改为

DatabaseOwner amavis

C、重启服务

mail:/etc/clamav# /etc/init.d/clamav-daemon restart

mail:/etc/clamav# /etc/init.d/clamav-freshclam restart

D、发病毒测试

mail:/var/run/clamav# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 extmail.org ESMTP Mail System
ehlo test
250-mail.extmail.org
250-PIPELINING
250-SIZE 14680064
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250 8BITMIME
mail from:<test@test.com>
250 Ok
rcpt to:<test@extmail.org>
250 Ok
data
354 End data with CR>LF>.CR>LF>
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
.
250 Ok: queued as 8032C31B8B
quit
221 Bye
Connection closed by foreign host.

所产生的mail.log

May 20 22:51:43 mail postfix/smtpd[3362]: connect from localhost[127.0.0.1]
May 20 22:52:07 mail postfix/smtpd[3362]: 8032C31B8B: client=localhost[127.0.0.1]
May 20 22:52:18 mail postfix/cleanup[3368]: 8032C31B8B: message-id=20060520145157.8032C31B8B@mail.extmail.org>
May 20 22:52:18 mail postfix/qmgr[2900]: 8032C31B8B: from=test@test.com>, size=392, nrcpt=1 (queue active)
May 20 22:52:18 mail postfix/smtpd[3371]: connect from localhost[127.0.0.1]
May 20 22:52:18 mail postfix/smtpd[3371]: 46E6831B8C: client=localhost[127.0.0.1]
May 20 22:52:18 mail postfix/cleanup[3368]: 46E6831B8C: message-id=VA02687-02@mail.extmail.org>
May 20 22:52:18 mail postfix/qmgr[2900]: 46E6831B8C: from=>, size=2268, nrcpt=1 (queue active)
May 20 22:52:18 mail amavis[2687]: (02687-02) INFECTED (Eicar-Test-Signature), test@test.com> -> test@extmail.org>, quarantine virus-20060520-225218-02687-02, Message-ID: 20060520145157.8032C31B8B@mail.extmail.org>, Hits: -
May 20 22:52:18 mail postfix/smtp[3370]: 8032C31B8B: to=test@extmail.org>, relay=127.0.0.1[127.0.0.1], delay=21, status=sent (250 2.7.1 Ok, discarded, id=02687-02 - VIRUS: Eicar-Test-Signature)
May 20 22:52:18 mail postfix/qmgr[2900]: 8032C31B8B: removed
May 20 22:52:18 mail postfix/smtpd[3371]: disconnect from localhost[127.0.0.1]
May 20 22:52:20 mail postfix/smtpd[3362]: disconnect from localhost[127.0.0.1]


3、安装extmail/extman

A、修改apache

修改apache 让他以postfix 身份运行,否则extmail 创建的目录邮件系统无法读取,extmail 也无法读取目录。

或者你可以重新创建一个用户,修改/etc/main.cf中的virtual_gid_maps,virtual_uid_maps就行了。

修改/etc/apache2/apache.conf 让他以posftix身份执行。

User www-data
Group www-data

改为

User postfix
Group postfix

加入虚似主机设置,创建/etc/apache2/site-enable/extmail.conf 输入下面的内容。

Alias /extman/cgi/ /var/www/cgi-bin/extman/cgi/
Alias /extman /var/www/cgi-bin/extman/html/
<Location "/extman/cgi">
SetHandler cgi-script
Options +ExecCGI
AllowOverride All
</Location>


# config for ExtMail               
Alias /extmail/cgi/ /var/www//cgi-bin/extmail/cgi/
Alias /extmail /var/www/cgi-bin/extmail/html/

<Location "/extmail/cgi">
SetHandler cgi-script
Options +ExecCGI
AllowOverride All
</Location>

B、重启apache

mail:~# /etc/init.d/apache2 restart

将文件复制到/var/www/cgi-bin/ ,如果你的目录没有cgi-bin这个文件夹,自己创建一个就可以了。

mail:/var/www/cgi-bin# cp -r /home/fy138/extmail-0.23-20060219/ ./extmail

mail:/var/www/cgi-bin# cp -r /home/fy138/extman-0.15-20060518/ ./extman

C、配置extmail

mail:/var/www/cgi-bin# cd extmail/

修改webmail.cf 下面的选项(注意系统没有webmail.cf 这个文件,需要从webmail.cf.default 复制一份)

SYS_MAILDIR_BASE = /home/data/domains #邮件存储的位置。

SYS_MYSQL_USER = extmail #数据库的用户名
SYS_MYSQL_PASS = extmail #数据库的密码
SYS_MYSQL_DB = extmail #数据名字

SYS_MYSQL_SOCKET = /var/run/mysqld/mysqld.sock #mysql socket的位置

打开浏览器输入: http://yourip/extmail/即可看到extmail 的登陆窗口。

测试的用户名:test 密码:test 域:extmail.org

D、配置extman

mail:/var/www/cgi-bin# cd extman

编辑webman.cf 修改下面的选项

SYS_MAILDIR_BASE = /home/data/domains

SYS_MYSQL_SOCKET = /var/run/mysqld/mysqld.sock

创建extman 的临时目录

mail:/var/www/cgi-bin/extman# mkdir /tmp/extman
mail:/var/www/cgi-bin/extman# chmod 777 /tmp/extman/

创建extman 与extmail 软件包的连接(因为某些包在extmail 的目录里,所以要做链接)

mail:/var/www/cgi-bin/extman/libs/Ext# ./buildlink.sh build /var/www/cgi-bin/extmail/libs/Ext/

打开浏览器输入http://yourip/extman/

用户名为:root@extmail.org 密码:extmail

至此extmail/extman 已安装完成,至于extman 的图形日志安装请看

http://www.extmail.org/forum/read.php?tid=1524&fpage=1&toread=1

4、安装slockd

详细的安装过程请看

http://www.extmail.org/forum/read.php?tid=1463&fpage=1&toread=1

复制安装文件

mail:/usr/local# cp -r /home/fy138/slockd-0.08/ ./slockd

修改slockd 目config录下的 main.cf ,将setsid 1 的注释去掉。

修改postfix 的/etc/postfix/main.cf 让他支持slockd

注意第一行是靠边的,第二行开始都最后前面都要留一个空格的位置,意思是告诉postfix 一行写不下,换了行。

smtpd_recipient_restrictions = 
 permit_mynetworks,
permit_sasl_authenticated,
reject_non_fqdn_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unauth_destination,
reject_unauth_pipelining,
reject_invalid_hostname,
check_policy_service inet:127.0.0.1:10030

增加蓝色那一行。

修改完成后执行

mail:/usr/local/slockd# /etc/init.d/postfix reload

至于如何让slockd 随系统启动目前还不知道,如果你知道请告诉我。