RedHat Postfix + MySQL + Cyrus-sasl + Dovecot 用RPM方式实现 开源邮件技术社区 - powered by phpwind.net

来源:百度文库 编辑:神马文学网 时间:2024/04/28 15:39:15

» szjxy 退出 |控制面板 |您有新消息 |搜索 |帮助 |社区 |无图版
开源邮件技术社区 ->Postfix -> RedHat Postfix + MySQL + Cyrus-sasl + Dovecot 用RPM方式实现转到动态网页

--> 本页主题: RedHat Postfix + MySQL + Cyrus-sasl + Dovecot 用RPM方式实现加为IE收藏 |收藏主题 |上一主题 |下一主题
jacky

级别: 管理员
精华: 3
发帖: 1012
威望: 330 点
金钱: 3300 RMB
贡献值: 0 点
注册时间:2005-03-21
资料消息推荐引用编辑
RedHat Postfix + MySQL + Cyrus-sasl + Dovecot 用RPM方式实现
RedHat Enterprise Linux Server 4.2 + Postfix + PostfixAdmin + MySQL + Cyrus-sasl + Courier-authlib + Dovecot + Antivir-Mailgate + MailScanner + OpenSSL + Extmail
作者:Fandy
电子邮箱:cbbc@163.com、cbbc@avl.com.cn
QQ号码:332018422
建立日期:2006年01月01日,最后修改日期:2006年01月12日
版本号:v 0.2
版权说明:本文章的内容归作者版权所有,同时也接受大家的转贴,但一定要保存作者信息和出处,多谢!
近来网上流行的热门文章“在RHEL 4 上配置全功能的Postfix 服务器”,是不份相当不错的好文章。但是也存在着一些操作和配置说明不清晰的地方,本人看了一些配置过程后就有一种冲动就是想写一编更加完整和功能更加强大的文章。
文章的特色就是采用“图文并茂”和软件包安装环境使用详尽说明的方式,目的就是令读者更加容易了解全功能邮件系统的安装和配置。可以做到初学Linux的新手也能配置一个功能强大Postfix邮件服务器!
不足的地方:小弟Linux水平有限所以会存在错误的地方请大家加以改正错误,以方便及时改正错误和完善文章的内容,多谢!(注在配置以下的信息前,以下的操作请使用root用户来操作)
Setp0、参考资料:
1、 在RHEL 4 上配置全功能的Postfix 服务器;
2、 Red Hat 企业版4.1 + F-Prot Antivirus + MailScanner 4.46.2-2安装笔记;
3、 Red Hat 企业版4.2 + Master DNS + Slave DNS安装笔记;
Setp1、RedHat Enterprise Linux Server 4.2系统安装截图说明:
磁盘配置:
设备 类型 大小
/ ext3 39911
swap 1024
网络基本配置:
etho IP/Gateway:192.168.1.253/255.255.255.0
主机名:mail.easy.com
网关:192.168.1.1
主/次DNS:192.168.1.254/192.168.1.253/202.96.128.68
防火墙基本配置:
⊙ 无防火墙
⊙ 是否启用 SELinux:已禁用
安装方式的选项:
⊙ 定制要安装的软件包(C)
桌面选项:
(√) X窗口系统 (选取全部)
(√) GNOME桌面环境 (选取全部)
应用程序选项:
(√) 工程和科学 (选取默认)
(√) 图形化互联网 (选取默认)
(√) 基于文本的互联网 (选取默认)
(√) 办公/生产率 (选取默认)
服务器选项:
(√) 服务器配置工具 (选取全部)
(√) 万维网服务器 (选取全部)
(√) 邮件服务器(自行选全部)
(√) Windows文件服务器 (选取全部)
(√) DNS名称服务器 (选取全部)
(√) SQL数据库 (选取全部)
邮件服务器的细节选项:
(√) perl-Cyrus - Cyrus IMAP server utility Perl modules.
(√) spamassassin - Spam filter for email which can be invoked from mail delivery age...
开发选项:
(√) 开发工具 (选择全部)
系统选项:
(√) 管理工具 (选取默认)
(√) 打印支持 (选取默认)
杂项选项:
全部不要选择;
Step2、OpenSSL详细配置过程:
特别说明:因为使用rpm方式来安装,所以openssl.cnf配置文件存放地址为:/usr/share/ssl/
修改/usr/share/ssl/目录下openssl.cnf文件,详细内容如下:
详细内容:
default_days= 365 (设定凭证可使用之天数)
更改为:
default_days= 3650
default_bits= 1024 (设定金钥长度(bits))
更改为:
default_bits= 2048
Step3、PostfixAdmin软件源代码安装和配置过程:
软件包格式:postfixadmin-2.1.0.tgz
软件包的大小(KB):157KB
下载地址:http://high5.net/postfixadmin/download.php?file=postfixadmin-2.1.0.tgz
PostfixAdmin软件包安装过程如下:
详细操作:
# tar -zxvf postfixadmin-2.1.0.gz -C /var/www/html
# cd /var/www/html
# mv postfixadmin-2.1.0 postfixadmin
修改Apache系统的/etc/http/conf/httpd.conf配置文件:
详细内容:
ServerAdminyou@example.com
更改为:
ServerAdminfandy@easy.com
#ServerNamewww.example.com:80
更改为:
ServerName mail.easy.com:80
AddDefaultCharset utf-8
更改为:
AddDefaultCharset GB2312
DirectoryIndex index.html index.html.var
更改为:
DirectoryIndex index.html index.html.var index.php index.cgi
启动 Apache、MySQL 服务器:
详细操作:
# service httpd start
# service mysqld start
设定Mysql服务器root管理员的密码:
详细操作:
# mysqladmin -u root password ‘jinbiao’
测试Mysql服务器是否正常运行:
详细操作:
# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.17-log
Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the buffer.
mysql>
测试Apache是否正常运行,打开Mozilla Firefor或者Internet Explorer等浏览器输入以下地址:
详细操作:
http://mail.easy.com
建立 PostfixAdmin 所需要的数据表和config.inc.php文件:
详细操作:
# cd /var/www/html/postfixadmin
# mysql -u root -p < DATABASE_MYSQL.TXT
Enter password:jinbiao (输入mysqladmin管理员root的密码)
# cp config.inc.php.sample config.inc.php
# sed -i "s/\@change-this-to-your.domain.tld/\@easy.com/g" config.inc.php
# sed -i "s/change-this-to-your.domain.tld/mail.easy.com/g" config.inc.php
修改/usr/local/apache/htdocs/postfixadmin/config.inc.php文件的相关内容:
详细内容:
$CONF[‘default_language‘] = ‘en‘;
更改为:
$CONF[‘default_language‘] = ‘cn‘;
测试PostfixAdmin检查是否通过,打开Mozilla Firefor或者Internet Explorer等浏览器输入以下地址:
详细操作:
http://mail.easy.com/postfixadmin/index.php
详细操作:
http://mail.easy.com/postfixadmin/setup.php
测试PostfixAdmin检查通过后,为了系统安全着想请删除或者是移除setup.php文件:
详细操作:
# cd /usr/local/apache/htdocs/postfixadmin
# mv setup.php backup-setup.php
移除setup.php文件后,打开Mozilla Firefor或者Internet Explorer等浏览器输入以下地址:
详细操作:
http://mail.easy.com/postfixadmin/login.php
移除setup.php文件后,打开Mozilla Firefor或者Internet Explorer等浏览器输入以下地址:
详细操作:
http://mail.easy.com/postfixadmin/admin/
进入PostfixAdmin的admin介面后,根据页面提示信息需要删除或者是移除以下三个文件:
详细操作:
# /usr/local/apache/htdocs/postfixadmin
# mv motd.txt backup-motd.txt
# mv motd-admin.txt backup-motd-admin.txt
# mv motd-users.txt backup-motd-users.txt
移除motd.txt、motd-admin.txt、motd-users.txt文件后,打开Mozilla Firefor或者Internet Explorer等浏览器输入以下地址,然后就可以正常的建立和删除域名、用户邮箱:
详细操作:
http://mail.easy.com/postfixadmin/admin/index.php
利用PostfixAdmin的admin介面新建easy.com和fandy.com域名,打开Mozilla Firefor或者Internet Explorer等浏览器输入以下地址:
详细操作:
http://mail.easy.com/postfixadmin/admin/create-domain.php
利用PostfixAdmin的admin介面为easy.com和fandy.com域名分别新建一个用户邮箱,打开Mozilla Firefor或者Internet Explorer等浏览器输入以下地址:
详细操作:
http://mail.easy.com/postfixadmin/admin/create-mailbox.php
将Apache、Mysql服务器设置为开机自动启动:
详细操作:
# chkconfig --level 33 httpd on (设置Apache服务器为开机自启动)
# chkconfig --level 33 mysqld on (设置MySQL服务器为开机自启动)
Step4、Postfix软件源代码安装和配置过程:
软件包格式:postfix-2.2.5-1.mysql.sasl2.vda.rhel4.i386.rpm
特别说明:本软件包默认以支持MySQL、SASL、VDA、TLS等功能;
软件包的大小(KB):3408KB
下载地址:http://www.proficuous.com/postfix/4/postfix_2.2/5/index_4_2.2.5.html
安装Postfix前,请先删除系统安装时所自带的Sendmail软件包:
详细操作:
# service sendmail stop (停止sendmail系统的运行)
# rpm -e sendmail --nodeps (从操作系统中删除sendmail软件包)
Postfix软件包详细安装过程:
详细操作:
# rpm -ivh postfix-2.2.5-1.mysql.sasl2.vda.rhel4.i386.rpm (安装postfix软件包)
Preparing... ########################################### [100%]
1:postfix ########################################### [100%]
建立存放用户邮件目录和设置相关权限:
详细操作:
# mkdir /home/mailbox (建立存放用户邮件目录)
# chown -R postfix.postfix /home/mailbox (分配存放用户电子邮件目录的用户权限)
查询postfix用户和所属组的ID资料:
详细操作:
# id postfix (查询postfix用户、所属组的ID)
uid=102(postfix) gid=103(postfix) groups=103(postfix),12(mail)
用户ID:102 所属组ID:103
使用postalias命令建立aliases.db文件:
详细操作:
# cd /etc/
# postalias aliases (建立aliases.db文件)
修改/etc/postfix/mail.cf文件,以下为完整文件的详细内容::
详细配置内容:
#=====================BASE=========================#
myhostname = mail.easy.com
mydomain = easy.com
myorigin = $mydomain
mydestination = $myhostname localhost localhost.$mydomain
mynetworks = 192.168.1.0/24 127.0.0.0/8
inet_interfaces = all
#=====================Vritual Mailbox settings=========================#
virtual_mailbox_base = /home/mailbox (输入存放用户邮件目录)
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_uid_maps = static:102 (输入postfix用户的ID)
virtual_gid_maps = static:103 (输入postfix用户组的ID)
virtual_transport = virtual
maildrop_destination_recipient_limit = 1
maildrop_destination_concurrency_limit = 1
#====================QUOTA========================#
message_size_limit = 14336000
virtual_mailbox_limit = 20971520
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 try again later. (请在一行内输写完)
virtual_overquota_bounce = yes
继续main.cf文件内容:
详细配置内容:
#====================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,
permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_sasl_application_name = smtpd
smtpd_banner=$myhostname ESMTP "Version not Available"
#====================OTHER========================#
readme_directory = no
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
html_directory = no
setgid_group = postdrop
command_directory = /usr/sbin
manpage_directory = /usr/local/man
daemon_directory = /usr/libexec/postfix
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
queue_directory = /var/spool/postfix
mail_owner = postfix
在/etc/postfix/目录下建立mysql_virtual_alias_maps.cf配置文件,以下为完整文件的详细内容:
详细内容:
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = alias
select_field = goto
where_field = address
在/etc/postfix/目录下建立mysql_virtual_domains_maps.cf配置文件,以下为完整文件的详细内容:
详细内容:
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = domain
select_field = description
where_field = domain
在/etc/postfix/目录下建立mysql_virtual_mailbox_maps.cf配置文件,以下为完整文件的详细内容:
详细内容:
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = mailbox
select_field = maildir
where_field = username‘
在/etc/postfix/目录下建立mysql_virtual_mailbox_limit_maps.cf配置文件,以下为完整文件的详细内容:
详细内容:
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = mailbox
select_field = quota
where_field = username
在/usr/local/lib/sasl2/目录下修改smtpd.conf用户认证文件,详细内容如下(注:如果/usr/local/lib/
sasl2/目录下没有smtpd.conf可能新建),以下为完整文件的详细内容:
详细内容:
pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGIN
authdaemond_path: /var/spool/authdaemon/socket
复制/usr/local/lib/sasl2/目录下smtpd.conf到/usr/local/lib/sasl/目录:
详细操作:
# cp /usr/local/lib/sasl2/smtpd.conf /usr/local/lib/sasl/
启动Postfix服务器:
详细操作:
# service postfix start
测试SMTP服务器下easy.com域是否正常:
详细内容:
# telnet localhost 25 (远程连接到localhost端口为25)
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is ‘^]‘.
220 mail.easy.com ESMTP "Version not Available"
ehlo easy.com (测试easy.com是否正常)
250-mail.easy.com
250-PIPELINING
250-SIZE 14336000
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250 8BITMIME
quit (退出本次测试)
221 Bye
Connection closed by foreign host.
测试SMTP服务器下fandy.com域是否正常:
详细内容:
# telnet localhost 25 (远程连接到localhost端口为25)
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is ‘^]‘.
220 mail.easy.com ESMTP "Version not Available"
ehlo fandy.com (测试fandy.com是否正常)
250-mail.easy.com
250-PIPELINING
250-SIZE 14336000
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250 8BITMIME
quit (退出本次测试)
221 Bye
Connection closed by foreign host.
Step5、Courier-authlib软件包安装和配置过程:
软件包格式: courier-authlib-0.58-1.ce4.i386.rpm
courier-authlib-devel-0.58-1.ce4.i386.rpm
courier-authlib-mysql-0.58-1.ce4.i386.rpm
软件包的大小(KB):121KB、32KB、13KB
下载地址:http://www.phantom.atknet.ru/archives/cat_1011941725.html
安装Courier-authlib软件包安装过程如下(注:请严格按照以下的安装顺序来安装软件包):
详细操作:
# rpm -ivh courier-authlib-0.58-1.ce4.i386.rpm (安装courier-authlib软件包)
# rpm -ivh courier-authlib-devel-0.58-1.ce4.i386.rpm (安装courier-authlib-devel软件包)
# rpm -ivh courier-authlib-mysql-0.58-1.ce4.i386.rpm (安装courier-authlib-mysql软件包)
更改authdaemon文件夹的属性:
详细操作:
# chmod 755 /var/spool/authdaemon
修改/etc/authlib/目录下的authdaemonrc文件,修改内容以下:
详细内容:
authmodulelist=" authpam authpgsql authldap authmysql authcustom authpipe"
更改为:
authmodulelist="authmysql"
authmodulelistorig="authpam authpgsql authldap authmysql authcustom authpipe"
更改为:
authmodulelistorig="authmysql"
daemons=5
更改为:
daemons=10
修改/etc/authlib/目录下的authmysqlrc文件,以下为完整文件的详细内容:
详细内容:
MYSQL_SERVER localhost
MYSQL_USERNAME postfix
MYSQL_PASSWORD postfix
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_DATABASE postfix
MYSQL_USER_TABLE mailbox
MYSQL_CRYPT_PWFIELD password
MYSQL_UID_FIELD ‘102‘ (输入postfix用户的ID)
MYSQL_GID_FIELD ‘103‘ (输入postfix用户组的ID)
MYSQL_LOGIN_FIELD username
MYSQL_HOME_FIELD concat(‘/home/mailbox/‘,maildir)
MYSQL_MAILDIR_FIELD concat(‘/home/mailbox/‘,maildir)
MYSQL_NAME_FIELD name
将Courier-authlib设置为开机自动启动:
详细操作:
# chkconfig --level 33 courier-authlib on
# service courier-authlib start
Step6、Dovecot软件包安装和配置过程:
软件包格式: dovecot-0.99.14-1.2.el4.rf.i386.rpm
软件包的大小(KB):604KB
下载地址:http://distro.ibiblio.org/pub/linux/distributions/e-smith/devel/repo/RPMS/
安装Dovecot软件包安装过程如下(注:也可以使用系统自带软件,看个人喜欢啦(^_^)):
详细操作:
# rpm -ivh dovecot-0.99.14-1.2.el4.rf.i386.rpm (安装Dovecot软件包)
修改/etc/目录下dovecot.conf文件,以下为完整文件的详细内容:
详细内容:
base_dir = /var/run/dovecot/
protocols = imap pop3
imap_listen = [::]
pop3_listen = [::]
login_dir = /var/run/dovecot-login
login = imap
login = pop3
mbox_locks = fcntl
auth = default
auth_mechanisms = plain
auth_user = root
default_mail_env = maildir:/home/mailbox/%u/
auth_userdb = mysql /etc/dovecot-mysql.conf
auth_passdb = mysql /etc/dovecot-mysql.conf
first_valid_uid = 102 (输入postfix用户的ID)
在/etc/目录下新建dovecot-mysql.conf文件,以下为完整文件的详细内容:
详细内容:
db_host = localhost
db_port = 3306
db_unix_socket = /var/lib/mysql/mysql.sock
db = postfix
db_user = postfix
db_passwd = postfix
db_client_flags = 0
default_pass_scheme = PLAIN-MD5
password_query = SELECT password FROM mailbox WHERE username = ‘%u‘
user_query = SELECT maildir, 102 AS uid, 103 AS gid FROM mailbox WHERE username = ‘%u‘
将Dovecot设置为开机自动启动:
详细操作:
# chkconfig --level 33 dovecot on
# service dovecot start
测试POP3服务器是否正常:
详细内容:
# telnet localhost 110 (远程连接到localhost端口为110)
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is ‘^]‘.
+OK dovecot ready.
quit (退出本次测试)
+OK Logging out
Connection closed by foreign host.
Step7、F-Prot Antivirus软件包安装和配置过程:
软件包格式: fp-linux-ws.rpm
软件包的大小(KB):3970KB
下载地址:http://files.f-prot.com/files/linux-x86/fp-linux-ws.rpm
安装F-Prot Antivirus软件包前,请先启动SpamAssassin服务器:
详细操作:
# service spamassassin start (启动SpamAssassin服务器)
安装F-Prot Antivirus软件包安装过程如下:
详细操作:
# rpm -ivh fp-linux-ws.rpm (安装F-Prot Antivirus软件包)
Preparing... ########################################### [100%]
1:fp-linux-ws ########################################### [100%]
***************************************
* F-Prot Antivirus Updater *
***************************************
There‘s a new version of:
"Document/Office/Macro viruses" signatures on the web.
Starting to download...
Download completed.
There‘s a new version of:
"Application/Script viruses and Trojans" signatures on the web.
Starting to download...
Download completed.
Preparing to install Application/Script viruses and Trojans signatures.
Application/Script viruses and Trojans signatures have successfully been installed.
Preparing to install Document/Office/Macro viruses signatures.
Document/Office/Macro viruses signatures have successfully been installed.
***************************************
* Update completed successfully. *
***************************************
升级的F-Prot Antivirus病毒库的操作:
详细操作:
# cd /usr/local/f-prot/tools/
# ./check-updates.pl (升级命令)
***************************************
* F-Prot Antivirus Updater *
***************************************
Nothing to be done...
Step8、MailScanner软件包安装和配置过程:
软件包格式: MailScanner-4.50.5-1.rpm.tar.gz
软件包的大小(KB):4840KB
下载地址:http://www.sng.ecs.soton.ac.uk/mailscanner/downloads.shtml
安装MailScanner软件包安装过程如下:
详细操作:
# mv MailScanner-4.50.5-1.rpm.tar.gz /tmp/source/
# cd /tmp/source/
# tar -zxvf MailScanner-4.50.5-1.rpm.tar.gz
# cd MailScanner-4.50.5-1
# ./install.sh
更改incoming、quarantine两个目录相关用户和组的使用权限:
详细操作:
# chown postfix.postfix /var/spool/MailScanner/incoming
# chown postfix.postfix /var/spool/MailScanner/quarantine
修改/etc/postfix/目录下的main.cf 文件,在BASIC配置部分中增加以下一行让Postfix 调用MailScanner,详细内容如下:
完整内容:
#=====================BASE=========================#
myhostname = mail.easy.com
mydomain = easy.com
myorigin = $mydomain
mydestination = $myhostname localhost localhost.$mydomain
mynetworks = 192.168.1.0/24 127.0.0.0/8
inet_interfaces = all
header_checks = regexp:/etc/postfix/header_checks (新增加部分)
修改/etc/MailScanner/目录下的MailScanner.conf文件,修改详细内容以下:
详细内容:
Run As User =
Run As Group =
更改为:
Run As User = postfix
Run As Group = postfix
Incoming Queue Dir = /var/spool/mqueue.in
Incoming Queue Dir = /var/spool/postfix/hold
更改为:
Outgoing Queue Dir = /var/spool/mqueue
Outgoing Queue Dir = /var/spool/postfix/incoming
MTA = sendmail
更改为:
MTA = postfix
Virus Scanners =
更改为:
Virus Scanners = f-prot
Always Include SpamAssassin Report = no
更改为:
Always Include SpamAssassin Report = yes
Use SpamAssassin = no
更改为:
Use SpamAssassin = yes
Required SpamAssassin Score = 6
更改为:
Required SpamAssassin Score = 4
SpamAssassin User State Dir =
更改为:
SpamAssassin User State Dir = /var/spool/MailScanner/spamassassin
SpamAssassin Install Prefix =
更改为:
SpamAssassin Install Prefix = /usr/bin
SpamAssassin Local Rules Dir =
更改为:
SpamAssassin Local Rules Dir = /etc/MailScanner
修改/etc/postfix/目录下的header_checks文件,新增加以下一行内容到文件中,详细内容如下:
完整内容:
/^Received:/ HOLD
停止Postfix服务器,因为启动MailScanner服务时会自动启动Postfix服务器:
详细操作:
# service postfix stop
启动MailScanner服务器和设置开机时自动启动:
详细操作:
# service MailScanner start
# chkconfig --level 33 MailScanner on
测试结果:
从以下的网站下载一个测试病毒文件:
连接地址:http://www.eicar.org/anti_virus_test_file.htm
文件名称为:eicar.com
测试病毒文件的大小(Bytes):68 Bytes
编写一封测试邮件(附件中带上的eicar.com文件):
结果会收一封以下的警告邮件,议题内容以下:
详细内容:
{Virus?} testing……
邮件详细内容以下:
详细内容:
Warning: This message has had one or more attachments removed
Warning: (eicar.com).
Warning: Please read the "yoursite-Attachment-Warning.txt" attachment(s) for more information.
testing......
查看maillog日志,请确认日志中是否存在以下的信息:
详细内容:
Jan 8 12:11:08 mail MailScanner[9199]: Virus Scanning: F-Prot found virus EICAR_Test_File
Jan 8 12:11:08 mail MailScanner[9199]: Virus Scanning: F-Prot found 1 infections
Jan 8 12:11:08 mail MailScanner[9199]: Infected message E73EE13C07C.07685 came from
Jan 8 12:11:08 mail MailScanner[9199]: Virus Scanning: Found 1 viruses
Jan 8 12:11:09 mail MailScanner[9199]: Requeue: A9D6413C085.39DDE to 6414713C089
Jan 8 12:11:09 mail MailScanner[9199]: Uninfected: Delivered 1 messages
出现以上的日志信息就代表您的F-Prot Antivirus + MailScanner-4.31.6-1架设已经成功啦,真的要恭喜您啦!
Step9、DNS详细配置过程:
修改/var/named/chroot/etc/named.conf文件,添加以下内容如下:
详细内容:
zone "easy.com" { #正解
type master;
file "/var/named/easy.com.hosts";
};
zone "1.168.192.in-addr.arpa" { #反解
type master;
file "/var/named/192.168.1.rev";
};
在/var/named/chroot/var/named/目录建立正解easy.com.hosts文件,文件完整内容如下:
详细内容:
$ttl 38400
easy.com. IN SOA mail.easy.com. fandy.easy.com. (
1137063120
10800
3600
604800
38400 )
easy.com. IN NS mail.easy.com.
mail.easy.com. IN A 192.168.1.253
mail.easy.com. IN MX 10 mail.easy.com
extmail.easy.com. IN CNAME mail
在/var/named/chroot/var/named/目录建立正解192.168.1.rev文件,文件完整内容如下::
详细内容:
$ttl 38400
1.168.192.in-addr.arpa. IN SOA mail.easy.com. fandy.easy.com. (
1137063268
10800
3600
604800
38400 )
1.168.192.in-addr.arpa. IN NS mail.easy.com.
253.1.168.192.in-addr.arpa. IN PTR mail.easy.com.
修改Apache系统的/etc/http/conf/httpd.conf配置文件,详细内容如下:
详细内容:
ServerAdminfandy@easy.com
更改为:
# ServerAdminfandy@easy.com
ServerName mail.easy.com:80
更改为:
#ServerName mail.easy.com:80
DocumentRoot "/var/www/html"
更改为:
DocumentRoot "/var/www/html/postfixadmin"

