centos – Postfix,如何拒绝来自未知IP的垃圾邮件(无DNS)

前端之家收集整理的这篇文章主要介绍了centos – Postfix,如何拒绝来自未知IP的垃圾邮件(无DNS)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
尽管我已经尽力过滤垃圾邮件,但即使在我将main.cf设置为不允许它并检查DNS等之后,我仍然会收到来自未知的垃圾邮件.即使在添加了一个pcre:到REJECT /.unknown./之后他们仍然通过,我不明白为什么!这是我的日志文件.第一个块是好的,它被拒绝了,它来自未知.第二个块是相同的,来自未知但它通过而不被拒绝.我希望拒绝所有“来自未知的联系”而不仅仅是其中一些. Centos上的postfix v2.8.4.我有什么想法我做错了吗?谢谢.

该块被拒绝

  1. Nov 24 12:00:30 sof postfix/smtpd[4632]: connect from unknown[91.99.51.137]
  2. Nov 24 12:00:30 sof postfix/smtpd[4632]: connect from unknown[91.99.51.137]
  3. Nov 24 12:00:31 sof postfix/smtpd[4632]: NOQUEUE: reject: RCPT from unknown[91.99.51.137]: 450 4.7.1 <91.99.51.137.parsonline.net>: Helo command rejected: Host not found; from=<emailsend@urbangroup.kz> to=<name@domain.com> proto=ESMTP helo=<91.99.51.137.parsonline.net>
  4. Nov 24 12:00:31 sof postfix/smtpd[4632]: NOQUEUE: reject: RCPT from unknown[91.99.51.137]: 450 4.7.1 <91.99.51.137.parsonline.net>: Helo command rejected: Host not found; from=<emailsend@urbangroup.kz> to=<name@domain.com> proto=ESMTP helo=<91.99.51.137.parsonline.net>
  5. Nov 24 12:00:31 sof /usr/lib64/plesk-9.0/psa-pc-remote[678]: Message aborted.
  6. Nov 24 12:00:31 sof /usr/lib64/plesk-9.0/psa-pc-remote[678]: Message aborted.
  7. Nov 24 12:00:31 sof /usr/lib64/plesk-9.0/psa-pc-remote[678]: Message aborted.
  8. Nov 24 12:00:31 sof postfix/smtpd[4632]: disconnect from unknown[91.99.51.137]
  9. Nov 24 12:00:31 sof /usr/lib64/plesk-9.0/psa-pc-remote[678]: Message aborted.
  10. Nov 24 12:00:31 sof postfix/smtpd[4632]: disconnect from unknown[91.99.51.137]

