首页 | 邮件资讯 | 技术教程 | 解决方案 | 产品评测 | 邮件人才 | 邮件博客 | 邮件系统论坛 | 软件下载 | 邮件周刊 | 热点专题 | 工具
网络技术 | 操作系统 | 邮件系统 | 客户端 | 电子邮箱 | 反垃圾邮件 | 邮件安全 | 邮件营销 | 移动电邮 | 邮件软件下载 | 电子书下载

邮件服务器

技术前沿 | Qmail | IMail | MDaemon | Exchange | Domino | 其它 | Foxmail | James | Kerio | JavaMail | WinMail | Sendmail | Postfix | Winwebmail | Merak | CMailServer | 邮件与开发 | 金笛 |
首页 > 邮件服务器 > Postfix > freebsd 安装邮件系统extmail 防毒 防垃圾 > 正文

freebsd 安装邮件系统extmail 防毒 防垃圾

出处:5DMail.Net收集整理 作者:5DMail.Net收集整理 时间:2010-7-22 11:08:09

安装下面三个软件要注意先后顺序

1、安装 Courier-IMAP
%cd /usr/ports/mail/courier-imap/
%make install clean

选择openssl、MySQL

在/etc/rc.conf 加入

courier_authdaemond_enable="YES"
courier_imap_pop3d_enable="YES"
courier_imap_imapd_enable="YES"

修改authdaemond的权限

%/usr/local/etc/rc.d/courier-authdaemond.sh start
%chmod -R  +x /var/run/authdaemond/

authdaemond 启动完成后,检查/var/run/authdaemond 下面是否产生socket 文件,因为认证时是通过这个文件读取密码的。

设置/usr/local/etc/authlib/authdaemonrc

%mv authdaemonrc authdaemonrc.bak
ee authdaemonrc

在authdaemonrc 加入下面的内容

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

上面DEBUG_LOGIN=2 是为了调试方便,等系统完全测试完成,可改为 0,即不显示调试信息。

设置/usr/local/etc/authlib/authmysqlrc

%mv authmysqlrc authmysqlrc.bak
ee 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)'

大家要注意,我的邮件保存的目录是/home/data/domains ,你可以跟据你的需要改为自己的目录。

用户名和密码是extmail 这个具体需要看extman 软件包中的docs 目录中的extmail.sql,很多人无法通上发信认证,很可能以上面两个文件配置有关。

创建pop3/imap 的配置文件

%cp pop3d.cnf.dist pop3d.cnf
%cp imapd.cnf.dist imapd.cnf

修改/usr/local/etc/courier-imap/pop3d (不修改也行)

POP3AUTH="LOGIN CRAM-MD5 CRAM-SHA1"

修改/usr/local/etc/courier-imap/imapd(不修改也行)

IMAP_CAPABILITY="IMAP4rev1 CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA"

2、安装 Cyrus-SASL2
%cd /usr/ports/security/cyrus-sasl2
%make install WITH_AUTHDAEMON=yes
创建 /usr/local/lib/sasl2/smtpd.conf 加入下面的内容
pwcheck_method:authdaemond
log_level:3
mech_list:PLAIN LOGIN
authdaemond_path:/var/run/authdaemond/socket
3、安装Postfix
%cd /usr/ports/mail/postfix
%make install clean

选择SASL2 、TLS、MySQL、VDA ,安装过程中有两个提问,直接按回车,使用系统默认的回答。

%echo postfix: root >> /etc/aliases
%/usr/local/bin/newaliases
%ln -s /usr/local/sbin/sendmail /usr/sbin/sendmail

如果出现ln: /usr/sbin/sendmail: File exists 提示,把/usr/sbin/sendmail改名再链接。

设置postfix 随系统启动

postfix_enable="YES"                  
sendmail_enable="NO"                  
sendmail_submit_enable="NO"           
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"

创建/etc/periodic.conf 加入下面的内容

daily_clean_hoststat_enable="NO"
daily_status_mail_rejects_enable="NO"
daily_status_include_submit_mailq="NO"
daily_submit_queuerun="NO"

