# Directory in which to place saslauthd's listening socket, pid file, and so
# on. This directory must already exist.
SOCKETDIR=/var/run/saslauthd
# Mechanism to use when checking passwords. Run "saslauthd -v" to get a list
# of which mechanism your installation was compiled with the ablity to use.
MECH=shadow
# Additional flags to pass to saslauthd on the command line. See saslauthd(8)
# for the list of accepted flags.
FLAGS=
修改 /usr/lib/sasl2/smtpd.conf
[root@ser ~]# vim /usr/lib64/sasl2/smtpd.conf
pwcheck_method: saslauthd
测试 saslauthd
[root@ser ~]# service saslauthd restart
[root@ser ~]# testsaslautd -u yjw -p '020304'
0: OK "Success."
在postfix 的配置文件中,添加以下内容,使其支持SMTP认证
[root@ser ~]# vim /etc/postfix/main.cf
message_size_limit = 1073741824 # 邮件的大小为10M
default_process_limit = 50
default_destination_concurrency_limit = 20
把Postfix+Dovecot+Openwebmail 三者个格式统一下就行了
1.postfix 配置 main.cf
mail_spool_directory = /var/spool/mail
2.Dovecot 配置 Dovecot.conf
mail_location = mbox:~/mail:INBOX=/var/spool/mail/%u
3.Openwebmail.conf
mailspooldir /var/spool/mail
五、安装httpd
[root@ser ~]# yum - y install httpd
[root@ser ~]# chkconfig httpd on
[root@ser ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@ser ~]# vim /etc/httpd/conf/httpd.conf
ServerAdmin
[email protected]
ServerName mail.yjw.com:80
AddHandler cgi-script .cgi .pl
六、登陆openwebmail
在IE 中输入 mail.yjw.com/cgi-bin/openwebmail/openwebmail.pl, 这个地址是不是很长,那么我们来点短点的
在 httpd的 配置文件中添加 下面 内容:
ScriptAlias /mail /var/www/cgi-bin/openwebmail/openwebmail.pl
这样在IE 中直接输入
mail.yjw.com/mail
七、安装反垃圾邮件软件,MailScanner
到MailScanner .org 上下载MailScanner-4.75.11-1.rpm.tar.gz
[root@ser ~]# tar zxvf MailScanner-4.75.11-1.rpm.tar.gz
[root@ser ~]# cd MailScanner-4.75.11
[root@ser MailScanner-4.75.11-1]# ./install.sh # 安装
安装 spamassassin
先检查您的系统内是否已经安装SpamAssassin软件包。在文本终端中输入:
[root@ser ~]# rpm -qa | grep spamassassin
spamassassin-3.1.9-1.el5
下载Mail-SpamAssassin-3.2.5.tar.gz
[root@ser ~]#tar -zxvf Mail-SpamAssassin-3.2.5.tar.gz
[root@ser ~]# cd Mail-SpamAssassin-3.2.5
[root@ser ~]# perl Makefile.PL
[root@ser ~]# make
[root@ser ~]# make install
打开/etc/MailScanner/目录中的MailScanner.conf文件,主要说明修改的关键部分:
%org-name% = yjw.com
%org-long-name% = yjw
web-site% = mail.yjw.com
Run As User = postfix
Run As Group = postfix
Incoming Queue Dir = /var/spool/postfix/hold
Outgoing Queue Dir = /var/spool/postfix/incoming
MTA = postfix
Incoming Work Group = postfix
Quarantine User = postfix
Quarantine Group = postfix
Always Include SpamAssassin Report = yes
SpamAssassin User State Dir = /var/spool/MailScanner/spamassassin
SpamAssassin Install Prefix = /usr/bin
Log Speed = yes
Log Spam = yes
Log Silent Viruses = yes
Phishing Modify Subject = yes
更改incoming,quarantine 两个2个目录
[root@ser ~]# service spamassassin restart
[root@ser ~]# service spamassassin on
[root@ser ~]# service MailScanner restart
[root@ser ~]# service MailScanner on
[root@ser ~]# chown -R postfix:postfix /var/spool/MailScanner/*
[root@ser ~]# cd /var/spool/MailScanner/
[root@ser MailScanner]# ll
drwxr-xr-x 4 postfix postfix 4096 Apr 30 16:56 incoming
drwxr-xr-x 3 postfix postfix 4096 Apr 29 19:10 quarantine
drwx------ 2 postfix postfix 4096 Apr 30 15:58 spamassassin
在/etc/postfix/header_checks 中增加一句话:
[root@ser ~]# vi /etc/postfix/header_checks
/^Received:/ HOLD
设置中文邮件过滤规则
[root@ser ~]# wget -N -P
http://www.ccert.edn.cn/spam/sa/Chiese_rules.cf
/usr/share/spamassassin
使用计划任务来更新规则
[root@ser ~]# crontab -e
0 0 1 * * wget - N -P /usr/share/spamassassin
http://www.ccert.edu.cn/spam/sa/Chiness_rules.cf
; /etc/init.d/spamassassin restart
八、登陆openwebmail, 测试 收信,发信是否正常
[root@ser ~]# useradd tom
[root@ser ~]# passwd tom
tom
tom
[root@ser ~]# useradd yjw
[root@ser ~]# passwd yjw