更改为:

#AddHandler cgi-script .cgi
更改为:
AddHandler cgi-script .cgi .pl
#NameVirtualHost *:80
更改为:
NameVirtualHost 192.168.1.253
在文件最后新添加以下的部分:
#http://mail.easy.com指向postfixadmin域名和用户管理页面
DocumentRoot /var/www/html/postfixadmin
ServerAdminfandy@easy.com
ServerName mail.easy.com

#http://extmail.easy.com指向Web邮件系统页面
DocumentRoot /var/www/cgi-bin/extmail/html
ServerAdminfandy@easy.com
ServerName extmail.easy.com
ScriptAlias /extmail/cgi/ /var/www/cgi-bin/extmail/cgi/
Alias /extmail/ /var/www/cgi-bin/extmail/html/
SuexecUserGroup vmail vmail


Options +ExecCGI

启动 Apache、DNS 服务器:
详细操作:
# service httpd restart
# chkconfig --level 33 courier-authlib on
# service named start
测试PostfixAdmin域名和用户管理页面是否正常运行,打开Mozilla Firefor或者Internet Explorer等浏览器输入以下地址:
详细操作:
http://mail.easy.com
详细操作:
http://mail.easy.com/admin
测试Extmail Web邮件系统页面是否正常运行,打开Mozilla Firefor或者Internet Explorer等浏览器输入以下地址:
详细操作:
http://extmail.easy.com
在邮件通行登陆口:
详细内容:
用户名:fandy
密 码: jinbiao
域 名: easy.com
登陆过程如下:
详细内容:
用户名,密码校验成功!
如果您的浏览器没有重定向,请点击下面链接
[ 进入Webmail ] 退出
用户正确登陆后的介面如下:
Step10、OpenSSL详细配置过程:
特别说明:因为使用rpm方式来安装,所以openssl.cnf配置文件存放地址为:/usr/share/ssl/
执行CA凭证产生程序,详细操作如下:
详细操作:
# cp /usr/share/ssl/misc/CA /etc/httpd/conf/ssl.crt/
# cd /etc/http/conf/ssl.crt/
# ./CA -newca
CA certificate filename (or enter to create) (按回建立create)
Making CA certificate ...
Generating a 2048 bit RSA private key
............+++
.........................................................................................+++
writing new private key to ‘./demoCA/private/./cakey.pem‘
Enter PEM pass phrase: Sa6$feP (设定通行码)
Verifying - Enter PEM pass phrase: Sa6$feP (设定通行码)
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.‘, the field will be left blank.
-----
Country Name (2 letter code) [GB]: CN(国家代码)
State or Province Name (full name) [Berkshire]: GuangDong(省份全称)
Locality Name (eg, city) [Newbury]: GuangZhou(城、镇地址)
Organization Name (eg, company) [My Company Ltd]:NanSha Easy Infor CO.,LTD (公司名称)
Organizational Unit Name (eg, section) []:EASY (使用认证之部门名称)
Common Name (eg, your name or your server‘s hostname) []:mail.easy.com (网站名称)
Email Address []:fandy@easy.com (Web服务器管理员电子邮箱)
生成服务器私钥,详细操作如下:
详细操作:
# cd /etc/httpd/conf/ssl.crt/
# openssl genrsa -des3 -out server.key 2048
Generating RSA private key, 2048 bit long modulus
............................................+++
....................................................+++
e is 65537 (0x10001)
Enter pass phrase for server.key: Sa6$feP (设定通行码)
Verifying - Enter pass phrase for server.key: Sa6$feP (设定通行码)
生成服务器证书请求,详细操作如下:
详细操作:
# cd /etc/httpd/conf/ssl.crt/
# openssl req -new -key server.key -out server.csr
Enter pass phrase for server.key: Sa6$feP (设定通行码)
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.‘, the field will be left blank.
-----
Country Name (2 letter code) [GB]: CN (国家代码)
State or Province Name (full name) [Berkshire]: GuangDong (省份全称)
Locality Name (eg, city) [Newbury]: GuangZhou (城、镇地址)
Organization Name (eg, company) [My Company Ltd]: NanSha Eeasy Infor CO.,LTD (公司名称)
Organizational Unit Name (eg, section) []: Easy (使用认证之部门名称)
Common Name (eg, your name or your server‘s hostname) []: mail.easy.com (网站名称)
Email Address []:fandy@easy.com (Web服务器管理员电子邮箱)
Please enter the following ‘extra‘ attributes
to be sent with your certificate request
A challenge password []: (可以直接按回车跳过)
An optional company name []: (可以直接按回车跳过)
将/etc/httpd/conf/ssl.crt/目录下server.crt文件更改为newreq.pem文件,然后使用CA文件来签证就可以了,详细操作如下:
详细操作:
# cd /etc/httpd/conf/ssl.crt/
# mv server.csr newreq.pem
# ./CA -sign
Using configuration from /usr/share/ssl/openssl.cnf
Enter pass phrase for ./demoCA/private/cakey.pem: Sa6$feP (设定通行码)
Check that the request matches the signature
Signature ok
Certificate Details:
Serial Number: 1 (0x1)
Validity
Not Before: Jan 9 12:43:37 2006 GMT
Not After : Jan 7 12:43:37 2016 GMT
Subject:
countryName = CN
stateOrProvinceName = GuangDong
localityName = GuangZhou
organizationName = NanSha Easy Infor CO.,LTD
organizationalUnitName = EASY
commonName = mail.easy.com
emailAddress =fandy@easy.com
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier:
E8:B4:42:56:7F:B5:99:BE:19:23:B0:C4:D9:A2:4F:A3:09:52:DD:DD
X509v3 Authority Key Identifier:
keyid:30:F2:FB:08:48:3A:14:CB:3B:95:B6:0D:52:61:B7:B1:07:F8:48:FF
DirName:/C=CN/ST=GuangDong/L=GuangZhou/O=NanSha Easy Infor CO.,LTD
/OU=EASY/CN=mail.easy.com/emailAddress=fandy@easy.com
serial:00
Certificate is to be certified until Jan 7 12:43:37 2016 GMT (3650 days)
Sign the certificate? [y/n]: y (输入“ y ”,按回车)
1 out of 1 certificate requests certified, commit? [y/n] y (输入“ y ”,按回车)
Write out database with 1 new entries
……………………其它内容《略》……………………
-----END CERTIFICATE-----
Signed certificate is in newcert.pem
将/etc/httpd/conf/ssl.crt/目录下newreq.pem文件更改为server.crt文件,详细操作如下:
详细操作:
# cd /etc/httpd/conf/ssl.crt/
# mv newreq.pem server.crt
生成客户私钥,详细操作如下:
详细操作:
# cd /etc/httpd/conf/ssl.crt/
# openssl genrsa -des3 -out client.key 2048
Generating RSA private key, 2048 bit long modulus
.....+++
..........................+++
e is 65537 (0x10001)
Enter pass phrase for client.key: Sa6$feP (设定通行码)
Verifying - Enter pass phrase for client.key: Sa6$feP (设定通行码)
请求,详细操作如下:
详细操作:
# cd /etc/httpd/conf/ssl.crt/
# openssl req -new -key client.key -out client.csr
Enter pass phrase for client.key: Sa6$feP (设定通行码)
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.‘, the field will be left blank.
-----
Country Name (2 letter code) [GB]:CN (国家代码)
State or Province Name (full name) [Berkshire]:GuangDong (省份全称)
Locality Name (eg, city) [Newbury]:GuangZhou (城、镇地址)
Organization Name (eg, company) [My Company Ltd]:NanSha Easy Infor CO.,LTD (公司名称)
Organizational Unit Name (eg, section) []: EASY
Common Name (eg, your name or your server‘s hostname) []: mail.easy.com (主机名称)
Email Address []:fandy@easy.com (管理员电子邮箱)
Please enter the following ‘extra‘ attributes
to be sent with your certificate request
A challenge password []: (可以直接按回车跳过)
An optional company name []: (可以直接按回车跳过)
签证,详细操作如下:
详细操作:
# cd /etc/httpd/conf/ssl.crt/
# openssl ca -in client.csr -out client.crt
Using configuration from /usr/share/ssl/openssl.cnf
Enter pass phrase for ./demoCA/private/cakey.pem: Sa6$feP (设定通行码)
Check that the request matches the signature
Signature ok
Certificate Details:
Serial Number: 2 (0x2)
Validity
Not Before: Jan 9 13:36:56 2006 GMT
Not After : Jan 7 13:36:56 2016 GMT
Subject:
countryName = CN
stateOrProvinceName = GuangDong
organizationName = NanSha Easy Infor CO.,LTD
organizationalUnitName = EASY
commonName = mail.easy.com
emailAddress =fandy@easy.com
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier:
FA:9E:34:B8:7C:9B:B5:AD:7C:F7:E4:E4:37:94:CE:31:60:DE:14:B7
X509v3 Authority Key Identifier:
keyid:30:F2:FB:08:48:3A:14:CB:3B:95:B6:0D:52:61:B7:B1:07:F8:48:FF
DirName:/C=CN/ST=GuangDong/L=GuangZhou/O=NanSha Easy Infor CO.,LTD/
OU=EASY/CN=mail.easy.com/emailAddress=fandy@easy.com
serial:00
Certificate is to be certified until Jan 7 13:36:56 2016 GMT (3650 days)
Sign the certificate? [y/n]: y (输入“ y ”,按回车)
1 out of 1 certificate requests certified, commit? [y/n] y (输入“ y ”,按回车)
Write out database with 1 new entries
Data Base Updated
由PEM转至PKCS12。Microsoft Outlook Express使用PKCS12格式,因此欲使用Microsoft Outlook Express寄出签章信件,只要将产生出来的.p12档安装在Windows即可使用
详细操作:
# openssl pkcs12 -export -clcerts -in client.crt -inkey client.key -out client.pfx
Enter pass phrase for client.key: Sa6$feP (设定通行码)
Enter Export Password: jinbiao (输出密码)
Verifying - Enter Export Password: jinbiao (确认输出密码)
复制/etc/httpd/conf/ssl.crt/demoCA/目录下cacert.pem文件,到/etc/httpd/conf/ssl.crt/目录中,并且复制一份证书,更名为ca.crt文件,详细操作如下::
详细操作:
# cp /etc/httpd/conf/ssl.crt/demoCA/cacert.pem /etc/httpd/conf/ssl.crt/
# cp cacert.pem ca.crt
修改/etc/httpd/conf.d/目录下的ssl.conf文件,修改详细内容以下:
完整内容:
#SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
更改为:
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
#SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
更改为:
SSLCertificateKeyFile /etc/httpd/conf/ssl.crt/server.key
#SSLCACertificatePath /etc/httpd/conf/ssl.crt
#SSLCACertificateFile /usr/share/ssl/certs/ca-bundle.crt
更改为:
SSLCACertificatePath /etc/httpd/conf/ssl.crt
SSLCACertificateFile /etc/httpd/conf/ssl.crt/cacert.pem
#SSLVerifyClient require
#SSLVerifyDepth 10
更改为:
SSLVerifyClient require
SSLVerifyDepth 10
[楼 主] Posted:2006-02-20 14:56|顶端
sonic