配置/usr/local/etc/postfix/main.cf ,在你安装时,只需要修改####BASE#### 部分即可

%mv main.cf main.cf.bak

这个配置文件已经加入了maildrop的支持

###################BASE##################
myhostname=mail.extmail.org   #机器的名字
mydomain = extmail.org  #你的域名
mydestination = $myhostname
local_recipient_maps = 
command_directory = /usr/local/sbin
#local_transport = virtual
smtpd_banner = extmail.org ESMTP Mail System
message_size_limit = 14680064  #邮件大小
#mailbox_size_limit = 512000000
#################MySQL################
virtual_alias_maps =mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf
#virtual_gid_maps = static:125
#virtual_gid_maps = static:1000
virtual_mailbox_base = /home/data/domains  #邮件保存的目录
virtual_mailbox_domains = mysql:/usr/local/etc/postfix/mysql_virtual_domains_maps.cf
#virtual_mailbox_limit = 512000000
virtual_mailbox_maps = mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
#virtual_minimum_uid = 125
#virtual_minimum_uid = 1000
#virtual_transport = virtual
virtual_transport = maildrop:
maildrop_destination_recipient_limit = 1 

#virtual_uid_maps = static:125
#virtual_uid_maps = static:1000
################Quota################
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/usr/local/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_unauth_destination,
 reject_unauth_pipelining,
 reject_invalid_hostname,

 reject_rbl_client cbl.anti-spam.org.cn   #CBL 服务器 具体请看anti-spam.org.cn
#注意上面几行前面是有空格的。

readme_directory = no
sample_directory = /usr/local/etc/postfix
sendmail_path = /usr/local/sbin/sendmail
html_directory = no
setgid_group = maildrop
manpage_directory = /usr/local/man
daemon_directory = /usr/local/libexec/postfix
newaliases_path = /usr/local/bin/newaliases
mailq_path = /usr/local/bin/mailq
queue_directory = /var/spool/postfix
mail_owner = postfix

以下四个文件在extman 软件包Docs 目录里,使用时,直接复制到/usr/local/etc/postfix 目录即可。

mysql_virtual_alias_maps.cf

user = extmail
password = extmail
hosts = localhost
dbname = extmail
table = alias
select_field = goto
where_field = address
additional_conditions = AND active = '1'

mysql_virtual_domains_maps.cf

user = extmail
password = extmail
hosts = localhost
dbname = extmail
table = domain
select_field = description
where_field = domain
additional_conditions = AND active = '1'

mysql_virtual_mailbox_maps.cf

user = extmail
password = extmail
hosts = localhost
dbname = extmail
table = mailbox
select_field = maildir
where_field = username
additional_conditions = AND active = '1'

mysql_virtual_mailbox_limit_maps.cf

user = extmail
password = extmail
hosts = localhost
dbname = extmail
table = mailbox
select_field = quota
where_field = username
additional_conditions = AND active = '1'

至此postfix 基本设置完成,但还不能收发邮件。

4、安装maildrop

我们在设置邮件服务器时MTA 部分还是使用posfix 本身的帐户进行处理邮件,由于maildrop 不能和postfix 与同一用户身份处理邮件,所以我们新开一个用户用户maildrop 处理。

添加vgroup

pw groupadd vgroup -g 1000

添加vuser

%pw useradd vuser -g 1000 -u 1000 -s /sbin/nologin -d /sbin/nologin -c "virtual mail user"

安装maildrop,记得要把WITH_AUTHLIB=yes 加上

%cd /usr/ports/mail/maildrop
%make install WITH_AUTHLIB=yes

选择AUTH_MYSQL

lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
               x                    Options for maildrop 2.0.1                      x  
               x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x  
               x x            [ ] AUTH_LDAP    LDAP support                       x x  
               x x            [X] AUTH_MYSQL   MySQL support                      x x  
               x x            [ ] AUTH_PGSQL   PostgreSQL support                 x x  
               x x            [ ] AUTH_USERDB  Userdb support                     x x  
               x x            [ ] AUTH_VCHKPW  Vpopmail/vchkpw support            x x

