、前期准备

由于整个环境会设计比较多得依赖包,所以先实用yum将依赖包安装上!

查询

 


  
  1. for i in  httpd-devel mysql-devel mysql-server php-xml php-pdo php-mbstring libtool-ltdl-devel expect-devel openldap-servers pcre-devel apr-devel apr-util-devel perl-DBD-MySQL libtool-itdl expect php-gd postgresql-devel libdbi ruby php-mcrypt php-mhash libmcrypt-devel libmhash-devel prel-unix-syslog ;do rpm -qa $i ;done 

安装完后启动mysql httpd服务

 


  
  1. For i in mysqld httpd ; do service $i start ; done 

 

认证数据库部分

 


  
  1. tar –xf extman-1.1.tar.gz 
  2.  
  3. cd extman-1.1/docs 
  4.  
  5. mysqladmin –uroot password “newbie” 
  6.  
  7. mysql –pnewbie < extmail.sql 
  8.  
  9. mysql –pnewbie < init.sql 

 

 

安装认证中间件courier-authlib让MTA MAA来访问MYSQL

 


  
  1. tar –xf courier-authlib-0.63.0.tar.bz2 
  2.  
  3. cd courier-authlib-0.63.0 
  4.  
  5. ./configure 
  6.  
  7. Make && make install 

 

安装完后创建并修改配置文件,文件中我们需要告诉他认证使用mysql,将mysql所需要的一些参数写入配置文件

 


  
  1. Cd /usr/local/etc/authlib/ 
  2.  
  3. Cp authdaemonrc.dist authdaemonrc 
  4.  
  5. Vim authdaemonrc 

 


  
  1. 将authmodulelist=“authmysql” 
  2. authmodulelistorig=“authmysql” 
  3.  
  4. DEBUG_LOGIN=2 
  5.  
  6. DEFAULTOPTIONS=“wbnodsn=1” 

创建authmysqlrc文件

Cp authmysqlrc.dist authmysqlrc

vi authmysqlrc

 


  
  1. MYSQL_SERVER localhost 
  2.  
  3. MYSQL_USERNAME extmail 
  4.  
  5. MYSQL_PASSWORD extmail 
  6.  
  7. MYSQL_SOCKET /var/lib/mysql/mysql.sock 
  8.  
  9. MYSQL_SELECT_CLAUSE     SELECT username,password,"",uidnumber,gidnumber, \ 
  10.  
  11. CONCAT('/home/data/domains/',homedir),  \ 
  12.  
  13. CONCAT('/home/data/domains/',maildir),  \ 
  14.  
  15. quota,  \ 
  16.  
  17. name    \ 
  18.  
  19. FROM mailbox    \ 
  20.  
  21. WHERE username = '$(local_part)@$(domain)' 

Authlib为了方便管理,需要创建authlib启动脚本,使用systemV方式i

 


  
  1. cd courier-authlib-0.63.0 
  2.  
  3. cp courier-authlib.sysvinit /etc/init.d/courier-authlib 
  4.  
  5. chmod 755 /etc/init.d/courier-authlib 
  6.  
  7. chkconfig --add courier-authlib 
  8.  
  9. service courier-authlib start 
  10.  
  11. chkconfig courier-authlib on 

 

pop与imap支持

接下来安装courier-imap 提供pop3和imap支持

tar xf courier-imap-4.7.0.tar.bz2

cd courier-imap-4.7.0

软件 需要普通永华来编译,我们使用zhoutao用户在编译

 


  
  1. Useradd zhoutao 
  2.  
  3. chown -R zhoutao . 
  4.  
  5. su student -c './configure --with-redhat' 
  6.  
  7. su zhoutao -c make 
  8.  
  9. make install 

同样,为了方便管理,创建启动脚本和配置文件,并在配置文件中打开相应协议的支持

 


  
  1. Cp courier-imap.sysvinit /etc/init.d/courier-imap 
  2.  
  3. Chmod 755 /etc/init.d/courier-imap 
  4.  
  5. Chkconfig –add courier-imap 
  6.  
  7. Cd /usr/lib/courier-imap/etc/ 
  8.  
  9. cp imapd-ssl.dist imapd-ssl 
  10.  
  11. cp imapd.dist imapd 
  12.  
  13. cp pop3d.dist pop3d 
  14.  
  15. cp pop3d-ssl.dist pop3d-ssl 