级别: 新手上路
精华: 0
发帖: 40
威望: 34 点
金钱: 340 RMB
贡献值: 0 点
注册时间:2005-09-16
资料消息推荐引用编辑
支持一下...
[1 楼] Posted:2006-02-21 08:35|顶端
nymz

级别: 新手上路
精华: 0
发帖: 24
威望: 21 点
金钱: 210 RMB
贡献值: 0 点
注册时间:2005-06-30
资料消息推荐引用编辑
ding
[2 楼] Posted:2006-02-21 19:56|顶端
szjxy

级别: 新手上路
精华: 0
发帖: 38
威望: 35 点
金钱: 350 RMB
贡献值: 0 点
注册时间:2005-12-06
资料消息推荐引用编辑
谢谢,有点问题想请教哦,能不在安装系统时给出最小条件的安装啊,我不想装桌面之类没有用的包,老大应该知道哪些是一定要的吧??
[3 楼] Posted:2006-02-22 08:40|顶端
快速跳至 >> Mail服务器  |- qmail  |- Postfix  |- SpamAssassin  |- Webmail开发 >> Linux&Unix 系统管理  |- Linux  |- BSD Unix >> 防火墙和代理服务器  |- iptables&squid  |- Ipf&Ipfw >> 站务管理  |- 轻松一刻  |- 论坛意见箱