修改/usr/local/etc/postfix/master.cf ,把maildrop 原先已有的记录注译(即删除旧记录),加上下面的内容

maildrop unix -     n     n     -     -     pipe
  flags=DRhu user=vuser argv=/usr/local/bin/maildrop -d ${user}@${nexthop} ${recipient} ${user} ${extension} ${nexthop}

设置邮件存储目录

%mkdir -p /home/data/domains/extmail.org/test
%/usr/local/bin/maildirmake /home/data/domains/extmail.org/test/Maildir
%chown -R 1000:1000 /home/data/domains/

至此,我们的邮件系统基础部分已经安装完成了。重启系统,开始进行测试。

六、测试系统

1、测试maildrop 是否正常

建议进入系统后去检查/etc/rc.conf 中的服务是否正常。

注意邮件系统用户名格式是:user@domain.ltd ,是支持多域的,和平时用的有点不一样。

用SecureCRT 新开 二个窗口,其中一个用于输入命令,一个查看maillog

%tail -f /var/log/maillog

观察下面的操作,证明maildrop 已投递正常

%echo "test" | maildrop -V 10 -d test@extmail.org
maildrop: authlib: groupid=1000
maildrop: authlib: userid=1000
maildrop: authlib: logname=test@extmail.org, home=/home/data/domains/extmail.org/test, mail=/home/data/domains/extmail.org/test/Maildir/
maildrop: Changing to /home/data/domains/extmail.org/test
Message start at 0 bytes, envelope sender=test@extmail.org
maildrop: Attempting .mailfilter
WARN: quota string '5242880' not parseable
maildrop: Delivery complete.

maillog 将会有如下显示

Mar 10 14:39:58 mail authdaemond: Authenticated: sysusername=, sysuserid=1000, sysgroupid=1000, 
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=
Mar 10 14:39:58 mail authdaemond: Authenticated: clearpasswd=, passwd={crypt}uywiuN.XggXXc
2、测试postfix

由于在发信认证时使用的是BASE64 编码,所以要把用户名和密码转BASE64 格式,在此前需要安装 p5-MIME-BASE64

%cd /usr/ports/converters/p5-MIME-Base64/
%make install

测试用户test@extmail.org 密码 test

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

看下面的测试过程

%telnet localhost 25
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 sharesky.cn ESMTP Mail System
ehlo test.com
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 .
this is a test.
.
250 Ok: queued as 23CEE5C38
quit
221 Bye
Connection closed by foreign host.

下面是系统所产生的maillog

Mar 10 14:47:45 mail postfix/smtpd[1090]: connect from localhost[127.0.0.1]
Mar 10 14:47:57 mail authdaemond: Authenticated: sysusername=<null>, sysuserid=1000, sysgroupid=1000, 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=
Mar 10 14:47:57 mail authdaemond: Authenticated: clearpasswd=test, passwd={crypt}uywiuN.XggXXc
Mar 10 14:48:13 mail postfix/smtpd[1090]: 23CEE5C38: client=localhost[127.0.0.1], sasl_method=login, sasl_username=test@extmail.org
Mar 10 14:48:18 mail postfix/cleanup[1135]: 23CEE5C38: message-id=<20060310144813.23CEE5C38@mail.extmail.org>
Mar 10 14:48:18 mail postfix/qmgr[669]: 23CEE5C38: from=<test@test.com>, size=341, nrcpt=1 (queue active)
Mar 10 14:48:19 mail authdaemond: Authenticated: sysusername=, sysuserid=1000, sysgroupid=1000, 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=
Mar 10 14:48:19 mail authdaemond: Authenticated: clearpasswd=, passwd={crypt}uywiuN.XggXXc
Mar 10 14:48:19 mail postfix/pipe[1136]: 23CEE5C38: to=<test@extmail.org>, relay=maildrop, delay=14, status=sent (extmail.org)
Mar 10 14:48:19 mail postfix/qmgr[669]: 23CEE5C38: removed
Mar 10 14:48:20 mail postfix/smtpd[1090]: disconnect from localhost[127.0.0.1]

