内部用户转发垃圾邮件到网关服务器上使DSPAM学习垃圾邮件

 拓扑图:

外网----》mx server(dspam+clamd) + mail server(内部)

那么内部用户怎样能才能使用收到的垃圾邮件重新送到网关服务器上使DSPAM重新学习训练呢?

答案是通过aliases和transport来做。

一、在内部服务器上增加别名: hash:/etc/aliases

virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf hash:/etc/aliases

#postalias /etc/aliases 

 

修改/etc/postfix/transport文件

[email protected]  smtp:[mx server ip address]

[email protected]   smtp:[mx server ip address]

#postmap /etc/postfix/transport

当然你也可以直接在mysql中的别名表中增加这两个用户也可以,但是不怎么推荐,因为后期可能造成在网关服务器上邮件循环。

二、在MX网关服务器上如下设置

1、别名文件也如上所示增加hash:/etc/aliases 

spam: [email protected]

notspam: [email protected]

#postalias /etc/aliases

2、修改transport文件

spam.spam       dspam-retrain:spam

notspam.notspam dspam-retrain:innocent

#postmap /etc/postfix/transport

3、修改master文件增加上行中的dspam-retrain这个transport

dspam-retrain   unix    -       n       n       -       10      pipe

        flags=Ru  user=dspam argv=/usr/local/bin/dspam --class=$nexthop --source=error --user dspam

#postfix stop

#postfix reload

OK,现在用户如果收到垃圾邮件那么直接把这个邮件转发到[email protected]用户即可。同样道理送到[email protected]

本文出自 “邓卫华” 博客,转载请与作者联系!

你可能感兴趣的:(邮件,职场,休闲,dspam)