开源邮件技术社区 ->Postfix

快速发帖顶端
内容:
HTML 代码不可用
使用签名
Wind Code自动转换
[查看帖子长度] 标题:
表情:
按 Ctrl+Enter 直接提交

广告位招商,请联系我们scyz at toping.net
Powered byPHPWind v4.3.2 Skin byYesxp.Net
Time is now:,
_xyz
RedHat Postfix + MySQL + Cyrus-sasl + Dovecot 用RPM方式实现 开源邮件技术社区 - powered by phpwind.net Postfix Cyrus-IMAP Cyrus-SASL MySQL IMP完全指南 Postfix + dovecot + Apache + OpenWebMail 安装笔记 ( rpm RedHat AS 4.1) postfix的UCE 开源邮件技术社区 学习java必看 赛迪网技术社区 - powered by phpwind.net 基于Linux和Postfix的邮件系统的web mail安装手册 开源邮件技术社区 Postfix配置文件main.cf中常用参数介绍 开源邮件技术社区 基于Linux和Postfix的邮件系统的web mail安装手册 开源邮件技术社区 RedHat AS 4.1 + Postfix + dovecot + Apache + OpenWebMail 安装笔记 ChinaCamera.Net - Powered by PHPWind 驱动程序开发中VC6.0与DDK环境变量设置问题 驱动程序开发网技术社区 - powered by phpwind.net MYSQL出错代码及出错信息对照 HOW-TOs(新手教程) PHPWind Board - powered by phpwind.net 【分享】经典2机共享实现方案 5Q地带 - powered by phpwind.net 生活 校园论坛 - powered by phpwind.net 行政区划论坛 - Powered by PHPWind.net 林论坛 - powered by phpwind.net 霏凡论坛 - powered by phpwind.net 人像摄影 - ChinaCamera.Net - Powered by PHPWind 静能生慧(转文) - powered by phpwind.net 中秋月明-想哭!! - PHPWind BLOG - powered by phpwind.net 寻论社区 - 初中作文教学(一) - powered by phpwind.net 寻论社区 -中学作文库 天天创新 - powered by phpwind.net 寻论社区 -中学作文库 天天创新 - powered by phpwind.net 抗战日军伤亡数字是多少 二战闪电军事基地社区 - powered by phpwind.net