测试pop3收邮件

%telnet localhost 110
Trying ::1...
telnet: connect to address ::1: Connection refused
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 6
2 403
.

retr 1
+OK 6 octets follow.
test
.
retr 2
+OK 403 octets follow.
Return-Path: <test@test.com>
Delivered-To: test@extmail.org
Received: from test.com (localhost [127.0.0.1])
        by mail.extmail.org (Postfix) with ESMTP id 23CEE5C38
        for <test@extmail.org>; Fri, 10 Mar 2006 14:48:05 +0000 (UTC)
Message-Id: <20060310144813.23CEE5C38@mail.extmail.org>
Date: Fri, 10 Mar 2006 14:48:05 +0000 (UTC)
From: test@test.com
To: undisclosed-recipients:;

this is a test.
.

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

所产生的maillog

Mar 10 16:17:56 mail authdaemond: Authenticated: sysusername=, sysuserid=1000, sysgroupid=1000, 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=
Mar 10 16:17:56 mail authdaemond: Authenticated: clearpasswd=test, passwd={crypt}uywiuN.XggXXc
Mar 10 16:17:57 mail pop3d: LOGIN, user=test@extmail.org, ip=[127.0.0.1]
Mar 10 16:18:15 mail pop3d: LOGOUT, user=test@extmail.org, ip=[127.0.0.1], top=0, retr=397, time=18

至此,我们已经成功安装了一个邮件系统,下面我们再去增加内容过滤和反垃圾邮件部分。

七、安装反垃圾邮件

1、安装amavisd-new

内容过滤我们采用了amavisd-new ,主要考滤到amavsid-new 配置方便,当然你也可以使用mailscanner。

%cd /usr/ports/security/amavisd-new/
%make install clean

只选择MYSQL

在安装Amavisd-new 时,系统会自动把Spamassassin 装上去

lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
               x             Options for p5-Mail-SpamAssassin 3.1.0_6               x  
               x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x  
               x x   [X] AS_ROOT        Run spamd as root (recommended)           x x  
               x x   [ ] DOMAINKEYS     DomainKeys support                        x x  
               x x   [X] SSL            Build with SSL support for spamd/spamc    x x  
               x x   [X] MYSQL          Add MySQL support                         x x  
               x x   [ ] PGSQL          Add PostreSQL support                     x x  
               x x   [ ] RAZOR          Add Vipul's Razor support                 x x  
               x x   [ ] SPF_QUERY      Add SPF query support                     x x  
               x x   [ ] RELAY_COUNTRY  Relay country support                     x x  
               x x   [X] TOOLS          Install SpamAssassin tools                x x

在/etc/rc.conf 加入下面的内容

amavisd_enable="YES"
spamd_enable="YES"

修改 /usr/local/etc/amavisd.conf

$mydomain = 'extmail.org';

垃圾邮件病毒通知

$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

去除对附件的转换

$banned_filename_re = new_RE(
#把中间的内容全部加上#
);

加入对Clamav 的支持

# ### http://www.clamav.net/
 ['ClamAV-clamd',
   \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd"],
   qr/\bOK$/, qr/\bFOUND$/,
   qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],

在/usr/local/etc/postfix/main.cf 加入

content_filter = smtp-amavis:[127.0.0.1]:10024

在/usr/local/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

重启postfix

%/usr/local/etc/rc.d/postfix.sh restart
postfix/postfix-script: stopping the Postfix mail system
postfix/postfix-script: starting the Postfix mail system

对于Spamassassin 配置文件/usr/local/etc/mail/spamassassin/local.cf 请参考

http://spamassassin.apache.org/

配置工具

http://www.yrex.com/spam/spamconfig.php

调试amavisd-new

%su vscan
$ /etc/sbin/amavisd debug

如果没有出现任何错误,证明你的amavisd-new 正常。

2、安装Clamav

clamav 用于邮件杀毒