此块不会被拒绝

  1. Nov 24 14:16:09 sof postfix/smtpd[8221]: connect from unknown[190.237.252.197]
  2. Nov 24 14:16:09 sof postfix/smtpd[8221]: connect from unknown[190.237.252.197]
  3. Nov 24 14:16:18 sof postfix/smtpd[8221]: 9467B848368A: client=unknown[190.237.252.197]
  4. Nov 24 14:16:18 sof postfix/smtpd[8221]: 9467B848368A: client=unknown[190.237.252.197]
  5. Nov 24 14:16:23 sof postfix/cleanup[8428]: 9467B848368A: message-id=<9186950014.574880.74670.SendMail@domain.com>
  6. Nov 24 14:16:23 sof postfix/cleanup[8428]: 9467B848368A: message-id=<9186950014.574880.74670.SendMail@domain.com>
  7. Nov 24 14:16:25 sof /usr/lib64/plesk-9.0/psa-pc-remote[678]: handlers_stderr: SKIP
  8. Nov 24 14:16:25 sof /usr/lib64/plesk-9.0/psa-pc-remote[678]: handlers_stderr: SKIP
  9. Nov 24 14:16:25 sof /usr/lib64/plesk-9.0/psa-pc-remote[678]: SKIP during call 'check-quota' handler
  10. Nov 24 14:16:25 sof /usr/lib64/plesk-9.0/psa-pc-remote[678]: SKIP during call 'check-quota' handler
  11. Nov 24 14:16:25 sof postfix/qmgr[19747]: 9467B848368A: from=<Garcia.Ryan@iter.ru>,size=5285,nrcpt=1 (queue active)
  12. Nov 24 14:16:25 sof postfix/qmgr[19747]: 9467B848368A: from=<Garcia.Ryan@iter.ru>,nrcpt=1 (queue active)
  13. Nov 24 14:16:25 sof postfix-local[8481]: postfix-local: from=Garcia.Ryan@iter.ru,to=name@domain.com,dirname=/var/qmail/mailnames
  14. Nov 24 14:16:25 sof postfix-local[8481]: postfix-local: from=Garcia.Ryan@iter.ru,dirname=/var/qmail/mailnames
  15. Nov 24 14:16:25 sof spamc[8483]: connect(AF_UNIX) to spamd /tmp/spamd_full.sock Failed: No such file or directory
  16. Nov 24 14:16:25 sof spamc[8483]: connect(AF_UNIX) to spamd /tmp/spamd_full.sock Failed: No such file or directory
  17. Nov 24 14:16:25 sof postfix-local[8481]: handlers_stderr: PASS
  18. Nov 24 14:16:25 sof postfix-local[8481]: handlers_stderr: PASS
  19. Nov 24 14:16:25 sof postfix-local[8481]: PASS during call 'spam' handler
  20. Nov 24 14:16:25 sof postfix-local[8481]: PASS during call 'spam' handler
  21. Nov 24 14:16:25 sof postfix/pipe[8435]: 9467B848368A: to=<name@domain.com>,orig_to=<name@domain.com>,relay=plesk_virtual,delay=7.9,delays=7.9/0/0/0.02,dsn=2.0.0,status=sent (delivered via plesk_virtual service)
  22. Nov 24 14:16:25 sof postfix/pipe[8435]: 9467B848368A: to=<name@domain.com>,status=sent (delivered via plesk_virtual service)
  23. Nov 24 14:16:25 sof postfix/qmgr[19747]: 9467B848368A: removed
  24. Nov 24 14:16:25 sof postfix/qmgr[19747]: 9467B848368A: removed
  25. Nov 24 14:16:27 sof postfix/smtpd[8221]: disconnect from unknown[190.237.252.197]
  26. Nov 24 14:16:27 sof postfix/smtpd[8221]: disconnect from unknown[190.237.252.197]

这是我的main.cf文件的一部分

  1. smtpd_tls_cert_file = /etc/postfix/domain.pem
  2. smtpd_tls_key_file = $smtpd_tls_cert_file
  3. smtpd_tls_security_level = may
  4. smtpd_use_tls = yes
  5. smtp_tls_security_level = may
  6. smtp_use_tls = no
  7. smtpd_timeout = 3600s
  8. smtpd_proxy_timeout = 3600s
  9. disable_vrfy_command = yes
  10. smtpd_helo_required = yes
  11.  
  12. smtpd_sender_restrictions =
  13. permit_mynetworks,permit_sasl_authenticated,check_sender_access pcre:/etc/postfix/rejected_domains,reject_non_fqdn_sender,reject_unknown_sender_domain,reject_unlisted_sender,permit
  14.  
  15. smtpd_helo_restrictions =
  16. permit_mynetworks,reject_non_fqdn_helo_hostname,reject_invalid_helo_hostname,reject_unknown_helo_hostname,permit
  17.  
  18. smtpd_recipient_restrictions =
  19. permit_sasl_authenticated,reject_invalid_hostname,reject_non_fqdn_hostname,reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_mynetworks,reject_rbl_client regexp:/etc/postfix/postfix_client_blacklist,reject_unauth_destination,check_client_access hash:/etc/postfix/rbl_whitelist,check_client_access pcre:/var/spool/postfix/plesk/no_relay.re,reject_rbl_client bl.spamcop.net,permit

这是postfix_client_blacklist文件

  1. /^.*unknown.*$/ REJECT FCrDNS # I tried all kinds of ways found on the Internet.
你在找 reject_unknown_client_hostname.

documentation开始:

reject_unknown_client_hostname (with Postfix < 2.3:
reject_unknown_client)
Reject the request when 1) the client IP
address->name mapping fails,2) the name->address mapping fails,or 3)
the name->address mapping does not match the client IP address. This
is a stronger restriction than the
reject_unknown_reverse_client_hostname feature,which triggers only
under condition 1) above. The unknown_client_reject_code parameter
specifies the response code for rejected requests (default: 450). The
reply is always 450 in case the address->name or name->address lookup
Failed due to a temporary problem.

示例用法:(在我的实时邮件服务器上看到)

  1. smtpd_client_restrictions =
  2. permit_mynetworks,reject_unauth_pipelining,reject_unknown_client_hostname,permit

猜你在找的CentOS相关文章