修改以上4个配置文件

将IMAPDSTART IMAPDSSLSTART POP3DSTART POP3DSSLSTART 修改为yes

启动服务

service courier-imap start

chkconfig courier-imap on

SASL认证

发信认证我们会用到sasl包,自带rpm不支持mysql活着是authlib,需要卸载掉原有的sasl包,从新编译安装一个

 


  
  1. rpm -e --nodeps cyrus-sasl-devel cyrus-sasl-plain cyrus-sasl cyrus-sasl-lib 
  2.  
  3. tar -xf cyrus-sasl-2.1.22.tar.gz 
  4.  
  5. cd cyrus-sasl-2.1.22 
  6.  
  7. ./configure --disable-anon --enable-plain --enable-login --enable-sql --with-mysql --withauthdaemond="/ 
  8.  
  9. usr/local/var/spool/authdaemon/socket" --with-mysql- include=/usr/include/mysql/ --with-mysql-libs=/usr/lib/mysql/ --with-openssl 
  10.  
  11. make && make install 

生成sasl 的相关配置文件 ,Postfix会调用smtp.conf配置文件,所以你应该手工将此

文件生成,并且在此文件中声名使用authlib来认证。

 


  
  1. cat > /usr/local/lib/sasl2/smtpd.conf << ENDF 
  2.  
  3. pwcheck_method:authdaemond 
  4.  
  5. log_level:3 
  6.  
  7. mech_list:PLAIN LOGIN 
  8.  
  9. authdaemond_path:/usr/local/var/spool/authdaemon/socket 
  10.  
  11. ENDF 

 


  
  1. rm -rf /usr/lib/sasl2 
  2.  
  3. ln -s /usr/local/lib/sasl2 /usr/lib 
  4.  
  5. ln -s /usr/local/lib/libsasl* /usr/lib/ 

 

 

安装postfix

 


  
  1. useradd -u 89 postfix -s /sbin/nologin 
  2.  
  3. useradd -u 90 -s /sbin/nologin postdrop 
  4.  
  5. cd $MY_PWD 
  6.  
  7. tar xf postfix-2.7.1.tar.gz 
  8.  
  9.   
  10.  
  11. cd postfix-2.7.1 
  12.  
  13. make -f Makefile.init makefiles 'CCARGS=-DHAS_MYSQL -I/usr/include/mysql 
  14.  
  15. -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/local/include/sasl' 'AUXLIBS=-L/usr/lib/mysql 
  16.  
  17. -lmysqlclient -L/usr/local/lib/sasl2 -lsasl2 -L/usr/lib -lssl -lcrypto -lz -lm' 
  18.  
  19. make 
  20.  
  21. make install 