%cd /usr/ports/security/clamav
%make install clean

可以什么都不选,直接回车

clamav_clamd_enable="YES"
clamav_freshclam_enable="YES"

修改/usr/local/etc/clamd.conf 让其以vscan 身份运行(约145行)

#User clamav
User vscan

修改/usr/local/etc/freshclam.conf

#DatabaseOwner clamav
DatabaseOwner vscan

修目录权限

%chown -R vscan:vscan /var/log/clamav
%chown -R vscan:vscan /var/run/clamav
%chown -R vscan:vscan /var/db/clamav

启动clamav 与 自动更新

%/usr/local/etc/rc.d/clamav-clamd.sh start
%/usr/local/etc/rc.d/clamav-freshclam.sh start
3、测试
%telnet localhost 25
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.mold.com.cn.
Escape character is '^]'.
220 extmail.org ESMTP Mail System
ehlo test.com
250-mail.mold.com.cn
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 .
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
.
250 Ok: queued as F19692E084
quit
221 Bye
Connection closed by foreign host.

所产生的maillog

Mar 10 18:19:25 mail postfix/smtpd[797]: connect from localhost[127.0.0.1]
Mar 10 18:19:25 mail postfix/smtpd[797]: CD31B5C25: client=localhost[127.0.0.1]
Mar 10 18:19:25 mail postfix/cleanup[793]: CD31B5C25: message-id=<VAQ0WNU5+REDjW@mail.extmail.org>
Mar 10 18:19:25 mail postfix/qmgr[789]: CD31B5C25: from=<virusalert@extmail.org>, size=1670, nrcpt=1 (queue active)
Mar 10 18:19:26 mail postfix/smtpd[797]: disconnect from localhost[127.0.0.1]
Mar 10 18:19:26 mail amavis[458]: (00458-01) Blocked INFECTED (Eicar-Test-Signature), [127.0.0.1] <?@[127.0.0.1]> -> <test@extmail.org>, quarantine: virus-Q0WNU5+REDjW, 
Message-ID: <20060310181918.954D75C24@mail.extmail.org>, mail_id: Q0WNU5+REDjW, Hits: -, 1567 ms
Mar 10 18:19:26 mail postfix/smtp[794]: 954D75C24: to=<test@extmail.org>, relay=127.0.0.1[127.0.0.1], delay=14, status=sent (250 2.7.1 Ok, discarded, id=00458-01 - VIRUS: Eicar-Test-Signature)
Mar 10 18:19:26 mail postfix/qmgr[789]: 954D75C24: removed
Mar 10 18:19:26 mail postfix/smtpd[791]: disconnect from localhost[127.0.0.1]

观看红色的地方,病毒已经找到,并隔离了。随之这封邮件被系统删除。

八、安装extmail /extman

1、设置apache 的运行身份

修改/usr/local/etc/apache22/httpd.conf

#User www
#Group www
User vuser
Group vgroup

在httpd.conf 加入下面的内容

Alias /extman/cgi/ /usr/local/www/apache22/cgi-bin/extman/cgi/
Alias /extman /usr/local/www/apache22/cgi-bin/extman/html/

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

# config for ExtMail               
Alias /extmail/cgi/ /usr/local/www/apache22/cgi-bin/extmail/cgi/
Alias /extmail /usr/local/www/apache22/cgi-bin/extmail/html/

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

重启apahce

%/usr/local/etc/rc.d/apache22.sh restart
Performing sanity check on apache22 configuration:
Syntax OK
Stopping apache22.
Waiting for PIDS: 461.
Performing sanity check on apache22 configuration:
Syntax OK
Starting apache22.

2、安装extmail

从extmail官方网站:www.extmail.org 下载最新版式

tar zxvf extmail-23-20060219.tar.gz 
%cp -r  extmail-0.23-20060219/ /usr/local/www/apache22/cgi-bin/extmail

创建配置文件

%cd /usr/local/www/apache22/cgi-bin/extmail/
%cp webmail.cf.default webmail.cf

