主题: [已解决] 黑名单如何起作用?谢谢

版主,我在邮件系统测试如下:允许发送给以下收件人:当前域@jameskingdom.com禁止发送给以下发件人:所有域@.希望实现仅可以内部域发送,但是实际测试,我发送到另外的域还是可以收到邮件。Debug log如下,请参考。2011-08-01 10:58:40 INFO Starting iredapd (v1.3.5, pid: 2821), listening on 127.0.0.1:7777.2011-08-01 10:58:40 DEBUG Forking first child.2011-08-01 10:58:40 DEBUG Creating new session2011-08-01 10:58:40 DEBUG Forking second child.2011-08-01 10:58:40 DEBUG Setting umask2011-08-01 10:58:40 DEBUG Changing working directory to

回复: [已解决] 黑名单如何起作用?谢谢

您贴的 debug log 只是 iRedAPD 启动时的信息,没有任何发送邮件相关的信息。
另外,请注意您需要的这个功能需要启用 iRedAPD 的插件 block_amavisd_blacklisted_senders。

回复: [已解决] 黑名单如何起作用?谢谢

ZhangHuangbin 写道:

您贴的 debug log 只是 iRedAPD 启动时的信息,没有任何发送邮件相关的信息。
另外,请注意您需要的这个功能需要启用 iRedAPD 的插件 block_amavisd_blacklisted_senders。

1、我在Roundcube中发送测试邮件进行测试。
2、已经启用该插件,但是发送好像没有生效。

回复: [已解决] 黑名单如何起作用?谢谢

Michael 写道:

2、已经启用该插件,但是发送好像没有生效。

麻烦贴一下这个命令的输出:

# postconf -n

另外,可以在 /opt/iredapd/etc/iredapd*.ini 里将日志级别设置为 debug,重启 iredapd 服务,再进行测试并检查 /var/log/iredapd*.log 里的信息。

回复: [已解决] 黑名单如何起作用?谢谢

root@mail:~$  postconf -n
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
allow_min_user = no
append_dot_mydomain = no
biff = no
bounce_queue_lifetime = 1d
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
delay_warning_time = 0h
disable_vrfy_command = yes
enable_original_recipient = no
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = ipv4
mailbox_command = /usr/lib/dovecot/deliver
mailbox_size_limit = 0
maximal_backoff_time = 4000s
maximal_queue_lifetime = 1d
message_size_limit = 15728640
minimal_backoff_time = 300s
mydestination = $myhostname, localhost, localhost.localdomain, localhost.$myhostname
mydomain = jamestextile.com
myhostname = mail.jamestextile.com
mynetworks = 192.168.0.0/24,127.0.0.0/8
mynetworks_style = subnet
myorigin = mail.jamestextile.com
proxy_read_maps = $canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $smtpd_sender_restrictions
queue_run_delay = 300s
readme_directory = no
recipient_bcc_maps = proxy:ldap:/etc/postfix/ldap/recipient_bcc_maps_domain.cf, proxy:ldap:/etc/postfix/ldap/recipient_bcc_maps_user.cf
recipient_delimiter = +
relay_domains = $mydestination, proxy:ldap:/etc/postfix/ldap/relay_domains.cf
relayhost =
sender_bcc_maps = proxy:ldap:/etc/postfix/ldap/sender_bcc_maps_domain.cf, proxy:ldap:/etc/postfix/ldap/sender_bcc_maps_user.cf
smtp_data_init_timeout = 240s
smtp_data_xfer_timeout = 600s
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_enforce_tls = no
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks,permit_sasl_authenticated, check_helo_access pcre:/etc/postfix/helo_access.pcre
smtpd_recipient_restrictions = 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, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, check_policy_service inet:127.0.0.1:10031
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = no
smtpd_sasl_local_domain =
smtpd_sasl_path = ./dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = proxy:ldap:/etc/postfix/ldap/sender_login_maps.cf
smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated, check_policy_service inet:127.0.0.1:7778
smtpd_tls_CAfile = /etc/ssl/certs/iRedMail_CA.pem
smtpd_tls_cert_file = /etc/ssl/certs/iRedMail_CA.pem
smtpd_tls_key_file = /etc/ssl/private/iRedMail.key
smtpd_tls_loglevel = 0
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
transport_maps = proxy:ldap:/etc/postfix/ldap/transport_maps_user.cf, proxy:ldap:/etc/postfix/ldap/transport_maps_domain.cf
virtual_alias_domains =
virtual_alias_maps = proxy:ldap:/etc/postfix/ldap/virtual_alias_maps.cf, proxy:ldap:/etc/postfix/ldap/virtual_group_maps.cf, proxy:ldap:/etc/postfix/ldap/sender_login_maps.cf, proxy:ldap:/etc/postfix/ldap/catchall_maps.cf
virtual_gid_maps = static:1001
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:ldap:/etc/postfix/ldap/virtual_mailbox_domains.cf
virtual_mailbox_maps = proxy:ldap:/etc/postfix/ldap/virtual_mailbox_maps.cf
virtual_minimum_uid = 1001
virtual_transport = dovecot
virtual_uid_maps = static:1001

6 最后由 Michael (2011-08-04 10:49:59) 编辑

回复: [已解决] 黑名单如何起作用?谢谢

抓到一共错误,在iredapd-rr.ini中少了bypass_mynetworks,加上bypass_mynetworks = no后测试还不行。
2011-08-04 10:12:29 DEBUG Error: No option 'bypass_mynetworks' in section: 'general'. Use default action instead: DUNNO

另外,我是根据wiki设置iredapd-rr,怎么会漏了bypass_mynetworks呢?

回复: [已解决] 黑名单如何起作用?谢谢

smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated, check_policy_service inet:127.0.0.1:7778

这里的 check_policy_service inet:127.0.0.1:7778 应该排在 permit_mynetworks 之前。顺序非常重要。

回复: [已解决] 黑名单如何起作用?谢谢

测试OK,谢谢!