服务脚本,手工创建!

 

 


  
  1. #!/bin/sh 
  2.  
  3.  
  4. # postfix      Postfix Mail Transfer Agent 
  5.  
  6.  
  7. # chkconfig: 2345 80 30 
  8.  
  9. # description: Postfix is a Mail Transport Agent, which is the program \ 
  10.  
  11. #              that moves mail from one machine to another. 
  12.  
  13. # processname: master 
  14.  
  15. # pidfile: /var/spool/postfix/pid/master.pid 
  16.  
  17. # config: /etc/postfix/main.cf 
  18.  
  19. # config: /etc/postfix/master.cf 
  20.  
  21.  
  22. # $Revision: 2.2 $ 
  23.  
  24.  
  25. # Written by Package Author: Simon J Mudd <sjmudd@pobox.com> 
  26.  
  27. # 25/02/99: Mostly s/sendmail/postfix/g by John A. Martin <jam@jamux.com> 
  28.  
  29. # 23/11/00: Changes & suggestions by Ajay Ramaswamy <ajayr@bigfoot.com> 
  30.  
  31. # 20/01/01: Changes to fall in line with RedHat 7.0 style 
  32.  
  33. # 23/02/01: Fix a few untidy problems with help from Daniel Roesen. 
  34.  
  35.   
  36.  
  37. # Source function library. 
  38.  
  39. . /etc/rc.d/init.d/functions 
  40.  
  41.   
  42.  
  43. # Source networking configuration. 
  44.  
  45. . /etc/sysconfig/network 
  46.  
  47.   
  48.  
  49. # Check that networking is up. 
  50.  
  51. [ ${NETWORKING} = "no" ] && exit 0 
  52.  
  53.   
  54.  
  55. [ -x /usr/sbin/postfix ] || exit 0 
  56.  
  57. [ -d /etc/postfix ] || exit 0 
  58.  
  59. [ -d /var/spool/postfix ] || exit 0 
  60.  
  61.   
  62.  
  63. RETVAL=0 
  64.  
  65.   
  66.  
  67. start() { 
  68.  
  69.        # Start daemons. 
  70.  
  71.        echo -n "Starting postfix: " 
  72.  
  73.        /usr/sbin/postfix start 2>/dev/null 1>&2 && success || failure 
  74.  
  75.        RETVAL=$? 
  76.  
  77.        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/postfix 
  78.  
  79.         echo 
  80.  
  81.        return $RETVAL 
  82.  
  83.  
  84.   
  85.  
  86. stop() { 
  87.  
  88.         # Stop daemons. 
  89.  
  90.        echo -n "Shutting down postfix: " 
  91.  
  92.        /usr/sbin/postfix stop 2>/dev/null 1>&2 && success || failure 
  93.  
  94.        RETVAL=$? 
  95.  
  96.        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/postfix 
  97.  
  98.        echo 
  99.  
  100.        return $RETVAL 
  101.  
  102.  
  103.   
  104.  
  105. reload() { 
  106.  
  107.        echo -n "Reloading postfix: " 
  108.  
  109.        /usr/sbin/postfix reload 2>/dev/null 1>&2 && success || failure 
  110.  
  111.        RETVAL=$? 
  112.  
  113.        echo 
  114.  
  115.        return $RETVAL 
  116.  
  117.  
  118.   
  119.  
  120. restart() { 
  121.  
  122.        stop 
  123.  
  124.        start 
  125.  
  126.  
  127.   
  128.  
  129. abort() { 
  130.  
  131.        /usr/sbin/postfix abort 2>/dev/null 1>&2 && success || failure 
  132.  
  133.        return $? 
  134.  
  135.  
  136.   
  137.  
  138. flush() { 
  139.  
  140.        /usr/sbin/postfix flush 2>/dev/null 1>&2 && success || failure 
  141.  
  142.        return $? 
  143.  
  144.  
  145.   
  146.  
  147. check() { 
  148.  
  149.        /usr/sbin/postfix check 2>/dev/null 1>&2 && success || failure 
  150.  
  151.        return $? 
  152.  
  153.  
  154.   
  155.  
  156. # See how we were called. 
  157.  
  158. case "$1" in 
  159.  
  160.   start) 
  161.  
  162.        start 
  163.  
  164.        ;; 
  165.  
  166.   stop) 
  167.  
  168.        stop 
  169.  
  170.        ;; 
  171.  
  172.   restart) 
  173.  
  174.        restart 
  175.  
  176.        ;; 
  177.  
  178.   reload) 
  179.  
  180.        reload 
  181.  
  182.        ;; 
  183.  
  184.   abort) 
  185.  
  186.        abort 
  187.  
  188.        ;; 
  189.  
  190.   flush) 
  191.  
  192.        flush 
  193.  
  194.        ;; 
  195.  
  196.   check) 
  197.  
  198.        check 
  199.  
  200.        ;; 
  201.  
  202.   status) 
  203.  
  204.      status master 
  205.  
  206.        ;; 
  207.  
  208.   condrestart) 
  209.  
  210.        # don't use /var/lock/subsys/postfix, check for postfix running directly 
  211.  
  212.        daemon_directory=$(postconf -h daemon_directory) 
  213.  
  214.        $daemon_directory/master -t 2>/dev/null && : || restart 
  215.  
  216.        ;; 
  217.  
  218.   *) 
  219.  
  220.        echo "Usage: postfix {start|stop|restart|reload|abort|flush|check|status|condrestart}" 
  221.  
  222.        exit 1 
  223.  
  224. esac 
  225.  
  226.   
  227.  
  228. exit $? 

 

修改权限

 


  
  1. Chmod 755 /etc/init.d/postfix 
  2.  
  3. Chkconfig –add postfix 