修改配置文件,我只把需要修改的地方贴出来

# sys_config, the config file and webmail programe root
SYS_CONFIG = /usr/local/www/apache22/cgi-bin/extmail/

# sys_langdir, the i18n dir
SYS_LANGDIR = /usr/local/www/apache22/cgi-bin/extmail/lang

# sys_templdir, the template dir
SYS_TEMPLDIR = /usr/local/www/apache22/cgi-bin/extmail/html
# sys_netdisk_on, default is off
SYS_NETDISK_ON = 1 
# maildir_base, the base dir of user maildir, use absolute path
# if not set.
SYS_MAILDIR_BASE = /home/data/domains
# if mysql, all relate paramters should prefix as SYS_MYSQL
SYS_MYSQL_USER = extmail   
SYS_MYSQL_PASS = extmail   
SYS_MYSQL_DB = extmail     
SYS_MYSQL_HOST = localhost
SYS_MYSQL_SOCKET = /tmp/mysql.sock

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

用户名:test

密码:test

域名:extmail.org

3、安装extman

从extmail 官方网站下载软件包,解压复制到/usr/local/www/apache22/cgi-bin目录。

%cd /usr/local/www/apache22/cgi-bin/extman/

编辑 webman.cf

# sys_config, the config file and webman programe root
SYS_CONFIG = /usr/local/www/apache22/cgi-bin/extman/

# sys_langdir, the i18n dir
SYS_LANGDIR = /usr/local/www/apache22/cgi-bin/extman/lang

# sys_templdir, the template dir
SYS_TEMPLDIR = /usr/local/www/apache22/cgi-bin/extman/html

# maildir_base, the base dir of user maildir, use absolute path
# if not set. 
SYS_MAILDIR_BASE = /home/data/domains
# if mysql, all relate paramters should prefix as SYS_MYSQL
SYS_MYSQL_USER = webman
SYS_MYSQL_PASS = webman
SYS_MYSQL_DB = extmail
SYS_MYSQL_HOST = localhost
SYS_MYSQL_SOCKET = /tmp/mysql.sock

创建/tmp/extman

%mkdir /tmp/extman
%chmod 777 /tmp/extman/

创建软件包的链接

%cd extman/libs/Ext/
%./buildlink.sh build /usr/local/www/apache22/cgi-bin/extmail/libs/Ext/

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

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

系统配置文件下载

rc.conf 内容

mysql_enable="YES"
apache22_enable="YES"

postfix_enable="YES"
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"

courier_authdaemond_enable="YES"
courier_imap_pop3d_enable="YES"
courier_imap_imapd_enable="YES"

amavisd_enable="YES"
spamd_enable="YES"
clamav_clamd_enable="YES"
clamav_freshclam_enable="YES"

End

