主题: 如何建立反垃圾邮件白名单
==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.9.0,iredapd:1.6.0
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):MySQL
- 使用的 Linux/BSD 发行版名称及版本号:CentOS6.5
- 与您的问题相关的日志信息:
====
张工:因为现在反垃圾邮件spamassassin会将一些正常邮件标记为垃圾邮件(打上[SPAM]标签),我想通过增加反垃圾邮件白名单,使spamassassin不对白名单里的域进行反垃圾邮件扫描。我想请问下这个要怎么做。
是否是通过启用amavisd_wblist.py插件来实现,如果是,我查看了下脚本中写的说明文档,但是对配置上还是有些疑惑:
# How to use this plugin:
#
# *) Enable `@lookup_sql_dsn` in Amavisd config file.
#
# *) Set Amavisd lookup SQL database related parameters (amavisd_db_*) in
# iRedAPD config file `settings.py`, and enable this plugin.
#
# *) Enable iRedAPD in Postfix `smtpd_recipient_restrictions`.
#
# *) Enable this plugin in iRedAPD config file (/opt/iredapd/settings.py).
# *) Restart both iRedAPD and Postfix services.
1.Enable `@lookup_sql_dsn` in Amavisd config file.
# @lookup_sql_dsn =
# ( ['DBI:mysql:database=mail;host=127.0.0.1;port=3306', 'user1', 'passwd1'],
# ['DBI:mysql:database=mail;host=host2', 'username2', 'password2'],
# ["DBI:SQLite:dbname=$MYHOME/sql/mail_prefs.sqlite", '', ''] );
# @storage_sql_dsn = @lookup_sql_dsn; # none, same, or separate database
# @storage_redis_dsn = ( {server=>'127.0.0.1:6379', db_id=>1} );
# $redis_logging_key = 'amavis-log';
# $redis_logging_queue_size_limit = 300000; # about 250 MB / 100000
...
@lookup_sql_dsn = @storage_sql_dsn;
我在我的amavisd.conf文件中找到两处关于lookup_sql_dsn参数的内容,是要把以下配置前的注释都去掉吗?但是数据库、账号和密码应该对应填什么?是否是填写第二步中对应的amavisd_db_name、amavisd_db_user、amavisd_db_password
# @lookup_sql_dsn =
# ( ['DBI:mysql:database=mail;host=127.0.0.1;port=3306', 'user1', 'passwd1'],
# ['DBI:mysql:database=mail;host=host2', 'username2', 'password2'],
# ["DBI:SQLite:dbname=$MYHOME/sql/mail_prefs.sqlite", '', ''] );
2.Set Amavisd lookup SQL database related parameters (amavisd_db_*) in iRedAPD config file `settings.py`, and enable this plugin.
plugins = ["reject_null_sender", "amavisd_message_size_limit", "amavisd_wblist", "sql_alias_access_policy"]
...
# For Amavisd policy lookup
amavisd_db_server = "127.0.0.1"
amavisd_db_port = "3306"
amavisd_db_name = "amavisd"
amavisd_db_user = "amavisd"
amavisd_db_password = "xxxx"
以上是settings.py文件中的默认参数,是否还需要做其他操作?
3.Enable iRedAPD in Postfix `smtpd_recipient_restrictions`.
smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/MYRules/Mail_recipients,reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unlisted_recipient, check_policy_service inet:127.0.0.1:7777, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
以上是main.cf文件中smtpd_recipient_restrictions参数的配置,是否需要调整
4.Enable this plugin in iRedAPD config file (/opt/iredapd/settings.py).
这个是否是对应着第二步的plugins = ["reject_null_sender", "amavisd_message_size_limit", "amavisd_wblist", "sql_alias_access_policy"],还是有其他什么需要配置。
5.Restart both iRedAPD and Postfix services.
配置完后我要如何新增并管理我的白名单?