修改postfix主配置文件

 


  
  1. myhostname = mail.zhoutao.com 
  2.  
  3. mydomain = zhoutao.com 
  4.  
  5. mydestination = $myhostname, localhost 

 

使postfix支持虚拟域

 


  
  1. message_size_limit = 14680064 
  2.  
  3. virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf 
  4.  
  5. virtual_mailbox_base = /home/data/domains 
  6.  
  7. virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf 
  8.  
  9. virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf 
  10.  
  11. virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_limit_maps.cf 
  12.  
  13. virtual_transport = maildrop 
  14.  
  15. maildrop_destination_recipient_limit = 1 
  16.  
  17. smtpd_sasl_auth_enable = yes 
  18.  
  19. smtpd_sasl2_auth_enable = yes 
  20.  
  21. smtpd_sasl_security_options = noanonymous 
  22.  
  23. broken_sasl_auth_clients = yes 
  24.  
  25. smtpdsmtpd_sasl_path = smtpd 
  26.  
  27. smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination,reject_unauth_pipelining,reject_invalid_hostname 

为了让postfix可以和extman联用 所以将extman目录下mysql_virtual开头的配置

文件拷到postfix目录下

cp extman-1.1/docs/mysql_virtual_* /etc/postfix

现在可以启动服务了

service postfix start

chkconfig postfix on

MDA的安装

安装maildrop 以扩展邮件投递功能 ,maildrop是一个优秀的MDA,我们让postfix

在投递邮件时使用maildrop。

 


  
  1. tar xf maildrop-2.4.3.tar.bz2 
  2.  
  3. cd maildrop-2.4.3 
  4.  
  5. ./configure --enable-authlib --with-devel --enable-userdb --enable-maildirquota --enablesyslog= 
  6.  
  7. 1 --enable-trusted-users='root mail daemon postmaster qmaild mmdf' --enablerestrict- 
  8.  
  9. trusted=0 --enable-sendmail=/usr/sbin/sendmail 
  10.  
  11. make && make install 
  12.  
  13. ln -s /usr/local/bin/maildrop /usr/bin/ 

我们并不希望maildrop在投递邮件是以root身份投递,所以建个普通用户。

 


  
  1. groupadd -g 1000 vgroup 
  2.  
  3. useradd -g 1000 -u 1000 -s /sbin/nologin -d /dev/null vuser 

配置 /etc/postfix/master.cf 文件 ,让postfix可以调用maildrop。

vi /etc/postfix/master.cf

在最后面加入下面内容:

 


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

特别注意flags 前面要有一个坑爹的空格,要不然有报错!

 

创建邮件存储目录 并建个测试域

 


  
  1. mkdir -p /home/data/domains/extmail.org/postmaster 
  2.  
  3. maildirmake /home/data/domains/extmail.org/postmaster/Maildir 
  4.  
  5. chown -R vuser:vgroup /home/data/domains/ 
  6.  
  7. service postfix restart 

测试 maildrop

 


  
  1. [root@localhost ~]# echo "test" | maildrop -V 10 -d postmaster@extmail.org 

 

maildrop: authlib: groupid=1000

maildrop: authlib: userid=1000

maildrop: authlib: logname=postmaster@extmail.org,

home=/home/data/domains/extmail.org/postmaster,

mail=/home/data/domains/extmail.org/postmaster/Maildir/

maildrop: Changing to /home/data/domains/extmail.org/postmaster

Message start at 0 bytes, envelope sender=postmaster@extmail.org

maildrop: Attempting .mailfilter

maildrop: Delivery complete.

出现上以信息说明 authlib,maildrop 工作正常

Webmail安装

项目中我们还需要通过web方式进行收发邮件,所以需要修改apache 配置

修改/etc/httpd/conf/httpd.conf,因为投递邮件时maildrop 是以 vuser:group用户身

份投递,所以 修改apache所有者,生成extman和extmail所需要的配置信息。

user vuser

group vgroup

[root@localhost ~]# cd /etc/httpd/conf.d/