相关文章 热门文章
  • 成功将qmail用户迁移到postfix(extmail+extman)下
  • ExtMail Solution for FreeBSD
  • ExtMail Solution HOWTO for Linux
  • 在Linux平台上安装基于Postfix、Courier-imap、Extmail的邮件系统 V 0.2.2
  • ExtMail Solution HOWTO for Linux
  • Install and configure Postfix with Cyrus-SASL+Cyr...
  • 在FreeBSD上建立一个功能完整的邮件服务器
  • postfix 邮件病毒过滤
  • 在Fedora上建立自己的邮件服务器
  • Postfix + SpamAssassin 安裝手冊
  • Postfix + Courier-IMAP + Cyrus-SASL + MySQL + IMP...
  • Postfix + Cyrus-SASL + Cyrus-IMAPD + PgSQL HOWTO
  • 在FreeBSD5.1簡單安裝Postfix+Qpopper+Openwebmail
  • 在RHEL 4 上配置全功能的Postfix 服务器
  • Postfix + Cyrus-IMAP + Cyrus-SASL + MySQL + IMP 完..
  • 我的POSTFIX安装笔记
  • Postfix电子邮局的配置步骤
  • 自由广告区
     
    最新软件下载
  • SharePoint Server 2010 部署文档
  • Exchange 2010 RTM升级至SP1 教程
  • Exchange 2010 OWA下RBAC实现的组功能...
  • Lync Server 2010 Standard Edition 标..
  • Lync Server 2010 Enterprise Edition...
  • Forefront Endpoint Protection 2010 ...
  • Lync Server 2010 Edge 服务器部署文档
  • 《Exchange 2003专家指南》
  • Mastering Hyper-V Deployment
  • Windows Server 2008 R2 Hyper-V
  • Microsoft Lync Server 2010 Unleashed
  • Windows Server 2008 R2 Unleashed
  • 今日邮件技术文章
  • 腾讯,在创新中演绎互联网“进化论”
  • 华科人 张小龙 (中国第二代程序员 QQ...
  • 微软推出新功能 提高Hotmail密码安全性
  • 快压技巧分享:秒传邮件超大附件
  • 不容忽视的邮件营销数据分析过程中的算..
  • 国内手机邮箱的现状与未来发展——访尚..
  • 易观数据:2011Q2中国手机邮箱市场收入..
  • 穿越时空的爱恋 QQ邮箱音视频及贺卡邮件
  • Hotmail新功能:“我的朋友可能被黑了”
  • 入侵邻居网络发骚扰邮件 美国男子被重..
  • 网易邮箱莫子睿:《非你莫属》招聘多过..
  • 中国电信推广189邮箱绿色账单
  • 最新专题
  • 鸟哥的Linux私房菜之Mail服务器
  • Exchange Server 2010技术专题
  • Windows 7 技术专题
  • Sendmail 邮件系统配置
  • 组建Exchange 2003邮件系统
  • Windows Server 2008 专题
  • ORF 反垃圾邮件系统
  • Exchange Server 2007 专题
  • ISA Server 2006 教程专题
  • Windows Vista 技术专题
  • “黑莓”(BlackBerry)专题
  • Apache James 专题
  • 分类导航
    邮件新闻资讯:
    IT业界 | 邮件服务器 | 邮件趣闻 | 移动电邮
    电子邮箱 | 反垃圾邮件|邮件客户端|网络安全
    行业数据 | 邮件人物 | 网站公告 | 行业法规
    网络技术:
    邮件原理 | 网络协议 | 网络管理 | 传输介质
    线路接入 | 路由接口 | 邮件存储 | 华为3Com
    CISCO技术 | 网络与服务器硬件
    操作系统:
    Windows 9X | Linux&Uinx | Windows NT
    Windows Vista | FreeBSD | 其它操作系统
    邮件服务器:
    程序与开发 | Exchange | Qmail | Postfix
    Sendmail | MDaemon | Domino | Foxmail
    KerioMail | JavaMail | Winwebmail |James
    Merak&VisNetic | CMailServer | WinMail
    金笛邮件系统 | 其它 |
    反垃圾邮件:
    综述| 客户端反垃圾邮件|服务器端反垃圾邮件
    邮件客户端软件:
    Outlook | Foxmail | DreamMail| KooMail
    The bat | 雷鸟 | Eudora |Becky! |Pegasus
    IncrediMail |其它
    电子邮箱: 个人邮箱 | 企业邮箱 |Gmail
    移动电子邮件:服务器 | 客户端 | 技术前沿
    邮件网络安全:
    软件漏洞 | 安全知识 | 病毒公告 |防火墙
    攻防技术 | 病毒查杀| ISA | 数字签名
    邮件营销:
    Email营销 | 网络营销 | 营销技巧 |营销案例
    邮件人才:招聘 | 职场 | 培训 | 指南 | 职场
    解决方案:
    邮件系统|反垃圾邮件 |安全 |移动电邮 |招标
    产品评测:
    邮件系统 |反垃圾邮件 |邮箱 |安全 |客户端
    广告联系 | 合作联系 | 关于我们 | 联系我们 | 繁體中文
    版权所有:邮件技术资讯网©2003-2010 www.5dmail.net, All Rights Reserved
    www.5Dmail.net Web Team   粤ICP备05009143号