[root@localhost conf.d]# vim extmail.conf

 


  
  1. Alias /extman/cgi/ /var/www/extsuite/extman/cgi/ 
  2.  
  3. Alias /extman /var/www/extsuite/extman/html/ 
  4.  
  5. <Location "/extman/cgi"> 
  6.  
  7. SetHandler cgi-script 
  8.  
  9. Options +ExecCGI 
  10.  
  11. </Location> 
  12.  
  13. # config for ExtMail 
  14.  
  15. Alias /extmail/cgi/ /var/www/extsuite/extmail/cgi/ 
  16.  
  17. Alias /extmail /var/www/extsuite/extmail/html/ 
  18.  
  19. <Location "/extmail/cgi"> 
  20.  
  21. SetHandler cgi-script 
  22.  
  23. Options +ExecCGI 
  24.  
  25. </Location> 

apache配置完后安装extmail和extman

 


  
  1. mkdir /var/www/extsuite 

解压extman和extmail 并cp到apache目录下

 


  
  1. cp -r extmail-1.2 /var/www/extsuite/extmail 
  2.  
  3. cp -r extman-1.1 /var/www/extsuite/extman 

切换到/var/www/extsuite/extmail目录下 ,配置extman和extmail。首先生成主配

置文件,并在主配置文件中修改相应选项。

 


  
  1. cp webmail.cf.default webmail.cf 

修改 webmail.cf 下面的选项

 


  
  1. SYS_SESS_DIR = /tmp/extmail 
  2.  
  3. SYS_MAILDIR_BASE = /home/data/domains 
  4.  
  5. SYS_MYSQL_USER = extmail 
  6.  
  7. SYS_MYSQL_PASS = extmail 

切换到/var/www/extsuite/extman目录下

 


  
  1. cp webman.cf.default webman.cf 

修改 webman.cf 下面的选项为邮件目录:

 


  
  1. SYS_MAILDIR_BASE = /home/data/domains 
  2.  
  3. mkdir /tmp/{extman,extmail} 
  4.  
  5. chown vuser:vgroup /tmp/ext* 

另外extman为我们提供了一个友好的图形化日志工具,可以配置并启用这个后台日志

分析工具。

 


  
  1. cd /var/www/extsuite/extman/addon/ 
  2.  
  3. cp -r mailgraph_ext /usr/local/ 

这个日志工具主要是基于perl语言,先安装该工具所需要的依赖包

rrdtool

perl-rrdtool

perl-GD

perl-File-Tail

启动日志分析工具

 


  
  1. /usr/local/mailgraph_ext/mailgraph-init start 
  2.  
  3. echo '/usr/local/mailgraph_ext/mailgraph-init start' >> /etc/rc.local 

重启一下服务,测试一下

 


  
  1. service httpd restart 
  2.  
  3. service postfix restart 
  4.  
  5. chown -R vuser:vgroup /var/lib/php/session/ 

打开 浏 览 器,输 入 http://your_domain_name/extman

用户 为 :root@extmail.org 密码 为 :extmail*123*

垃圾邮件过滤

最后我们加入垃圾邮件的过滤,安装spamassassin,并生成/etc/maildroprc文件,以

便让maildrop在投递过程中调用spamassassin。

SpamAssassin 也会用到的一些 Perl 模块,请检查以后包是否安装了

perl-Time-HiRes

perl-Digest-SHA1

perl-HTML-Parser

perl-DB_File

perl-HTML-Tagset

perl-Razor-Agent

perl-DBI

perl-NetDNS

perl-URI

 


  
  1. yum install spamassassin 

 


  
  1. cat > /etc/maildroprc << ENDF 
  2.  
  3. if ( $SIZE < 26144 ) 
  4.  
  5.  
  6. exception { 
  7.  
  8. xfilter "/usr/bin/spamassassin --prefspath=$HOME/$DEFAULT/.spamassassin/user_prefs 
  9.  
  10.  
  11.  
  12.  
  13. if (/^X-Spam-Flag: *YES/) 
  14.  
  15.  
  16. exception { 
  17.  
  18. to "$HOME/$DEFAULT/.Spam/" 
  19.  
  20.  
  21.  
  22. else 
  23.  
  24.  
  25. exception { 
  26.  
  27. to "$HOME/$DEFAULT" 
  28.  
  29.  
  30.  
  31. ENDF 

Spamassassinn的过滤模板在/etc/mail/spamassassin/local.cf,修改为:

vi /etc/mail/spamassassin/local.cf

 


  
  1. required_score 5.0 
  2.  
  3. rewrite_header Subject ********SPAM******** 
  4.  
  5. report_safe 1 
  6.  
  7. use_bayes 1 
  8.  
  9. skip_rbl_checks 0 
  10.  
  11. ok_languages zh en 
  12.  
  13. ok_locales en ko 
  14.  
  15. score HEAD_ILLEGAL_CHARS 0 
  16.  
  17. score SUBJ_ILLEGAL_CHARS 0 
  18.  
  19. score DATE_IN_PAST_03_06 0 
  20.  
  21. score UPPERCASE_25_50 0 
  22.  
  23. score UPPERCASE_50_75 0 
  24.  
  25. score UPPERCASE_75_100 0 
  26.  
  27. score X_MSMAIL_PRIORITY_HIGH 0 
  28.  
  29. score X_PRIORITY_HIGH 0 
  30.  
  31. score TO_TXT 100 
  32.  
  33. score RATWARE_HASH_2 100 
  34.  
  35. score RATWARE_HASH_2_V2 100 
  36.  
  37. score BAYES_99 0.1 
  38.  
  39. score BAYES_80 0.1 
  40.  
  41. score BAYES_60 0.1 
  42.  
  43. score FROM_ILLEGAL_CHARS 0.1 
  44.  
  45. score MIME_BASE64_TEXT 0.1 
  46.  
  47. score NO_RDNS_DOTCOM_HELO 0.1 
  48.  
  49. score CHINA_HEADER 0.1 
  50.  
  51. score NO_REAL_NAME 0.2 
  52.  
  53. score HTML_MESSAGE 0.2 
  54.  
  55. score MIME_HTML_ONLY 0.2 
  56.  
  57. score MIME_HTML_ONLY_MULTI 0.2 
  58.  
  59. score FORGED_MUA_OUTLOOK 0.2 
  60.  
  61. score FORGED_HOTMAIL_RCVD 0.2 
  62.  
  63. score FORGED_OUTLOOK_TAGS 0.2 
  64.  
  65. score MAILTO_TO_SPAM_ADDR 0.2 
  66.  
  67. ## 黑白名单 
  68.  
  69. whitelist_from *@test.com 
  70.  
  71. blacklist_from 
  72.  
  73. ## 使用中国反垃圾邮件联盟的CBL/CDL 
  74.  
  75. ## URL: http://www.anti-spam.org.cn/ 
  76.  
  77. header RCVD_IN_CBL eval:check_rbl('cbl', 'cbl.anti-spam.org.cn.') 
  78.  
  79. # describe RCVD_IN_CBL Received via a relay in cbl.anti-spam.org.cn 
  80.  
  81. tflags RCVD_IN_CBL net 
  82.  
  83. header RCVD_IN_CDL eval:check_rbl('cdl-notfirsthop', 'cdl.anti-spam.org.cn.') 
  84.  
  85. describe RCVD_IN_CDL CDL: dialup sender did non-local SMTP 
  86.  
  87. tflags RCVD_IN_CDL net 
  88.  
  89. score RCVD_IN_CBL 4.0 
  90.  
  91. score RCVD_IN_CDL 3.0 

# 将spamassassin设定的为开机运行

 


  
  1. chkconfig spamassassin on 

# 使用CCERT 中文垃圾邮件过滤规则集Chinese_rules.cf

 


  
  1. wget -N -P /usr/share/spamassassin 
  2.  
  3. http://www.ccert.edu.cn/spam/sa/Chinese_rules.cf 

# 启动SpamAssassin

service spamassassin start

定期自动更新中文反垃圾邮件规则

crontab -e

# 加入

 


  
  1. 0 0 1 * * wget -N -P /usr/share/spamassassin 
  2.  
  3. http://www.ccert.edu.cn/spam/sa/Chinese_rules.cf ; /etc/init.d/spamassassin restart 

# 建立SpamAssassin 的学习系统


  
  1. sa-learn --sync -D -p user_prefs 

# 查看自学习的数据信息


  
  1. sa-learn --dump all 

# 查看调试信息


  
  1. spamassassin --lint -D 

再次打开浏览器测试。